Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:
indexing description: "Compact trees as active structures that may be traversed using a cursor" status: "See notice at end of class" names: compact_cursor_tree, cursor_tree representation: array access: cursor, membership size: resizable contents: generic date: "$Date: 2001-11-16 20:32:23 +0000 (Fri, 16 Nov 2001) $" revision: "$Revision: 51435 $" class interface COMPACT_CURSOR_TREE [G] create make feature -- Initialization make (i: INTEGER) -- Create an empty tree. -- i is an estimate of the number of nodes. ensure is_above: above is_empty: is_empty feature -- Access has (v: like item): BOOLEAN -- Does structure include an occurrence of v? -- (Reference or object equality, -- based on object_comparison.) occurrences (v: G): INTEGER -- Number of times v appears. -- (Reference or object equality, -- based on object_comparison.) item: G -- Current item cursor: CURSOR -- Current cursor position feature -- Measurement arity: INTEGER -- Number of children count: INTEGER -- Number of items in subtree feature -- Status report after: BOOLEAN -- Is there no valid cursor position to the right of cursor? before: BOOLEAN -- Is there no valid cursor position to the left of cursor? above: BOOLEAN -- Is there no valid cursor position above the cursor? isfirst: BOOLEAN -- Is cursor on first sibling? islast: BOOLEAN -- Is cursor on last sibling? is_root: BOOLEAN -- Is cursor on root? Full: BOOLEAN is False -- Is tree filled to capacity? (Answer: no.) is_empty: BOOLEAN prunable: BOOLEAN valid_cursor (p: CURSOR): BOOLEAN -- Can the cursor be moved to position p? feature -- Cursor movement back -- Move cursor one position backward. forth -- Move cursor one position forward. up -- Move cursor one level upward, to parent -- or above if is_root holds. down (i: INTEGER) -- Move cursor one level downward: -- to i-th child if there is one, -- or after if i = arity + 1, -- or before if i = 0. require else True go_to (p: CURSOR) -- Move cursor to position p. feature -- Element change replace (v: G) -- Replace current item by v require else is_writable: writable put_right (v: G) -- Add a leaf v to the right of cursor position. put_left (v: G) -- Add v to the left of current position. require else not_above: not above put_front (v: G) -- Add a leaf v as first child. -- If above and is_empty, make v the root value put_parent (v: G) -- insert a new node, with value v, as parent of -- current node and -- with the same position --if above or on root, add a new root require not after not before extend (v: G) feature -- Removal remove -- Remove node at cursor position -- (and consequently the corresponding subtree). -- Move cursor to next sibling, or after if none. ensure then not_before: not before remove_node -- Remove node at cursor position; insert children into -- parent's children at current position; move cursor up. -- If node is root, it must not have more than one child. require not_off: not off is_root implies arity <= 1 wipe_out -- Remove all items. ensure then cursor_above: above indexing library: "[ EiffelBase: Library of reusable components for Eiffel. ]" status: "[ Copyright 1986-2001 Interactive Software Engineering (ISE). For ISE customers the original versions are an ISE product covered by the ISE Eiffel license and support agreements. ]" license: "[ EiffelBase may now be used by anyone as FREE SOFTWARE to develop any product, public-domain or commercial, without payment to ISE, under the terms of the ISE Free Eiffel Library License (IFELL) at http://eiffel.com/products/base/license.html. ]" source: "[ Interactive Software Engineering Inc. ISE Building 360 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Electronic mail <info@eiffel.com> Customer support http://support.eiffel.com ]" info: "[ For latest info see award-winning pages: http://eiffel.com ]" end -- class COMPACT_CURSOR_TREE
Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com