Class pmr.sgml.SGMLNodeIndexSet
All Packages Class Hierarchy This Package Previous Next Index
Class pmr.sgml.SGMLNodeIndexSet
java.lang.Object
|
+----pmr.euclid.IntSet
|
+----pmr.sgml.SGMLNodeIndexSet
- public class SGMLNodeIndexSet
- extends IntSet
a set of (unique) indexes of nodes in a given tree. The set can be
modified by including some or all of the relatives in the tree (e.g.
children. It can also be filtered bit properties (e.g. 'hasGI').
- Author:
- (C) P. Murray-Rust, 1996
-
SGMLNodeIndexSet(IntSet, SGMLTree)
-
-
SGMLNodeIndexSet(SGMLTree)
- Use this constructor as SGMLNodeIndexSets have to be associated with
a SGMLTree.
-
addElement(SGMLNode)
- add a Node to this set
-
addSet(SGMLNodeIndexSet)
- catenate one list onto another
-
debug()
-
-
fullDebug()
- prints debug info FOR ALL NODES IN SET.
-
getAncestors()
-
-
getAncestors(int)
-
-
getChildrenIndexSet()
-
-
getDescendants()
-
-
getDescendantsOf(int)
- all descendants, excluding node (slow) - obsolete?
-
getEsib(int)
- preceding sibs in tree order
-
getFirstNode()
- get first SGMLNode of set (often used even if the only one!) if none,
return null
-
getNext(int)
- following siblings in tree order
-
getNode(int)
- get the i'th element as a NODE
-
getNodeIndexes()
- serial numbers of nodes Not in any order
-
getParent(int)
- get parent of an index as a SGMLNodeIndexSet (hopefully only 1 element!)
-
getParents()
- gets all parents of an indexSet
-
getPrev(int)
- preceding sibs in reverse order
-
getSubtree(int)
- get all descendants, including node
-
getTree()
- get the tree
-
getYsib(int)
- following siblings in tree order
-
hasAttname(String)
-
-
hasAttval(String, String)
-
-
hasGI(String)
-
-
intersectionWith(SGMLNodeIndexSet)
- intersect two sets (i.e.
-
notIn(SGMLNodeIndexSet)
- elements only in first set
-
toString()
-
SGMLNodeIndexSet
public SGMLNodeIndexSet(SGMLTree tree)
- Use this constructor as SGMLNodeIndexSets have to be associated with
a SGMLTree.
SGMLNodeIndexSet
public SGMLNodeIndexSet(IntSet is,
SGMLTree tree)
getFirstNode
public SGMLNode getFirstNode()
- get first SGMLNode of set (often used even if the only one!) if none,
return null
getTree
public SGMLTree getTree()
- get the tree
getNode
public SGMLNode getNode(int index)
- get the i'th element as a NODE
getNodeIndexes
public int[] getNodeIndexes()
- serial numbers of nodes Not in any order
addElement
public void addElement(SGMLNode n) throws DifferentSGMLTreesException
- add a Node to this set
- Throws: DifferentSGMLTreesException
- may not mix SGMLNodes from different Trees
addSet
public void addSet(SGMLNodeIndexSet nis) throws DifferentSGMLTreesException
- catenate one list onto another
- Throws: DifferentSGMLTreesException
- may not mix SGMLNodeIndexSets from different Trees
intersectionWith
public SGMLNodeIndexSet intersectionWith(SGMLNodeIndexSet nis) throws DifferentSGMLTreesException
- intersect two sets (i.e. elements common to both)
- Throws: DifferentSGMLTreesException
- may not mix SGMLNodeIndexSets from different Trees
notIn
public SGMLNodeIndexSet notIn(SGMLNodeIndexSet nis) throws DifferentSGMLTreesException
- elements only in first set
- Throws: DifferentSGMLTreesException
- may not mix SGMLNodeIndexSets from different Trees
debug
public void debug()
- Overrides:
- debug in class IntSet
fullDebug
public void fullDebug()
- prints debug info FOR ALL NODES IN SET. Use carefully!
getSubtree
public SGMLNodeIndexSet getSubtree(int nodeIndex)
- get all descendants, including node
getDescendantsOf
public SGMLNodeIndexSet getDescendantsOf(int nodeIndex)
- all descendants, excluding node (slow) - obsolete?
hasGI
public SGMLNodeIndexSet hasGI(String gi)
hasAttname
public SGMLNodeIndexSet hasAttname(String attname)
hasAttval
public SGMLNodeIndexSet hasAttval(String attname,
String attval)
getChildrenIndexSet
public SGMLNodeIndexSet getChildrenIndexSet()
getDescendants
public SGMLNodeIndexSet getDescendants()
getAncestors
public SGMLNodeIndexSet getAncestors()
getAncestors
public SGMLNodeIndexSet getAncestors(int index)
getYsib
public SGMLNodeIndexSet getYsib(int nodeIndex)
- following siblings in tree order
getNext
public SGMLNodeIndexSet getNext(int nodeIndex)
- following siblings in tree order
getEsib
public SGMLNodeIndexSet getEsib(int nodeIndex)
- preceding sibs in tree order
getPrev
public SGMLNodeIndexSet getPrev(int nodeIndex)
- preceding sibs in reverse order
getParent
public SGMLNodeIndexSet getParent(int nodeIndex)
- get parent of an index as a SGMLNodeIndexSet (hopefully only 1 element!)
getParents
public SGMLNodeIndexSet getParents()
- gets all parents of an indexSet
toString
public String toString()
- Overrides:
- toString in class IntSet
All Packages Class Hierarchy This Package Previous Next Index