public class TreeList extends AbstractSequence<java.lang.Object> implements java.lang.Appendable, XConsumer, PositionConsumer, Consumable
Modifier and Type | Field and Description |
---|---|
int |
attrStart
If non-zero, gap is in an attribute starting (1 less than) here.
|
protected static int |
BEGIN_ATTRIBUTE_LONG
The beginning of an attribute.
|
static int |
BEGIN_ATTRIBUTE_LONG_SIZE |
protected static int |
BEGIN_DOCUMENT
Beginning of a document (or top-level value).
|
protected static int |
BEGIN_ELEMENT_LONG
Begin of an element, non-compact form.
|
protected static int |
BEGIN_ELEMENT_SHORT
Beginning of an element, compact form.
|
protected static int |
BEGIN_ELEMENT_SHORT_INDEX_MAX |
static int |
BEGIN_ENTITY
Start of an entity (typically a file, possibly included).
|
static int |
BEGIN_ENTITY_SIZE |
char[] |
data |
int |
docStart
If non-zero, gap is in an document starting (1 less than) here.
|
protected static int |
DOCUMENT_URI
The document-uri property of a node.
|
static int |
END_ATTRIBUTE_SIZE |
protected static int |
END_DOCUMENT
End of a document.
|
protected static int |
END_ELEMENT_LONG
End of n element, non-compact form.
|
protected static int |
END_ELEMENT_SHORT
End of an element, compact form.
|
protected static int |
END_ENTITY |
int |
gapEnd |
int |
gapStart |
static int |
INT_FOLLOWS
A 32-bit integer, non-compact form.
|
static int |
MAX_CHAR_SHORT
The largest Unicode character that can be encoded in one char.
|
java.lang.Object[] |
objects |
int |
oindex |
protected static char |
POSITION_PAIR_FOLLOWS
A position triple referencing some other "nodes".
|
protected static int |
PROCESSING_INSTRUCTION
A processing-instruction node follows.
|
noInts
Constructor and Description |
---|
TreeList() |
TreeList(TreeList list) |
TreeList(TreeList list,
int startPosition,
int endPosition)
Make a copy of a sub-range of a TreeList.
|
Modifier and Type | Method and Description |
---|---|
Consumer |
append(char c) |
Consumer |
append(java.lang.CharSequence csq) |
Consumer |
append(java.lang.CharSequence csq,
int start,
int end) |
void |
beginEntity(java.lang.Object base) |
void |
clear() |
int |
compare(int ipos1,
int ipos2)
Compare two positions, and indicate their relative order.
|
void |
consume(Consumer out) |
int |
consumeIRange(int startPosition,
int endPosition,
Consumer out) |
boolean |
consumeNext(int ipos,
Consumer out)
Copy an element specified by a position pair to a Consumer.
|
void |
consumePosRange(int startPos,
int endPos,
Consumer out) |
int |
createPos(int index,
boolean isAfter)
Generate a position at a given index.
|
int |
createRelativePos(int istart,
int offset,
boolean isAfter) |
java.lang.Object |
documentUriOfPos(int pos) |
void |
dump() |
void |
dump(java.io.PrintWriter out) |
void |
dump(java.io.PrintWriter out,
int start,
int limit) |
void |
endAttribute()
End of an attribute or end of an actual parameter.
|
void |
endDocument() |
void |
endElement() |
void |
endEntity() |
void |
ensureSpace(int needed) |
int |
find(java.lang.Object arg1) |
int |
firstAttributePos(int ipos)
Like firstChildPos.
|
int |
firstChildPos(int ipos)
Get position before first child (of the element following position).
|
java.lang.Object |
get(int index) |
int |
getAttributeCount(int parent) |
protected int |
getIndexDifference(int ipos1,
int ipos0)
Get offset of (ipos1) relative to (ipos0).
|
protected int |
getIntN(int index)
Get a 32-bit int from the data array.
|
protected long |
getLongN(int index)
Get a 64-bit long from the data array.
|
int |
getNextKind(int ipos) |
int |
getNextKindI(int index) |
java.lang.Object |
getNextTypeObject(int ipos) |
java.lang.Object |
getPosNext(int ipos)
Get the element following the specified position.
|
int |
getPosNextInt(int ipos)
Return following value (like getPosNext), as an integer.
|
java.lang.Object |
getPosPrevious(int ipos)
Get the element before the specified position.
|
int |
gotoAttributesStart(int index) |
boolean |
gotoAttributesStart(TreePosition pos) |
int |
gotoChildrenStart(int index) |
int |
hashCode() |
boolean |
hasNext(int ipos) |
boolean |
ignoring()
True if consumer is ignoring rest of element.
|
boolean |
isEmpty() |
int |
nextDataIndex(int pos) |
int |
nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
|
int |
nextMatching(int startPos,
ItemPredicate predicate,
int endPos,
boolean descend)
Get next matching child or descendent (ignoring attributes).
|
int |
nextNodeIndex(int pos,
int limit)
Skip all primitive content nodes.
|
int |
nextPos(int position)
Return the next position following the argument.
|
int |
parentOrEntityI(int index) |
int |
parentOrEntityPos(int ipos) |
int |
parentPos(int ipos)
Get position of parent.
|
int |
posToDataIndex(int ipos) |
void |
reserveObjects(int needed) |
void |
setAttributeName(int attrIndex,
int nameIndex) |
void |
setElementName(int elementIndex,
int nameIndex) |
void |
setIntN(int index,
int i) |
int |
size() |
void |
startAttribute(int index) |
void |
startAttribute(java.lang.Object attrType)
Write a attribute for the current element.
|
void |
startDocument() |
void |
startElement(int index) |
void |
startElement(java.lang.Object type) |
void |
statistics() |
void |
statistics(java.io.PrintWriter out) |
int |
stringValue(boolean inElement,
int index,
java.lang.StringBuffer sbuf) |
void |
stringValue(int startIndex,
int endIndex,
java.lang.StringBuffer sbuf) |
int |
stringValue(int index,
java.lang.StringBuffer sbuf) |
void |
toString(java.lang.String sep,
java.lang.StringBuffer sbuf) |
void |
write(char[] buf,
int off,
int len) |
void |
write(java.lang.CharSequence str,
int start,
int length) |
void |
write(int c) |
void |
write(java.lang.String str) |
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeCDATA(char[] chars,
int offset,
int length) |
void |
writeComment(char[] chars,
int offset,
int length) |
void |
writeComment(java.lang.String comment,
int offset,
int length) |
void |
writeDocumentUri(java.lang.Object uri)
Write/set the document-uri property of the current document.
|
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeIntForce32(int v) |
void |
writeJoiner() |
void |
writeLong(long v) |
void |
writeObject(java.lang.Object v) |
void |
writePosition(AbstractSequence seq,
int ipos)
Consume a single position pair.
|
void |
writePosition(SeqPosition position)
Consume node at current position.
|
void |
writeProcessingInstruction(java.lang.String target,
char[] content,
int offset,
int length) |
void |
writeProcessingInstruction(java.lang.String target,
java.lang.String content,
int offset,
int length) |
add, add, addAll, addAll, addPos, asImmutable, badRank, boundedHash, checkCanWrite, checkRank, compare, compare, consume, contains, containsAll, copyPos, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, elements, endPos, equals, equals, fill, fill, fillPosRange, firstChildPos, fromEndIndex, get, get, get, get, getAttribute, getAttributeLength, getBooleanRaw, getByteRaw, getCharRaw, getContainingSequenceSize, getDoubleRaw, getElementKind, getFloatRaw, getInt, getInt, getInt, getInt, getInt, getIntRaw, getIterator, getIterator, getIteratorAtPos, getLongRaw, getLowBound, getNextTypeName, getRaw, getRowMajor, getShortRaw, getSize, getSize, gotoChildrenStart, gotoParent, hasPrevious, indexOf, isAfterPos, iterator, lastIndexOf, listIterator, listIterator, nextIndex, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setAt, setBuffer, setPosNext, setPosPrevious, setRaw, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, unsupported, unsupportedException
public java.lang.Object[] objects
public int oindex
public char[] data
public int gapStart
public int gapEnd
public int attrStart
public int docStart
public static final int MAX_CHAR_SHORT
protected static final char POSITION_PAIR_FOLLOWS
public static final int INT_FOLLOWS
protected static final int PROCESSING_INSTRUCTION
protected static final int BEGIN_ATTRIBUTE_LONG
public static final int BEGIN_ATTRIBUTE_LONG_SIZE
public static final int END_ATTRIBUTE_SIZE
protected static final int BEGIN_DOCUMENT
protected static final int END_DOCUMENT
public static final int BEGIN_ENTITY
public static final int BEGIN_ENTITY_SIZE
protected static final int END_ENTITY
protected static final int DOCUMENT_URI
protected static final int BEGIN_ELEMENT_SHORT
index < BEGIN_ELEMENT_SHORT_INDEX_MAX
,
both end_offset and parent_offset fit in 16 bits,
and the element does not straddle the gap.protected static final int BEGIN_ELEMENT_SHORT_INDEX_MAX
protected static final int END_ELEMENT_SHORT
protected static final int BEGIN_ELEMENT_LONG
protected static final int END_ELEMENT_LONG
public TreeList()
public TreeList(TreeList list, int startPosition, int endPosition)
list
- the TreeList to copystartPosition
- start of range, as a raw index in dataendPosition
- end of range, as a raw index in datapublic TreeList(TreeList list)
public void clear()
clear
in class AbstractSequence<java.lang.Object>
public void ensureSpace(int needed)
public final void reserveObjects(int needed)
public int find(java.lang.Object arg1)
protected final int getIntN(int index)
protected final long getLongN(int index)
public final void setIntN(int index, int i)
public void writePosition(SeqPosition position)
PositionConsumer
writePosition
in interface PositionConsumer
public void writePosition(AbstractSequence seq, int ipos)
PositionConsumer
writePosition
in interface PositionConsumer
public void writeObject(java.lang.Object v)
public void writeDocumentUri(java.lang.Object uri)
public void writeComment(char[] chars, int offset, int length)
writeComment
in interface XConsumer
public void writeComment(java.lang.String comment, int offset, int length)
public void writeProcessingInstruction(java.lang.String target, char[] content, int offset, int length)
writeProcessingInstruction
in interface XConsumer
public void writeProcessingInstruction(java.lang.String target, java.lang.String content, int offset, int length)
public void startElement(java.lang.Object type)
public void startDocument()
public void endDocument()
public void beginEntity(java.lang.Object base)
beginEntity
in interface XConsumer
public void startElement(int index)
public void setElementName(int elementIndex, int nameIndex)
public void endElement()
public void startAttribute(java.lang.Object attrType)
Consumer
public void startAttribute(int index)
public void setAttributeName(int attrIndex, int nameIndex)
public void endAttribute()
Consumer
public Consumer append(char c)
append
in interface java.lang.Appendable
public void write(int c)
public void writeBoolean(boolean v)
public void writeByte(int v)
public void writeInt(int v)
public void writeIntForce32(int v)
public void writeLong(long v)
public void writeFloat(float v)
public void writeDouble(double v)
public boolean ignoring()
Consumer
public void writeJoiner()
public void write(char[] buf, int off, int len)
public void write(java.lang.String str)
public void write(java.lang.CharSequence str, int start, int length)
public void writeCDATA(char[] chars, int offset, int length)
writeCDATA
in interface XConsumer
public Consumer append(java.lang.CharSequence csq)
append
in interface java.lang.Appendable
public Consumer append(java.lang.CharSequence csq, int start, int end)
append
in interface java.lang.Appendable
public boolean isEmpty()
isEmpty
in class AbstractSequence<java.lang.Object>
public int size()
size
in class AbstractSequence<java.lang.Object>
public int createPos(int index, boolean isAfter)
AbstractSequence
createPos
in class AbstractSequence<java.lang.Object>
index
- offset from beginning of desired positionisAfter
- should the position have the isAfter propertypublic final int posToDataIndex(int ipos)
public int firstChildPos(int ipos)
AbstractSequence
firstChildPos
in class AbstractSequence<java.lang.Object>
ipos
- parent position. It is not released by this method.public final int gotoChildrenStart(int index)
public int parentPos(int ipos)
AbstractSequence
parentPos
in class AbstractSequence<java.lang.Object>
ipos
- child position. It is not released by this method.public int parentOrEntityPos(int ipos)
public int parentOrEntityI(int index)
public int getAttributeCount(int parent)
public boolean gotoAttributesStart(TreePosition pos)
gotoAttributesStart
in class AbstractSequence<java.lang.Object>
public int firstAttributePos(int ipos)
AbstractSequence
firstAttributePos
in class AbstractSequence<java.lang.Object>
public int gotoAttributesStart(int index)
public java.lang.Object get(int index)
get
in class AbstractSequence<java.lang.Object>
public boolean consumeNext(int ipos, Consumer out)
AbstractSequence
consumeNext
in class AbstractSequence<java.lang.Object>
public void consumePosRange(int startPos, int endPos, Consumer out)
consumePosRange
in class AbstractSequence<java.lang.Object>
public int consumeIRange(int startPosition, int endPosition, Consumer out)
public void toString(java.lang.String sep, java.lang.StringBuffer sbuf)
toString
in class AbstractSequence<java.lang.Object>
public boolean hasNext(int ipos)
hasNext
in class AbstractSequence<java.lang.Object>
public int getNextKind(int ipos)
getNextKind
in class AbstractSequence<java.lang.Object>
public int getNextKindI(int index)
public java.lang.Object getNextTypeObject(int ipos)
getNextTypeObject
in class AbstractSequence<java.lang.Object>
public java.lang.Object getPosPrevious(int ipos)
AbstractSequence
getPosPrevious
in class AbstractSequence<java.lang.Object>
ipos
- the specified position.public int getPosNextInt(int ipos)
public java.lang.Object getPosNext(int ipos)
AbstractSequence
getPosNext
in class AbstractSequence<java.lang.Object>
ipos
- the specified position.public void stringValue(int startIndex, int endIndex, java.lang.StringBuffer sbuf)
public int stringValue(int index, java.lang.StringBuffer sbuf)
public int stringValue(boolean inElement, int index, java.lang.StringBuffer sbuf)
public int createRelativePos(int istart, int offset, boolean isAfter)
createRelativePos
in class AbstractSequence<java.lang.Object>
public final int nextNodeIndex(int pos, int limit)
public int nextMatching(int startPos, ItemPredicate predicate, int endPos, boolean descend)
AbstractSequence
nextMatching
in class AbstractSequence<java.lang.Object>
startPos
- starting positionpredicate
- a test (predicate) to apply to selected elementsendPos
- stop before endPosdescend
- if true do depth-first traversal.public int nextPos(int position)
AbstractSequence
nextPos
in class AbstractSequence<java.lang.Object>
public final int nextDataIndex(int pos)
public java.lang.Object documentUriOfPos(int pos)
public int compare(int ipos1, int ipos2)
compare
in class AbstractSequence<java.lang.Object>
protected int getIndexDifference(int ipos1, int ipos0)
AbstractSequence
getIndexDifference
in class AbstractSequence<java.lang.Object>
public int nextIndex(int ipos)
AbstractSequence
nextIndex
in class AbstractSequence<java.lang.Object>
public int hashCode()
hashCode
in class AbstractSequence<java.lang.Object>
public void consume(Consumer out)
consume
in interface Consumable
consume
in class AbstractSequence<java.lang.Object>
public void statistics()
public void statistics(java.io.PrintWriter out)
public void dump()
public void dump(java.io.PrintWriter out)
public void dump(java.io.PrintWriter out, int start, int limit)