Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

xml.tree

Class XM_NODE


Direct ancestors

KL_CLONABLE, XM_UNICODE_STRUCTURE_FACTORY

Known direct descendants

XM_COMPOSITE, XM_ELEMENT_NODE, XM_DOCUMENT_NODE

Features

Invariants

indexing

description

XML nodes

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2001, Andreas Leitner and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/06/04 22:47:39 $

revision

$Revision: 1.22 $

deferred class

XM_NODE

inherit

KL_CLONABLE

feature -- Access

parent: XM_COMPOSITE

-- Parent of current node;
-- Void if current node is root

feature -- Status report

is_first: BOOLEAN

-- Is this node the first in its parent's child list,
-- or the root node?

ensure
definition: Result = (is_root_node or else (parent.first = Current))
is_last: BOOLEAN

-- Is this node the last in its parent's child list,
-- or the root node?

ensure
definition: Result = (is_root_node or else (parent.last = Current))
is_root_node: BOOLEAN

-- Is current node the root node?

ensure
definition: Result = (parent = Void)
level: INTEGER

-- Depth at which current node appears relative to its root
-- (The root node has the level 1.)

ensure
root_level: is_root_node implies (Result = 1)
parent_element: XM_ELEMENT

-- Parent element.

require
not_root_node: not is_root_node
not_root_element: not parent.is_root_node
ensure
result_not_void: Result /= Void
root_node: XM_DOCUMENT

-- Root node of current node

ensure
result_not_void: Result /= Void

feature {XM_COMPOSITE} -- Element change

node_set_parent (a_parent: like parent)

-- Set parent to a_parent.

ensure
parent_set: parent = a_parent
set_parent (a_parent: like parent)

-- Set parent to a_parent.

require
a_parent_not_void: a_parent /= Void
not_root_node: not is_root_node
ensure
parent_set: parent = a_parent

feature -- Duplication

cloned_object: like Current

-- Clone of current object

-- (From KL_CLONABLE)

ensure
cloned_not_void: Result /= Void
same_type: ANY_.same_types (Result, Current)
is_equal: Result.is_equal (Current)

feature -- Processing

process (a_processor: XM_NODE_PROCESSOR)

-- Process current node with a_processor.

require
a_processor_not_void: a_processor /= Void

invariant

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end