Package gnu.kawa.xml

Class SortedNodes

  • All Implemented Interfaces:
    Consumable, Consumer, PositionConsumer, java.io.Externalizable, java.io.Serializable, java.lang.Appendable, java.util.function.Consumer<java.lang.Object>, java.util.function.DoubleConsumer, java.util.function.IntConsumer, java.util.function.LongConsumer, org.w3c.dom.NodeList

    public class SortedNodes
    extends Nodes
    Manages a sequence of node references in document order without duplicates. 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
    • Constructor Detail

      • SortedNodes

        public SortedNodes()
    • Method Detail

      • writePosition

        public void writePosition​(SeqPosition position)
        Description copied from interface: PositionConsumer
        Consume 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:
        writePosition in interface PositionConsumer
        Overrides:
        writePosition in class Nodes
      • 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