multivalent.node
Class NodeCharSequence
java.lang.Object
multivalent.node.NodeCharSequence
- All Implemented Interfaces:
- java.lang.CharSequence
- public class NodeCharSequence
- extends java.lang.Object
- implements java.lang.CharSequence
CharSequence
over the document tree, as for used by regular rexpressions
.
The sequence consists of the text of each leaf (Node.getName()
, separated by spaces.
The same instance can be used for many searches or other operations.
At its creation, this class takes a snapshot of the tree and ignores subsequent modification to it.
- Version:
- $Revision$ $Date$
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NodeCharSequence
public NodeCharSequence(Node root)
NodeCharSequence
public NodeCharSequence(Leaf startl,
Leaf endl)
charAt
public char charAt(int index)
- Specified by:
charAt
in interface java.lang.CharSequence
length
public int length()
- Specified by:
length
in interface java.lang.CharSequence
subSequence
public java.lang.CharSequence subSequence(int start,
int end)
- Specified by:
subSequence
in interface java.lang.CharSequence
nodeAt
public Leaf nodeAt(int index)
markAt
public Mark markAt(int index)
textIndexOf
public int textIndexOf(Leaf l)
toString
public java.lang.String toString()
- Specified by:
toString
in interface java.lang.CharSequence
- Overrides:
toString
in class java.lang.Object