INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Sequential, two-way linked lists"
title: "EiffelBase: library of reusable components for Eiffel. ", "Based on EiffelBase library for ISE Eiffel, ", "used with permission. "
project: "EiffelBase Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
key: two_way_list, sequence
cluster: eiffelbase
class TWO_WAY_LIST [G]
inherit

LINKED_LIST [G]
redefine
back,
extend,
finish,
first_element,
forth,
islast,
last_element,
merge_left,
merge_right,
move,
new_cell,
new_chain,
previous,
put_front,
put_left,
put_right,
remove,
remove_left,
remove_right,
wipe_out
select
merge_right,
move,
put_front,
put_right,
wipe_out
end

LINKED_LIST [G]
rename
put_front as ll_put_front,
put_right as ll_put_right,
merge_right as ll_merge_right,
move as ll_move,
wipe_out as ll_wipe_out
export
{NONE}
ll_merge_right,
ll_move,
ll_put_front,
ll_put_right,
ll_wipe_out
redefine
back,
extend,
finish,
first_element,
forth,
islast,
last_element,
merge_left,
new_cell,
new_chain,
previous,
put_left,
remove,
remove_left,
remove_right
end
creation

make,
make_sublist
feature -- Access

first_element: BI_LINKABLE [G]

last_element: like first_element

sublist: like Current
feature -- Status report

islast: BOOLEAN
-- Is cursor at last position?
feature -- Cursor movement

forth
-- Move cursor to next position, if any.

back
-- Move cursor to previous position, if any.

finish
-- Move cursor to last position.
-- (Go before if empty)
ensure
not_after: not after

move (i: INTEGER)
-- Move cursor `i' positions. The cursor
-- may end up `off' if the offset is to big.
feature -- Element change

put_front (v: G)
-- Add `v' to beginning.
-- Do not move cursor.

extend (v: G)
-- Add `v' to end.
-- Do not move cursor.

put_left (v: G)
-- Add `v' to the left of cursor position.
-- Do not move cursor.

put_right (v: G)
-- Add `v' to the right of cursor position.
-- Do not move cursor.

merge_left (other: like Current)
-- Merge `other' into current structure before cursor
-- position. Do not move cursor. Empty `other'.

merge_right (other: like Current)
-- Merge `other' into current structure after cursor
-- position. Do not move cursor. Empty `other'.
feature -- Removal

remove
-- Remove current item.
-- Move cursor to right neighbor
-- (or `after' if no right neighbor).

remove_left
-- Remove item to the left of cursor position.
-- Do not move cursor.

remove_right
-- Remove item to the right of cursor position.
-- Do not move cursor.

wipe_out
-- Remove all items.

split (n: INTEGER)
-- Remove from current list
-- min (`n', `count' - `index' - 1) items
-- starting at cursor position.
-- Move cursor right one position.
-- Make extracted sublist accessible
-- through attribute `sublist'.
require
not_off: not off
valid_sublist: n >= 0

remove_sublist
feature {TWO_WAY_LIST}-- Implementation

make_sublist (first_item, last_item: like first_element; n: INTEGER)
-- Create sublist
end -- class TWO_WAY_LIST

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES