Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Text Flat Contracts Flat contracts Go to:
indexing description: "Trees as active structures that may be traversed using a cursor" status: "See notice at end of class" names: cursor_tree, tree access: cursor, membership contents: generic date: "$Date: 2001-11-16 20:32:23 +0000 (Fri, 16 Nov 2001) $" revision: "$Revision: 51435 $" deferred class interface CURSOR_TREE [G] feature -- Access parent_item: G -- Item in parent. require not_on_root: not is_root child_item (i: INTEGER): G -- Item in i-th child require argument_within_bounds: i >= 1 and then i <= arity not_off: not off has (v: G): BOOLEAN -- Does structure include an occurrence of v? -- (Reference or object equality, -- based on object_comparison.) occurrences (v: G): INTEGER feature -- Measurement depth: INTEGER -- Depth of the tree level: INTEGER -- Level of current node in tree -- (Root is on level 1) breadth: INTEGER -- Breadth of current level feature -- Status report readable: BOOLEAN -- Is there a current item that may be read? writable: BOOLEAN -- Is there a current item that may be modified? extendible: BOOLEAN -- May new items be added? is_leaf: BOOLEAN -- Is cursor on a leaf? off: BOOLEAN -- Is there no current item? -- (True if is_empty) 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 cursor? below: BOOLEAN -- Is there no valid cursor position below cursor? isfirst: BOOLEAN -- Is cursor on first sibling? islast: BOOLEAN -- Is cursor on last sibling? is_root: BOOLEAN -- Is cursor on root? valid_cursor_index (i: INTEGER): BOOLEAN -- Can cursor be moved to i-th child? -- 0 is before and arity + 1 is after. feature -- Cursor movement start -- Move cursor to root. -- Leave cursor off if is_empty. ensure then on_root_unless_empty: not is_empty implies is_root go_last_child -- Go to the last child of current parent. -- No effect if below require else not_above: not above 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. require else not_above: not above ensure then not_before: not before not_after: not after not_below: not below coherency: (not old off and above) = (old is_root) 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 not_before: not before not_after: not after not_below: not below valid_cursor_index: (above and i = 0) or else valid_cursor_index (i) ensure then gone_before: (i = 0) implies before preorder_forth -- Move cursor to next position in preorder. -- If the active node is the last in -- preorder, the cursor ends up off. postorder_forth -- Move cursor to next position in postorder. -- If the active node is the last in -- postorder, the cursor ends up off. require not_off: not off breadth_forth -- Move cursor to next position in breadth-first order. -- If the active node is the last in -- breadth-first order, the cursor ends up off. require not_off: not off start_on_level (l: INTEGER) -- Move the cursor to the first position -- of the l-th level counting from root. require argument_within_bounds: l >= 1 and then depth >= l ensure level_expected: level = l is_first: isfirst level_forth -- Move cursor to next position of current level. level_back -- Move cursor to previous position of current level. postorder_start -- Move cursor to first position in postorder. -- Leave cursor off if tree is empty. feature -- Element change put (v: G) -- Put v at cursor position. -- (Synonym for replace) extend (v: G) -- Add v after last child. -- Make v the first_child if below and place -- cursor before. put_left (v: G) -- Add v to the left of cursor position. require not_before: not before not_above: not above only_one_root: (level = 1) implies is_empty put_right (v: G) -- Add v to the right of cursor position. require not_after: not after not_above: not above only_one_root: (level = 1) implies is_empty fill (other: CURSOR_TREE [G]) -- Fill with as many items of other -- as possible. -- The representations of other and current structure -- need not be the same. require is_empty: is_empty fill_from_active (other: CURSOR_TREE [G]) -- Copy subtree of other's active node -- onto active node of current tree. require cursor_on_leaf: is_leaf merge_right (other: CURSOR_TREE [G]) -- Merge the items of other into current structure to -- the right of cursor position. require other_exists: other /= void not_after: not after not_above: not above only_one_root: (level = 1) implies is_empty merge_left (other: CURSOR_TREE [G]) -- Merge the items of other into current structure to -- the left of cursor position. require other_exists: other /= void not_before: not before not_above: not above only_one_root: (level = 1) implies is_empty feature -- Duplication subtree: like Current -- Subtree rooted at current node require not_off: not off parent_tree: like Current -- Subtree rooted at parent require not_on_root: not is_root not_off: not off child_tree (i: INTEGER): like Current -- Subtree rooted at i-th child require argument_within_bounds: i >= 1 and then i <= arity not_off: not off invariant non_negative_depth: depth >= 0 non_negative_breadth: breadth >= 0 is_leaf_definition: not off implies is_leaf = (arity = 0) above_property: above implies (arity <= 1) on_tree: (isfirst or islast or is_leaf or is_root) implies not off off_definition: off = after or before or above or below below_constraint: below implies ((after or before) and not above) above_constraint: above implies not (before or after or below) after_constraint: after implies not (before or above) before_constaint: before implies not (after or above) empty_below_constraint: (is_empty and (after or before)) implies below 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 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