gnu.kawa.xml

Class Nodes

Implemented Interfaces:
Externalizable, Consumable, Consumer, PositionConsumer, Printable, XConsumer
Known Direct Subclasses:
SortedNodes

public class Nodes
extends Values

Manages a sequence of node references.

Field Summary

Fields inherited from class gnu.mapping.Values

empty, noArgs

Fields inherited from class gnu.lists.TreeList

BEGIN_ATTRIBUTE_LONG, BEGIN_ATTRIBUTE_LONG_SIZE, BEGIN_DOCUMENT, BEGIN_ELEMENT_LONG, BEGIN_ELEMENT_SHORT, BEGIN_ELEMENT_SHORT_INDEX_MAX, BEGIN_ENTITY, BEGIN_ENTITY_SIZE, DOCUMENT_URI, END_ATTRIBUTE_SIZE, END_DOCUMENT, END_ELEMENT_LONG, END_ELEMENT_SHORT, END_ENTITY, INT_FOLLOWS, MAX_CHAR_SHORT, POSITION_PAIR_FOLLOWS, PROCESSING_INSTRUCTION, attrStart, data, docStart, gapEnd, gapStart, objects, oindex

Method Summary

Consumer
append(CharSequence csq, int start, int end)
void
beginEntity(Object base)
void
endAttribute()
End of an attribute or end of an actual parameter.
void
endDocument()
void
endElement()
void
endEntity()
int
find(Object seq)
Object
get(int index)
See java.util.List.
int
getLength()
int
getPos(int index)
Optimization of ((SeqPosition) get(index)).
Object
getPosNext(int ipos)
Get the element following the specified position.
AbstractSequence
getSeq(int index)
Optimization of ((SeqPosition) get(index)).sequence.
static KNode
root(NodeTree seq, int ipos)
int
size()
See java.util.List.
void
startAttribute(Object attrType)
Write a attribute for the current element.
void
startDocument()
void
startElement(Object type)
void
write(CharSequence str, int start, int length)
void
write(String str)
void
write(char[] buf, int off, int len)
void
write(int v)
void
writeBoolean(boolean v)
void
writeCDATA(char[] chars, int offset, int length)
void
writeComment(char[] chars, int offset, int length)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object v)
void
writePosition(AbstractSequence seq, int ipos)
void
writeProcessingInstruction(String target, char[] content, int offset, int length)

Methods inherited from class gnu.mapping.Values

call_with, canonicalize, countValues, getValues, make, make, make, make, make, nextIndex, nextValue, print, readExternal, readResolve, values$V, writeExternal, writeValues

Methods inherited from class gnu.lists.TreeList

append, append, append, beginEntity, clear, compare, consume, consume, consumeIRange, consumeNext, consumePosRange, createPos, createRelativePos, documentUriOfPos, dump, dump, dump, endAttribute, endDocument, endElement, endEntity, ensureSpace, find, firstAttributePos, firstChildPos, get, getAttributeCount, getIndexDifference, getIntN, getLongN, getNextKind, getNextKindI, getNextTypeName, getNextTypeObject, getPosNext, getPosNextInt, getPosPrevious, gotoAttributesStart, gotoAttributesStart, gotoChildrenStart, hasNext, hashCode, ignoring, isEmpty, nextDataIndex, nextMatching, nextNodeIndex, nextPos, parentOrEntityI, parentOrEntityPos, parentPos, posToDataIndex, resizeObjects, setAttributeName, setElementName, setIntN, size, startAttribute, startAttribute, startDocument, startElement, startElement, statistics, statistics, stringValue, stringValue, stringValue, toString, write, write, write, write, writeBoolean, writeByte, writeCDATA, writeComment, writeComment, writeDocumentUri, writeDouble, writeFloat, writeInt, writeJoiner, writeLong, writeObject, writePosition, writeProcessingInstruction, writeProcessingInstruction

Methods inherited from class gnu.lists.AbstractSequence

add, add, addAll, addAll, addPos, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createPos, createRelativePos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hasNext, hasPrevious, hashCode, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setPosNext, setPosPrevious, size, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedException

Method Details

append

public Consumer append(CharSequence csq,
                       int start,
                       int end)
Overrides:
append in interface TreeList

beginEntity

public void beginEntity(Object base)
Specified by:
beginEntity in interface XConsumer
Overrides:
beginEntity in interface TreeList

endAttribute

public void endAttribute()
End 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:
endAttribute in interface Consumer
Overrides:
endAttribute in interface TreeList

endDocument

public void endDocument()
Specified by:
endDocument in interface Consumer
Overrides:
endDocument in interface TreeList

endElement

public void endElement()
Specified by:
endElement in interface Consumer
Overrides:
endElement in interface TreeList

endEntity

public void endEntity()
Specified by:
endEntity in interface XConsumer
Overrides:
endEntity in interface TreeList

find

public int find(Object seq)
Overrides:
find in interface TreeList

get

public Object get(int index)
See java.util.List.
Overrides:
get in interface TreeList

getLength

public int getLength()

getPos

public int getPos(int index)
Optimization of ((SeqPosition) get(index)). ipos.

getPosNext

public Object getPosNext(int ipos)
Get the element following the specified position.
Overrides:
getPosNext in interface TreeList
Parameters:
ipos - the specified position.
Returns:
the following element, or eofValue if there is none. Called by SeqPosition.getNext.

getSeq

public AbstractSequence getSeq(int index)
Optimization of ((SeqPosition) get(index)).sequence. However returns null instead of throwing IndexOutOfBoundsException if index >= count.

root

public static KNode root(NodeTree seq,
                         int ipos)

size

public int size()
See java.util.List.
Overrides:
size in interface TreeList

startAttribute

public void startAttribute(Object attrType)
Write a attribute for the current element. This is only allowed immediately after a startElement.
Specified by:
startAttribute in interface Consumer
Overrides:
startAttribute in interface TreeList

startDocument

public void startDocument()
Specified by:
startDocument in interface Consumer
Overrides:
startDocument in interface TreeList

startElement

public void startElement(Object type)
Specified by:
startElement in interface Consumer
Overrides:
startElement in interface TreeList

write

public void write(CharSequence str,
                  int start,
                  int length)
Specified by:
write in interface Consumer
Overrides:
write in interface TreeList

write

public void write(String str)
Specified by:
write in interface Consumer
Overrides:
write in interface TreeList

write

public void write(char[] buf,
                  int off,
                  int len)
Specified by:
write in interface Consumer
Overrides:
write in interface TreeList

write

public void write(int v)
Specified by:
write in interface Consumer
Overrides:
write in interface TreeList

writeBoolean

public void writeBoolean(boolean v)
Specified by:
writeBoolean in interface Consumer
Overrides:
writeBoolean in interface TreeList

writeCDATA

public void writeCDATA(char[] chars,
                       int offset,
                       int length)
Specified by:
writeCDATA in interface XConsumer
Overrides:
writeCDATA in interface TreeList

writeComment

public void writeComment(char[] chars,
                         int offset,
                         int length)
Specified by:
writeComment in interface XConsumer
Overrides:
writeComment in interface TreeList

writeDouble

public void writeDouble(double v)
Specified by:
writeDouble in interface Consumer
Overrides:
writeDouble in interface TreeList

writeFloat

public void writeFloat(float v)
Specified by:
writeFloat in interface Consumer
Overrides:
writeFloat in interface TreeList

writeInt

public void writeInt(int v)
Specified by:
writeInt in interface Consumer
Overrides:
writeInt in interface TreeList

writeLong

public void writeLong(long v)
Specified by:
writeLong in interface Consumer
Overrides:
writeLong in interface TreeList

writeObject

public void writeObject(Object v)
Specified by:
writeObject in interface Consumer
Overrides:
writeObject in interface TreeList

writePosition

public void writePosition(AbstractSequence seq,
                          int ipos)
Specified by:
writePosition in interface PositionConsumer
Overrides:
writePosition in interface TreeList

writeProcessingInstruction

public void writeProcessingInstruction(String target,
                                       char[] content,
                                       int offset,
                                       int length)
Specified by:
writeProcessingInstruction in interface XConsumer
Overrides:
writeProcessingInstruction in interface TreeList