public static class Values.FromTreeList extends Values<java.lang.Object> implements gnu.kawa.format.Printable, Consumer, PositionConsumer
Values.FromArray<E>, Values.FromList<E>, Values.FromTreeList, Values.Values2<E,V1 extends E,V2 extends E>
Modifier and Type | Field and Description |
---|---|
protected TreeList |
buffer |
noInts
Constructor and Description |
---|
FromTreeList() |
FromTreeList(java.lang.Object[] values) |
FromTreeList(TreeList list) |
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) |
java.lang.Object |
canonicalize()
If a simple value, return that value.
|
void |
clear() |
int |
compare(int ipos1,
int ipos2)
Compare two positions, and indicate their relative order.
|
void |
consume(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 pos,
int delta,
boolean isAfter) |
void |
endAttribute()
End of an attribute or end of an actual parameter.
|
void |
endDocument() |
void |
endElement() |
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 |
getNextKind(int ipos) |
java.lang.Object |
getNextTypeObject(int ipos) |
java.lang.Object |
getPosNext(int ipos)
Get the element following the specified position.
|
java.lang.Object |
getPosPrevious(int ipos)
Get the element before the specified position.
|
java.lang.Object[] |
getValues()
Get the values encapsulated.
|
boolean |
gotoAttributesStart(TreePosition pos) |
int |
hashCode() |
boolean |
hasNext(int ipos) |
boolean |
ignoring()
True if consumer is ignoring rest of element.
|
protected int |
nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
|
int |
nextMatching(int startPos,
ItemPredicate type,
int endPos,
boolean descend)
Get next matching child or descendent (ignoring attributes).
|
int |
nextPos(int ipos)
Return the next position following the argument.
|
int |
parentPos(int ipos)
Get position of parent.
|
void |
readExternal(java.io.ObjectInput in) |
int |
size() |
void |
startAttribute(java.lang.Object t)
Write a attribute for the current element.
|
void |
startDocument() |
void |
startElement(java.lang.Object type) |
void |
toString(java.lang.String sep,
java.lang.StringBuffer sbuf) |
void |
write(char[] b,
int s,
int l) |
void |
write(java.lang.CharSequence s,
int i,
int l) |
void |
write(int ch) |
void |
write(java.lang.String string) |
void |
writeBoolean(boolean v) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeObject(java.lang.Object v) |
void |
writePosition(AbstractSequence seq,
int ipos)
Consume a single position pair.
|
void |
writePosition(SeqPosition spos)
Consume node at current position.
|
call_with, checkFinalPos, countValues, getFromPos, getFromPosFinal, incrPos, make, make, make, make, makeFromArray, nextIndex, nextValue, print, readResolve, values, values2, writeExternal, writeValues
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, getIndexDifference, getInt, getInt, getInt, getInt, getInt, getIntRaw, getIterator, getIterator, getIteratorAtPos, getLongRaw, getLowBound, getNextTypeName, getRaw, getRowMajor, getShortRaw, getSize, getSize, gotoChildrenStart, gotoParent, hasPrevious, indexOf, isAfterPos, isEmpty, 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
protected final TreeList buffer
public FromTreeList(java.lang.Object[] values)
public FromTreeList()
public FromTreeList(TreeList list)
public int size()
size
in class AbstractSequence<java.lang.Object>
public java.lang.Object get(int index)
get
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 java.lang.Object canonicalize()
Values
canonicalize
in class Values<java.lang.Object>
public java.lang.Object[] getValues()
Values
public int nextMatching(int startPos, ItemPredicate type, int endPos, boolean descend)
AbstractSequence
nextMatching
in class AbstractSequence<java.lang.Object>
startPos
- starting positiontype
- a test (predicate) to apply to selected elementsendPos
- stop before endPosdescend
- if true do depth-first traversal.public void clear()
clear
in class AbstractSequence<java.lang.Object>
public int createRelativePos(int pos, int delta, boolean isAfter)
createRelativePos
in class AbstractSequence<java.lang.Object>
protected int nextIndex(int ipos)
AbstractSequence
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 java.lang.Object getNextTypeObject(int ipos)
getNextTypeObject
in class AbstractSequence<java.lang.Object>
public int nextPos(int ipos)
AbstractSequence
nextPos
in class AbstractSequence<java.lang.Object>
public int firstChildPos(int ipos)
AbstractSequence
firstChildPos
in class AbstractSequence<java.lang.Object>
ipos
- parent position. It is not released by this method.public int firstAttributePos(int ipos)
AbstractSequence
firstAttributePos
in class AbstractSequence<java.lang.Object>
public int parentPos(int ipos)
AbstractSequence
parentPos
in class AbstractSequence<java.lang.Object>
ipos
- child position. It is not released by this method.public boolean gotoAttributesStart(TreePosition pos)
gotoAttributesStart
in class AbstractSequence<java.lang.Object>
public java.lang.Object getPosNext(int ipos)
AbstractSequence
getPosNext
in class AbstractSequence<java.lang.Object>
ipos
- the specified position.public java.lang.Object getPosPrevious(int ipos)
AbstractSequence
getPosPrevious
in class AbstractSequence<java.lang.Object>
ipos
- the specified position.public int compare(int ipos1, int ipos2)
AbstractSequence
compare
in class AbstractSequence<java.lang.Object>
public int hashCode()
hashCode
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 void consume(Consumer out)
consume
in interface Consumable
consume
in class AbstractSequence<java.lang.Object>
public void toString(java.lang.String sep, java.lang.StringBuffer sbuf)
toString
in class AbstractSequence<java.lang.Object>
public void writeBoolean(boolean v)
public void writeFloat(float v)
public void writeDouble(double v)
public void writeInt(int v)
public void writeLong(long v)
public void startDocument()
public void endDocument()
public void startElement(java.lang.Object type)
public void endElement()
public void startAttribute(java.lang.Object t)
Consumer
public void endAttribute()
Consumer
public void writeObject(java.lang.Object v)
public boolean ignoring()
Consumer
public void write(int ch)
public void write(java.lang.String string)
public void write(java.lang.CharSequence s, int i, int l)
public void write(char[] b, int s, int l)
public Consumer append(char c)
append
in interface java.lang.Appendable
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 void writePosition(SeqPosition spos)
PositionConsumer
writePosition
in interface PositionConsumer
public void writePosition(AbstractSequence seq, int ipos)
PositionConsumer
writePosition
in interface PositionConsumer
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException