INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Trees where the children of each node are kept in an array"
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: tree
cluster: eiffelbase
class ARRAYED_TREE [G]
inherit

CELL [G]
end

DYNAMIC_TREE [G]
undefine
child_after,
child_before,
child_off,
readable_child,
writable_child
redefine
attach_to_parent,
duplicate,
duplicate_all,
extend,
fill_subtree,
parent
select
has,
linear_representation,
object_comparison
end

ARRAYED_LIST [ARRAYED_TREEG]
rename
make as al_make,
item as child,
i_th as array_item,
last as last_child,
first as first_child,
search as search_child,
has as al_has,
readable as readable_child,
extend as al_extend,
extendible as al_extendible,
put as al_put,
replace as al_replace,
fill as al_fill,
writable as writable_child,
remove as al_remove,
remove_left as al_remove_left,
remove_right as al_remove_right,
linear_representation as al_lin_rep,
count as arity,
empty as is_leaf,
full as al_full,
start as child_start,
finish as child_finish,
forth as child_forth,
back as child_back,
go_i_th as child_go_i_th,
index as child_index,
off as child_off,
after as child_after,
before as child_before,
isfirst as child_isfirst,
islast as child_islast,
cursor as child_cursor,
go_to as child_go_to,
duplicate as al_duplicate,
put_left as al_put_left,
put_right as al_put_right,
merge_left as al_merge_left,
merge_right as al_merge_right,
object_comparison as al_object_comparison
export
{NONE}
al_duplicate,
al_extend,
al_fill,
al_full,
al_has,
al_lin_rep,
al_make,
al_merge_left,
al_merge_right,
al_object_comparison,
al_put,
al_put_left,
al_put_right,
al_remove,
al_remove_left,
al_remove_right,
al_replace
undefine
changeable_comparison_criterion,
child_isfirst,
child_islast,
compare_objects,
compare_references,
consistent,
copy,
is_equal,
is_leaf,
setup,
valid_cursor_index
redefine
child
select
is_leaf
end
creation

make
feature -- Initialization

make (n: INTEGER; v: G)
-- Create node with item `v'.
-- Allocate space for `n' children.
require
valid_number_of_children: n >= 0
ensure
node_item: item = v
feature -- Access

parent: like Current

child: like Current

left_sibling: like parent
-- Left neighbor if any

right_sibling: like parent
-- Right neighbor if any
feature -- Element change

child_put, child_replace (v: G)
-- Replace current child item with `v'.

replace_child (n: like parent)
-- Make `n' the node's current child.
ensure
child_replaced: n.parent = Current

child_extend (v: G)
-- Add `v' at end.
-- Do not move child cursor.

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

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

put_child_left (n: like parent)
-- Add `n' to the left of cursor position.
-- Do not move cursor.

put_child_right (n: like parent)
-- Add `n' to the right of the cursor position.
-- Do not move cursor.

put_child (n: like parent)
-- Add `n' to the list of children.
-- Do not move child cursor.

merge_tree_before (other: like parent)
-- Merge children of `other' into current structure
-- before cursor position. Do not move cursor.
-- Make `other' a leaf.

merge_tree_after (other: like parent)
-- Merge children of `other' into current structure
-- after cursor position. Do not move cursor.
-- Make `other' a leaf.
feature -- Removal

remove_child
-- Remove child at cursor position.
-- Move cursor to the next sibling, or `after' if none.

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

remove_right_child
-- Remove item to the right of cursor position.
-- Do not move cursor.
feature -- Duplication

duplicate (n: INTEGER): like Current
-- Copy of sub-tree beginning at cursor position and
-- having min (`n', `arity' - `child_index' + 1)
-- children.
end -- class ARRAYED_TREE

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES