Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

structure.support

Class DS_BILINKABLE


Direct ancestors

DS_LINKABLE

Creation

Features

Invariants

indexing

description

Linkable cells with a reference to their left and right neighbors

library

Gobo Eiffel Structure Library

copyright

Copyright (c) 1999, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 17:54:23 $

revision

$Revision: 1.7 $

class

DS_BILINKABLE [G]

inherit

DS_LINKABLE

create

make (v: G)

-- Insert v in cell.

-- (From DS_CELL)

ensure
inserted: item = v

feature -- Access

item: G

-- Content of cell

-- (From DS_CELL)

left: like Current

-- Left neighbor

right: like Current

-- Right neighbor

-- (From DS_LINKABLE)

feature -- Element change

forget_left

-- Remove left neighbor.

ensure
forgotten: left = Void
forget_right

-- Remove right neighbor.

-- (From DS_LINKABLE)

ensure
forgotten: right = Void
make (v: G)

-- Insert v in cell.

-- (From DS_CELL)

ensure
inserted: item = v
put (v: G)

-- Insert v in cell.

-- (From DS_CELL)

ensure
inserted: item = v
put_left (other: like Current)

-- Put other to left of cell.
-- Make sure that link is bidirectional.

require
other_not_void: other /= Void
ensure
linked: left = other
bilinked: other.right = Current
put_right (other: like Current)

-- Put other to right of cell.
-- Make sure that link is bidirectional.

-- (From DS_LINKABLE)

require
other_not_void: other /= Void
ensure
linked: right = other
ensure then
bilinked: other.left = Current

feature {DS_BILINKABLE} -- Implementation

attach_left (other: like Current)

-- Put other to left of cell.

ensure
linked: left = other
attach_right (other: like Current)

-- Put other to right of cell.

ensure
linked: right = other

invariant


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end