gnu.lists
Class ExtSequence

java.lang.Object
  extended by gnu.lists.AbstractSequence
      extended by gnu.lists.ExtSequence
Direct Known Subclasses:
LList

public abstract class ExtSequence
extends AbstractSequence

Abstract helper class for Sequences that use an ExtPosition. That is sequences where it is inefficient to represent a position just using a Pos int.


Constructor Summary
ExtSequence()
           
 
Method Summary
 int copyPos(int ipos)
          Make a copy of a position int.
protected  boolean isAfterPos(int ipos)
          Tests whether the position has the "isAfter" property.
protected  int nextIndex(int ipos)
          Get the offset from the beginning corresponding to a position cookie.
protected  void releasePos(int ipos)
          Reclaim any resources used by the given position int.
 
Methods inherited from class gnu.lists.AbstractSequence
add, add, addAll, addAll, addPos, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, 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, hashCode, hasNext, hasPrevious, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, remove, remove, removeAll, removePos, removePosRange, retainAll, set, set, setPosNext, setPosPrevious, size, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedException
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtSequence

public ExtSequence()
Method Detail

copyPos

public int copyPos(int ipos)
Description copied from class: AbstractSequence
Make a copy of a position int. For simple positions returns the argument. However, if the positions are magic cookies that are actively managed by the sequence (as opposed to for example a simple index), then making a copy may need to increment a reference count, or maybe allocate a new position cookie. In any case, the new position is initialized to the same offset (and isAfter property) as the original.

Overrides:
copyPos in class AbstractSequence
Parameters:
ipos - the position being copied.
Returns:
the new position

releasePos

protected void releasePos(int ipos)
Description copied from class: AbstractSequence
Reclaim any resources used by the given position int.

Overrides:
releasePos in class AbstractSequence
Parameters:
ipos - the Pos being free'd.

isAfterPos

protected boolean isAfterPos(int ipos)
Description copied from class: AbstractSequence
Tests whether the position has the "isAfter" property. I.e. if something is inserted at the position, will the iterator end up being after the new data?

Overrides:
isAfterPos in class AbstractSequence

nextIndex

protected int nextIndex(int ipos)
Description copied from class: AbstractSequence
Get the offset from the beginning corresponding to a position cookie.

Overrides:
nextIndex in class AbstractSequence