note
	description: "Trees where the children of each node are kept in an array"
	library: "Free implementation of ELKS library"
	legal: "See notice at end of class."
	status: "See notice at end of class."
	names: tree
	representation: recursive, array
	access: cursor, membership
	contents: generic
	date: "$Date: 2018-12-15 18:01:30 +0000 (Sat, 15 Dec 2018) $"
	revision: "$Revision: 102607 $"

class interface
	ARRAYED_TREE [G]

create 
	make

feature -- Access

	parent: detachable like Current
			-- Parent of current node

	left_sibling: like parent
			-- Left neighbor if any

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

	child_put (v: like item)
			-- Replace current child item with v.
			-- Was declared in ARRAYED_TREE as synonym of child_replace.

	child_replace (v: like item)
			-- Replace current child item with v.
			-- Was declared in ARRAYED_TREE as synonym of child_put.

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

	child_extend (v: like item)
			-- Add v at end.
			-- Do not move child cursor.

	child_put_left (v: like item)
			-- Add v to the left of cursor position.
			-- Do not move child cursor.

	child_put_right (v: like item)
			-- Add v to the right of cursor position.
			-- Do not move child cursor.

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

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

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

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

	merge_tree_after (other: like Current)
			-- 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.

	forget_left
			-- Forget all left siblings.

	forget_right
			-- Forget all right siblings.
	
feature -- Inapplicable

	extend (v: G)
			-- Add v as new child.
	
feature -- Access: children

	child: attached like parent
			-- Current child node

	array_item (n: INTEGER_32): like Current

	last_child: like first_child
			-- Right most child

	first_child: like parent
			-- Leftmost child

	search_child (v: like Current)

	readable_child: BOOLEAN
			-- Is there a current child to be read?

	writable_child: BOOLEAN
			-- Is there a current child that may be modified?

	arity: INTEGER_32
			-- Number of children

	child_start
			-- Move cursor to first child.

	child_finish
			-- Move cursor to last child.

	child_forth
			-- Move cursor to next child.

	child_back
			-- Move cursor to previous child.

	child_go_i_th (i: INTEGER_32)
			-- Move cursor to i-th child.

	child_index: INTEGER_32
			-- Index of current child

	child_off: BOOLEAN
			-- Is there no current child?

	child_after: BOOLEAN
			-- Is there no valid child position to the right of cursor?

	child_before: BOOLEAN
			-- Is there no valid child position to the left of cursor?

	child_cursor: CURSOR
			-- Current cursor position

	child_go_to (p: CURSOR)
			-- Move cursor to position p.

	index_of (v: like Current; i: INTEGER_32): INTEGER_32

	prune (n: like child)
			-- Remove n from the children.

	wipe_out
			-- Remove all children.

	child_move (i: INTEGER_32)

	do_all (an_agent: PROCEDURE [G])
			-- Apply an_agent to every child nodes in the tree.
	
note
	ca_ignore: "CA033", "CA033: very large class"
	copyright: "Copyright (c) 1984-2018, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class ARRAYED_TREE

Generated by ISE EiffelStudio