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

Constructor Index

 o SGMLNodeIndexSet(IntSet, SGMLTree)
 o SGMLNodeIndexSet(SGMLTree)
Use this constructor as SGMLNodeIndexSets have to be associated with a SGMLTree.

Method Index

 o addElement(SGMLNode)
add a Node to this set
 o addSet(SGMLNodeIndexSet)
catenate one list onto another
 o debug()
 o fullDebug()
prints debug info FOR ALL NODES IN SET.
 o getAncestors()
 o getAncestors(int)
 o getChildrenIndexSet()
 o getDescendants()
 o getDescendantsOf(int)
all descendants, excluding node (slow) - obsolete?
 o getEsib(int)
preceding sibs in tree order
 o getFirstNode()
get first SGMLNode of set (often used even if the only one!) if none, return null
 o getNext(int)
following siblings in tree order
 o getNode(int)
get the i'th element as a NODE
 o getNodeIndexes()
serial numbers of nodes Not in any order
 o getParent(int)
get parent of an index as a SGMLNodeIndexSet (hopefully only 1 element!)
 o getParents()
gets all parents of an indexSet
 o getPrev(int)
preceding sibs in reverse order
 o getSubtree(int)
get all descendants, including node
 o getTree()
get the tree
 o getYsib(int)
following siblings in tree order
 o hasAttname(String)
 o hasAttval(String, String)
 o hasGI(String)
 o intersectionWith(SGMLNodeIndexSet)
intersect two sets (i.e.
 o notIn(SGMLNodeIndexSet)
elements only in first set
 o toString()

Constructors

 o SGMLNodeIndexSet
  public SGMLNodeIndexSet(SGMLTree tree)
Use this constructor as SGMLNodeIndexSets have to be associated with a SGMLTree.
 o SGMLNodeIndexSet
  public SGMLNodeIndexSet(IntSet is,
                          SGMLTree tree)

Methods

 o getFirstNode
  public SGMLNode getFirstNode()
get first SGMLNode of set (often used even if the only one!) if none, return null
 o getTree
  public SGMLTree getTree()
get the tree
 o getNode
  public SGMLNode getNode(int index)
get the i'th element as a NODE
 o getNodeIndexes
  public int[] getNodeIndexes()
serial numbers of nodes Not in any order
 o addElement
  public void addElement(SGMLNode n) throws DifferentSGMLTreesException
add a Node to this set
Throws: DifferentSGMLTreesException
may not mix SGMLNodes from different Trees
 o addSet
  public void addSet(SGMLNodeIndexSet nis) throws DifferentSGMLTreesException
catenate one list onto another
Throws: DifferentSGMLTreesException
may not mix SGMLNodeIndexSets from different Trees
 o 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
 o notIn
  public SGMLNodeIndexSet notIn(SGMLNodeIndexSet nis) throws DifferentSGMLTreesException
elements only in first set
Throws: DifferentSGMLTreesException
may not mix SGMLNodeIndexSets from different Trees
 o debug
  public void debug()
Overrides:
debug in class IntSet
 o fullDebug
  public void fullDebug()
prints debug info FOR ALL NODES IN SET. Use carefully!
 o getSubtree
  public SGMLNodeIndexSet getSubtree(int nodeIndex)
get all descendants, including node
 o getDescendantsOf
  public SGMLNodeIndexSet getDescendantsOf(int nodeIndex)
all descendants, excluding node (slow) - obsolete?
 o hasGI
  public SGMLNodeIndexSet hasGI(String gi)
 o hasAttname
  public SGMLNodeIndexSet hasAttname(String attname)
 o hasAttval
  public SGMLNodeIndexSet hasAttval(String attname,
                                    String attval)
 o getChildrenIndexSet
  public SGMLNodeIndexSet getChildrenIndexSet()
 o getDescendants
  public SGMLNodeIndexSet getDescendants()
 o getAncestors
  public SGMLNodeIndexSet getAncestors()
 o getAncestors
  public SGMLNodeIndexSet getAncestors(int index)
 o getYsib
  public SGMLNodeIndexSet getYsib(int nodeIndex)
following siblings in tree order
 o getNext
  public SGMLNodeIndexSet getNext(int nodeIndex)
following siblings in tree order
 o getEsib
  public SGMLNodeIndexSet getEsib(int nodeIndex)
preceding sibs in tree order
 o getPrev
  public SGMLNodeIndexSet getPrev(int nodeIndex)
preceding sibs in reverse order
 o getParent
  public SGMLNodeIndexSet getParent(int nodeIndex)
get parent of an index as a SGMLNodeIndexSet (hopefully only 1 element!)
 o getParents
  public SGMLNodeIndexSet getParents()
gets all parents of an indexSet
 o toString
  public String toString()
Overrides:
toString in class IntSet

All Packages  Class Hierarchy  This Package  Previous  Next  Index