INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Lists with fixed maximum numbers of items, implemented by ", "arrays "
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: fixed, sequence
cluster: eiffelbase
class FIXED_LIST [G]
inherit

LIST [G]
export
{ANY}
put
{NONE}
extend,
fill,
force,
prune,
prune_all
undefine
infix "@",
consistent,
copy,
force,
has,
i_th,
is_equal,
occurrences,
prune,
prune_all,
put_i_th,
setup,
valid_index
redefine
finish,
first,
go_i_th,
last,
move,
put,
remove,
start,
swap
select
extendible
end

ISE_ARRAY [G]
rename
make as array_make,
put as put_i_th,
item as i_th,
force as force_i_th,
bag_put as put,
extendible as array_extendible
export
{NONE}
all
{ANY}
infix "@",
consistent,
copy,
has,
i_th,
is_equal,
occurrences,
put_i_th,
setup,
valid_index
{FIXED_LIST}
array_make
undefine
linear_representation,
put,
resizable
redefine
extend,
full,
prunable
end

FIXED [G]
undefine
consistent,
copy,
full,
is_equal,
setup
end
creation

make,
make_filled
feature -- Initialization

make (n: INTEGER)
-- Create an empty list.
ensure
is_before: before
new_count: count = 0

make_filled (n: INTEGER)
-- Create a list with `n' void elements.
ensure
is_before: before
new_count: count = n
feature -- Access

index: INTEGER

item: G
-- Current item

first: like item
-- Item at first position

last: like item
-- Item at last position

cursor: CURSOR
-- Current cursor position
feature -- Status report

extendible: BOOLEAN
-- May new items be added?

prunable: BOOLEAN
-- May items be removed?

full: BOOLEAN
-- Is the list full?

valid_cursor (p: CURSOR): BOOLEAN
-- Is `p' a valid cursor?
feature -- Cursor movement

move (i: INTEGER)
-- Move cursor `i' positions.

start
-- Move cursor to first position.

finish
-- Move cursor to last position.

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

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

go_i_th (i: INTEGER)
-- Move cursor to `i'-th position.

go_to (p: CURSOR)
-- Move cursor to element remembered in `p'.
feature -- Element change

put (v: G)
-- Replace current item by `v'.
-- (Synonym for `replace')
require
true

replace (v: G)
-- Replace current item by `v'.

extend (v: G)
-- Add `v' to end.
-- Move index to the current item.

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

swap (i: INTEGER)
-- Exchange item at `i'-th position with item
-- at cursor position.
feature -- Duplication

duplicate (n: INTEGER): like Current
-- Copy of sub-list beginning at cursor position
-- and having min (`n', `count' - `index' + 1) items
end -- class FIXED_LIST

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES