Package gnu.lists
Class ExtSequence<E>
- java.lang.Object
-
- gnu.lists.AbstractSequence<E>
-
- gnu.lists.ExtSequence<E>
-
- Direct Known Subclasses:
LList
public abstract class ExtSequence<E> extends AbstractSequence<E>
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.
-
-
Field Summary
-
Fields inherited from class gnu.lists.AbstractSequence
noInts
-
-
Constructor Summary
Constructors Constructor Description ExtSequence()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, asImmutable, badRank, boundedHash, checkCanWrite, checkRank, clear, compare, compare, compare, consume, consume, consumeNext, consumePosRange, contains, containsAll, createPos, createRelativePos, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, effectiveIndex, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, get, get, get, get, getAttribute, getAttributeLength, getBooleanRaw, getByteRaw, getCharRaw, getContainingSequenceSize, getDoubleRaw, getElementKind, getFloatRaw, getIndexDifference, getInt, getInt, getInt, getInt, getInt, getIntRaw, getIterator, getIterator, getIteratorAtPos, getLongRaw, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getRaw, getRowMajor, getShortRaw, getSize, 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, setAt, setBuffer, setPosNext, setPosPrevious, setRaw, size, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedException
-
-
-
-
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 classAbstractSequence<E>
- 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 classAbstractSequence<E>
- 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 classAbstractSequence<E>
-
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 classAbstractSequence<E>
-
-