gnu.kawa.xml
Class SortedNodes

java.lang.Object
  extended by gnu.lists.AbstractSequence
      extended by gnu.lists.TreeList
          extended by gnu.mapping.Values
              extended by gnu.kawa.xml.Nodes
                  extended by gnu.kawa.xml.SortedNodes
All Implemented Interfaces:
Consumable, Consumer, PositionConsumer, XConsumer, Printable, java.io.Externalizable, java.io.Serializable

public class SortedNodes
extends Nodes

Manages a sequence of node references in document order without duplicates. All elements are POSITION_PAIR_FOLLOWS elements, which makes operations simple and efficient. The most recently added element is just before the gap. Optimized for the data being in order, or at least having good locality (a node being "near" the previously-entered node).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gnu.mapping.Values
empty, noArgs
 
Fields inherited from class gnu.lists.TreeList
attrStart, 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, data, docStart, DOCUMENT_URI, END_ATTRIBUTE_SIZE, END_DOCUMENT, END_ELEMENT_LONG, END_ELEMENT_SHORT, END_ENTITY, gapEnd, gapStart, INT_FOLLOWS, MAX_CHAR_SHORT, objects, oindex, POSITION_PAIR_FOLLOWS, PROCESSING_INSTRUCTION
 
Constructor Summary
SortedNodes()
           
 
Method Summary
 void writePosition(AbstractSequence seq, int ipos)
          Consume a single position pair.
 
Methods inherited from class gnu.kawa.xml.Nodes
append, beginEntity, endAttribute, endDocument, endElement, endEntity, find, get, getLength, getPos, getPosNext, getSeq, root, size, startAttribute, startDocument, startElement, write, write, write, write, writeBoolean, writeCDATA, writeComment, writeDouble, writeFloat, writeInt, writeLong, writeObject, writeProcessingInstruction
 
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, clear, compare, consume, consume, consumeIRange, consumeNext, consumePosRange, createPos, createRelativePos, documentUriOfPos, dump, dump, dump, ensureSpace, firstAttributePos, firstChildPos, getAttributeCount, getIndexDifference, getIntN, getLongN, getNextKind, getNextKindI, getNextTypeName, getNextTypeObject, getPosNextInt, getPosPrevious, gotoAttributesStart, gotoAttributesStart, gotoChildrenStart, hashCode, hasNext, ignoring, isEmpty, nextDataIndex, nextMatching, nextNodeIndex, nextPos, parentOrEntityI, parentOrEntityPos, parentPos, posToDataIndex, resizeObjects, setAttributeName, setElementName, setIntN, startAttribute, startElement, statistics, statistics, stringValue, stringValue, stringValue, toString, writeByte, writeDocumentUri, writeJoiner
 
Methods inherited from class gnu.lists.AbstractSequence
add, add, addAll, addAll, addPos, compare, compare, contains, containsAll, copyPos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIterator, getIterator, getIteratorAtPos, getLowBound, getSize, gotoChildrenStart, gotoParent, hasPrevious, indexOf, isAfterPos, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextIndex, previousPos, rank, releasePos, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setPosNext, setPosPrevious, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, unsupported, unsupportedException
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortedNodes

public SortedNodes()
Method Detail

writePosition

public void writePosition(AbstractSequence seq,
                          int ipos)
Description copied from interface: PositionConsumer
Consume 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:
writePosition in interface PositionConsumer
Overrides:
writePosition in class Nodes