gnu.lists
public abstract class AbstractSequence extends Object
Method Summary | |
---|---|
boolean | add(Object o) See java.util.Collection. |
void | add(int index, Object o) See java.util.List. |
boolean | addAll(Collection c) See java.util.Collection. |
boolean | addAll(int index, Collection c) See java.util.Collection. |
protected int | addPos(int ipos, Object value) Add a value at a specified Pos. |
void | clear() |
int | compare(int ipos1, int ipos2) Compare two positions, and indicate their relative order. |
int | compare(SeqPosition i1, SeqPosition i2) |
static int | compare(AbstractSequence seq1, int pos1, AbstractSequence seq2, int pos2) This is used for the XML concept of "document order".
|
void | consume(Consumer out) |
boolean | consumeNext(int ipos, Consumer out) Copy an element specified by a position pair to a Consumer. |
void | consumePosRange(int iposStart, int iposEnd, Consumer out) |
boolean | contains(Object o) See java.util.List. |
boolean | containsAll(Collection c) See java.util.List. |
int | copyPos(int ipos) Make a copy of a position int.
|
abstract int | createPos(int index, boolean isAfter) Generate a position at a given index.
|
int | createRelativePos(int pos, int delta, boolean isAfter) |
Enumeration | elements() |
int | endPos() |
boolean | equals(int ipos1, int ipos2) Compare two positions, and indicate if they are the same position. |
boolean | equals(Object o) |
void | fill(Object value) |
void | fill(int fromIndex, int toIndex, Object value) |
void | fillPosRange(int fromPos, int toPos, Object value) |
int | firstAttributePos(int ipos) Like firstChildPos.
|
int | firstChildPos(int ipos) Get position before first child (of the element following position). |
int | firstChildPos(int ipos, ItemPredicate predicate) |
protected int | fromEndIndex(int ipos) |
abstract Object | get(int index) See java.util.List. |
Object | get(int[] indexes) |
Object | getAttribute(int index) |
int | getAttributeLength() |
protected int | getContainingSequenceSize(int ipos)
Get the size of the (sub-) sequence containing a given position.
|
int | getEffectiveIndex(int[] indexes) |
protected int | getIndexDifference(int ipos1, int ipos0) Get offset of (ipos1) relative to (ipos0). |
SeqPosition | getIterator() |
SeqPosition | getIterator(int index) |
SeqPosition | getIteratorAtPos(int ipos) |
int | getLowBound(int dim) |
int | getNextKind(int ipos) |
String | getNextTypeName(int ipos) |
Object | getNextTypeObject(int ipos) |
Object | getPosNext(int ipos) Get the element following the specified position. |
Object | getPosPrevious(int ipos) Get the element before the specified position. |
int | getSize(int dim) |
protected boolean | gotoAttributesStart(TreePosition pos) |
boolean | gotoChildrenStart(TreePosition pos) Set position before first child (of the element following position). |
protected boolean | gotoParent(TreePosition pos) |
int | hashCode() |
boolean | hasNext(int ipos) |
protected boolean | hasPrevious(int ipos) Called by SeqPosition.hasPrevious. |
int | indexOf(Object o) See java.util.List. |
protected boolean | isAfterPos(int ipos) Tests whether the position has the "isAfter" property.
|
boolean | isEmpty() |
Iterator | iterator() |
int | lastIndexOf(Object o) See java.util.List. |
ListIterator | listIterator() |
ListIterator | listIterator(int index) |
protected int | nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie. |
int | nextIndex(SeqPosition pos) |
int | nextMatching(int startPos, ItemPredicate type, int endPos, boolean descend) Get next matching child or descendent (ignoring attributes). |
int | nextPos(int ipos) Return the next position following the argument.
|
int | parentPos(int ipos) Get position of parent. |
int | previousPos(int ipos) Return the previous position following the argument.
|
int | rank() |
protected void | releasePos(int ipos)
Reclaim any resources used by the given position int. |
Object | remove(int index) |
boolean | remove(Object o) |
boolean | removeAll(Collection c) |
void | removePos(int ipos, int count)
Remove one or more elements. |
protected void | removePosRange(int ipos0, int ipos1) Remove a range where each end-point is a position in a container. |
boolean | retainAll(Collection c) |
Object | set(int[] indexes, Object value) |
Object | set(int index, Object element) |
protected void | setPosNext(int ipos, Object value) |
protected void | setPosPrevious(int ipos, Object value) |
abstract int | size() See java.util.List. |
int | stableCompare(AbstractSequence other) This is used for the XML concept of "document order". |
int | startPos() |
List | subList(int fromIx, int toIx) |
Sequence | subSequence(SeqPosition start, SeqPosition end) |
protected Sequence | subSequencePos(int ipos0, int ipos1) |
Object[] | toArray() |
Object[] | toArray(Object[] arr) |
void | toString(String sep, StringBuffer sbuf) |
String | toString() |
protected RuntimeException | unsupported(String text) |
static RuntimeException | unsupportedException(String text) |
Returns: the updated Pos, which is after the inserted value..
Returns: if hasNext(ipos).
Parameters: ipos the position being copied.
Returns: the new position
Parameters: index offset from beginning of desired position isAfter should the position have the isAfter property
Throws: IndexOutOfBoundsException if index is out of bounds
Parameters: ipos parent position. It is not released by this method.
Returns: non-zero position cookie if there is a child sequence (which might be empty); zero if current position is end of sequence or following element is atomic (cannot have children).
Parameters: ipos the specified position.
Returns: the following element, or eofValue if there is none. Called by SeqPosition.getNext.
Parameters: ipos the specified position.
Returns: the following element, or eofValue if there is none.
Returns: true if there is a child sequence (which might be empty); false if current position is end of sequence or following element is atomic (cannot have children).
Parameters: startPos starting position type a test (predicate) to apply to selected elements endPos stop before endPos descend if true do depth-first traversal.
Returns: poistion of next match or 0 if none found
Parameters: ipos child position. It is not released by this method.
Returns: the p os of the parent, or endPos() is there is no known parent.
Parameters: ipos the Pos being free'd.
Parameters: ipos position where elements should be removed count if non-negative, remove that number of elements following (poses, posNumber); if negative the negative of the number of elements to remove before (poses, posNumber).
Throws: java.lang.IndexOutOfBoundsException if (count >= 0 ? (index < 0 || index + count > size()) : (index + count < 0 || index > size())), where index == nextIndex(ipos, xpos).
Parameters: ipos0 start of range, as a poistion ipos1 end of range
Throws: java.lang.IndexOutOfBoundsException if nextIndex(ipos0) > nextIndex(ipos1) || nextIndex(ipos0) < 0 || nextIndex(ipos1) > size()