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_DOCUMENT, END_DOCUMENT, END_GROUP_LONG, END_GROUP_SHORT, INT_FOLLOWS, POSITION_PAIR_FOLLOWS, PROCESSING_INSTRUCTION, attrStart, data, docStart, gapEnd, gapStart, objects, oindex

Method Summary

void
beginAttribute(String attrName, Object attrType)
Write a attribute for the current group.
void
beginDocument()
void
beginGroup(String typeName, Object type)
void
endAttribute()
void
endDocument()
void
endGroup(String typeName)
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.
Node
item(int index)
static SeqPosition
root(Object node)
Return the root node of the argument.
int
size()
See java.util.List.
void
write(char[] buf, int off, int len)
void
writeBaseUri(Object uri)
Write/set the base-uri property of the current element or document.
void
writeBoolean(boolean v)
void
writeCDATA(char[] chars, int offset, int length)
void
writeChar(int v)
void
writeChars(String str)
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, getValues, make, make, make, make, make, nextIndex, nextValue, print, readExternal, readResolve, values$V, writeExternal, writeValues

Methods inherited from class gnu.lists.TreeList

baseUriOfPos, beginAttribute, beginAttribute, beginDocument, beginGroup, beginGroup, clear, compare, consume, consume, consumeIRange, consumeNext, consumePosRange, createPos, createRelativePos, dump, dump, endAttribute, endDocument, endGroup, ensureSpace, find, find, firstAttributePos, firstChildPos, get, getIndexDifference, getIntN, getLongN, getNextKind, getNextTypeIndex, getNextTypeName, getNextTypeObject, getPosNext, getPosNextInt, getPosPrevious, gotoAttributesStart, gotoAttributesStart, gotoChildrenStart, hasNext, hashCode, ignoring, isEmpty, nextDataIndex, nextMatching, nextNodeIndex, nextPos, parentPos, posToDataIndex, resizeObjects, setIntN, size, statistics, statistics, stringValue, stringValue, toString, write, writeBaseUri, writeBoolean, writeByte, writeCDATA, writeChar, writeChars, writeComment, writeDouble, writeFloat, writeInt, writeLong, writeObject, writePosition, writeProcessingInstruction

Methods inherited from class gnu.lists.AbstractSequence

add, add, addAll, addAll, addPos, append, baseUriOfPos, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createPos, createRelativePos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, 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

Method Details

beginAttribute

public void beginAttribute(String attrName,
                           Object attrType)
Write a attribute for the current group. This is only allowed immediately after a beginGroup.
Specified by:
beginAttribute in interface Consumer
Overrides:
beginAttribute in interface TreeList

beginDocument

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

beginGroup

public void beginGroup(String typeName,
                       Object type)
Specified by:
beginGroup in interface Consumer
Overrides:
beginGroup in interface TreeList

endAttribute

public void endAttribute()
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

endGroup

public void endGroup(String typeName)
Specified by:
endGroup in interface Consumer
Overrides:
endGroup 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.

item

public Node item(int index)

root

public static SeqPosition root(Object node)
Return the root node of the argument.

size

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

write

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

writeBaseUri

public void writeBaseUri(Object uri)
Write/set the base-uri property of the current element or document. Only allowed immediately following beginDocument, beginGroup, or writeProcessingInstruction.
Specified by:
writeBaseUri in interface XConsumer
Overrides:
writeBaseUri 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

writeChar

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

writeChars

public void writeChars(String str)
Specified by:
writeChars in interface Consumer
Overrides:
writeChars 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