Package gnu.kawa.xml
Class Nodes
- All Implemented Interfaces:
Consumable,Consumer,PositionConsumer,Externalizable,Serializable,Appendable,Consumer<Object>,DoubleConsumer,IntConsumer,LongConsumer,NodeList
- Direct Known Subclasses:
SortedNodes
public class Nodes
extends Values.FromList<SeqPosition>
implements PositionConsumer, NodeList, Consumer
Manages a sequence of node references.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class gnu.mapping.Values
Values.FromArray<E>, Values.FromList<E>, Values.FromTreeList, Values.Values2<E,V1 extends E, V2 extends E> -
Field Summary
FieldsFields inherited from class gnu.lists.AbstractSequence
noInts -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) voidbeginEntity(Object base) voidconsumePosRange(int iposStart, int iposEnd, Consumer out) voidEnd of an attribute or end of an actual parameter.voidvoidvoidintintgetPos(int index) Optimization of ((SeqPosition) get(index)).getSeq(int index) Optimization of((SeqPosition) get(index)).sequence.booleanignoring()True if consumer is ignoring rest of element.item(int index) static KNodevoidstartAttribute(Object attrType) Write a attribute for the current element.voidvoidstartElement(Object type) voidwrite(char[] buf, int off, int len) voidwrite(int v) voidwrite(CharSequence str, int start, int length) voidvoidwriteBoolean(boolean v) voidwriteCDATA(char[] chars, int offset, int length) voidwriteComment(char[] chars, int offset, int length) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidvoidwritePosition(AbstractSequence seq, int ipos) Consume a single position pair.voidwritePosition(SeqPosition position) Consume node at current position.voidwriteProcessingInstruction(String target, char[] content, int offset, int length) Methods inherited from class gnu.mapping.Values.FromList
get, getValues, readExternal, sizeMethods inherited from class gnu.mapping.Values
call_with, canonicalize, checkFinalPos, countValues, getFromPos, getFromPosFinal, incrPos, make, make, make, make, makeFromArray, nextIndex, nextIndex, nextValue, print, readResolve, values, values2, writeExternal, writeValuesMethods inherited from class gnu.lists.AbstractSequence
add, add, addAll, addAll, addPos, asImmutable, badRank, boundedHash, checkCanWrite, checkRank, clear, compare, compare, compare, consume, consume, consumeNext, contains, containsAll, copyPos, createPos, createRelativePos, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, 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, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getRaw, getRowMajor, getShortRaw, getSize, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setAt, setBuffer, setPosNext, setPosPrevious, setRaw, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedExceptionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface gnu.lists.Consumable
consumeMethods inherited from interface java.util.function.DoubleConsumer
andThenMethods inherited from interface java.util.function.IntConsumer
andThenMethods inherited from interface java.util.function.LongConsumer
andThen
-
Field Details
-
vector
-
-
Constructor Details
-
Nodes
public Nodes()
-
-
Method Details
-
append
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceConsumer
-
append
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceConsumer
-
ignoring
public boolean ignoring()Description copied from interface:ConsumerTrue if consumer is ignoring rest of element. The producer can use this information to skip ahead. -
writePosition
Description copied from interface:PositionConsumerConsume a single position pair. This PositionConsumer may assume the sequence does no reference management; i.e. that copyPos is trivial and releasePos is a no-op. If that is not the case, use consume(TreePosition) instead.- Specified by:
writePositionin interfacePositionConsumer
-
writePosition
Description copied from interface:PositionConsumerConsume node at current position. The caller may invalidate or change the position after consume returns, so if the consumer wants to save it, it needs to copy it.- Specified by:
writePositionin interfacePositionConsumer
-
writeObject
- Specified by:
writeObjectin interfaceConsumer
-
writeFloat
public void writeFloat(float v) - Specified by:
writeFloatin interfaceConsumer
-
writeDouble
public void writeDouble(double v) - Specified by:
writeDoublein interfaceConsumer
-
writeLong
public void writeLong(long v) -
writeInt
public void writeInt(int v) -
writeBoolean
public void writeBoolean(boolean v) - Specified by:
writeBooleanin interfaceConsumer
-
write
public void write(int v) -
append
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceConsumer
-
write
public void write(char[] buf, int off, int len) -
write
-
write
-
startElement
- Specified by:
startElementin interfaceConsumer
-
endElement
public void endElement()- Specified by:
endElementin interfaceConsumer
-
startAttribute
Description copied from interface:ConsumerWrite a attribute for the current element. This is only allowed immediately after a startElement.- Specified by:
startAttributein interfaceConsumer
-
endAttribute
public void endAttribute()Description copied from interface:ConsumerEnd of an attribute or end of an actual parameter. The former use matches a startAttribute; the latter may not, and can be used to separate parameters in a parameter list. This double duty suggsts the method should at least be re-named.- Specified by:
endAttributein interfaceConsumer
-
writeComment
public void writeComment(char[] chars, int offset, int length) -
writeCDATA
public void writeCDATA(char[] chars, int offset, int length) -
writeProcessingInstruction
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceConsumer
-
endDocument
public void endDocument()- Specified by:
endDocumentin interfaceConsumer
-
beginEntity
-
endEntity
public void endEntity() -
getLength
public int getLength() -
item
-
getSeq
Optimization of((SeqPosition) get(index)).sequence. However returns null instead of throwing IndexOutOfBoundsException ifindex >= count. -
getPos
public int getPos(int index) Optimization of ((SeqPosition) get(index)). ipos. -
consumePosRange
- Overrides:
consumePosRangein classAbstractSequence<SeqPosition>
-
root
-