Class DS_BILINKABLE PreviousNext

note
description:

    "Linkable cells with a reference to their left and right neighbors"

library:    "Gobo Eiffel Structure Library"
author:     "Eric Bezault <ericb@gobosoft.com>"
copyright:  "Copyright (c) 1999, Eric Bezault and others"
license:    "MIT License"
class interface
DS_BILINKABLE [G]
inherit
DS_LINKABLE [G]
    DS_CELL [G]
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.)
right: like Current
        -- Right neighbor
        -- (From DS_LINKABLE.)
left: like Current
        -- Left neighbor
feature -- Element change
put, make (v: G)
        -- Insert v in cell.
        -- (From DS_CELL.)
    ensure
        inserted: item = v
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
        bilinked: other.left = Current
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
forget_right
        -- Remove right neighbor.
        -- (From DS_LINKABLE.)
    ensure
        forgotten: right = Void
forget_left
        -- Remove left neighbor.
    ensure
        forgotten: left = Void
end -- class DS_BILINKABLE

Copyright © 1999, Eric Bezault
mailto:
ericb@gobosoft.com
http:
//www.gobosoft.com
Last Updated: 8 August 1999

HomeTocPreviousNext