INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Abstract array class"
project: "Visual Eiffel"
revision: "$Revision: 1.2 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: grape
class ARRAY_MODEL [G]
creation

make
feature {NONE}-- Creation

make
feature -- Measurement

count: INTEGER
feature -- Access

item (i: INTEGER): G
-- Item at the `i'-th position.

has (t: G): BOOLEAN
-- Is item `t' present in the array?

item_number (t: G): INTEGER
-- Index of item `t' starting from 1 for the first item or
-- 0 if there is no such item

sub_array (start, finish: INTEGER): ARRAY_MODEL [G]
-- Retreive a part of array.
feature -- Modification

add (t: G)
-- Appends specified object to the end of the array

insert_at_pos (t: G; pos: INTEGER)
-- Insert an item at a specified location

insert_before (t: G; before: G)
-- Insert an item `t' before an item `before'

insert_after (t: G; after: G)
-- Insert an item `t' after an item `after'

remove_at_pos (pos: INTEGER)
-- Remove an item at the specified position.

remove (t: G)
-- Remove an item `t'

put_at_pos (t: G; pos: INTEGER)
-- Replace an item at the specified position.

wipe
-- Remove all items.
ensure
is_empty: count = 0

adapt (another: ARRAY_MODEL [G])
-- Copy contents of another array into this one
-- loosing its previous contents (if any).

append (another: ARRAY_MODEL [G])
-- Append the contents of another array to the end.

wipe_and_resize (new_size: INTEGER)
-- Remove all elements and make an array of `new_size' items.
ensure
count = new_size
end -- class ARRAY_MODEL

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES