public abstract class SimpleVector<E> extends AbstractSequence<E> implements Sequence<E>, Array<E>, java.util.RandomAccess
| Modifier and Type | Field and Description |
|---|---|
protected int |
size
The (current) number of elements.
|
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE| Constructor and Description |
|---|
SimpleVector() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o)
See java.util.Collection.
|
void |
add(int index,
E o)
See java.util.List.
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
See java.util.Collection.
|
protected int |
addPos(int ipos,
E value)
Add a value at a specified Pos.
|
protected void |
checkCanWrite() |
void |
clear() |
protected abstract void |
clearBuffer(int start,
int count) |
protected static int |
compareToInt(SimpleVector v1,
SimpleVector v2) |
protected static int |
compareToLong(SimpleVector v1,
SimpleVector v2) |
void |
consume(int start,
int length,
Consumer out) |
void |
consumePosRange(int iposStart,
int iposEnd,
Consumer out) |
void |
fill(E value) |
void |
fill(int fromIndex,
int toIndex,
E value) |
void |
fillPosRange(int fromPos,
int toPos,
E value) |
E |
get(int index)
See java.util.List.
|
protected abstract java.lang.Object |
getBuffer() |
protected abstract E |
getBuffer(int index) |
abstract int |
getBufferLength()
Get the allocated length of the data buffer.
|
int |
getElementKind() |
int |
getNextKind(int ipos) |
java.lang.Object |
getPosNext(int ipos)
Get the element following the specified position.
|
E |
getRowMajor(int i) |
java.lang.String |
getTag()
This is convenience hack for printing "uniform vectors" (srfi 4).
|
int |
intAt(int index) |
int |
intAtBuffer(int index) |
protected boolean |
isAfterPos(int ipos)
Tests whether the position has the "isAfter" property.
|
long |
longAt(int index) |
long |
longAtBuffer(int index) |
protected int |
nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
|
int |
nextPos(int ipos)
Return the next position following the argument.
|
E |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.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.
|
protected void |
resizeShift(int oldGapStart,
int oldGapEnd,
int newGapStart,
int newGapEnd)
Used by GapVector to grow and maybe move gap.
|
boolean |
retainAll(java.util.Collection<?> c) |
E |
set(int index,
E value)
See java.util.List.
|
protected abstract void |
setBuffer(int index,
E value) |
abstract void |
setBufferLength(int length) |
void |
setSize(int size)
Set the size to a specified value.
|
void |
shift(int srcStart,
int dstStart,
int count) |
int |
size()
See java.util.List.
|
Array |
transpose(int[] lowBounds,
int[] dimensions,
int offset0,
int[] factors) |
addAll, compare, compare, compare, consume, consumeNext, contains, containsAll, copyPos, createPos, createRelativePos, elements, endPos, equals, equals, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextTypeName, getNextTypeObject, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, parentPos, previousPos, rank, releasePos, set, setPosNext, setPosPrevious, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, toString, unsupported, unsupportedExceptionclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, replaceAll, sort, spliterator, subList, toArray, toArrayconsumeget, getEffectiveIndex, getLowBound, getSize, isEmpty, rank, setprotected int size
public final int size()
AbstractSequenceprotected void checkCanWrite()
public void setSize(int size)
protected void resizeShift(int oldGapStart,
int oldGapEnd,
int newGapStart,
int newGapEnd)
public abstract int getBufferLength()
public abstract void setBufferLength(int length)
protected boolean isAfterPos(int ipos)
AbstractSequenceisAfterPos in class AbstractSequence<E>protected int nextIndex(int ipos)
AbstractSequencenextIndex in class AbstractSequence<E>public int nextPos(int ipos)
AbstractSequencenextPos in class AbstractSequence<E>protected abstract java.lang.Object getBuffer()
public E get(int index)
AbstractSequencepublic java.lang.Object getPosNext(int ipos)
AbstractSequencegetPosNext in class AbstractSequence<E>ipos - the specified position.public int intAtBuffer(int index)
public int intAt(int index)
public long longAt(int index)
public long longAtBuffer(int index)
public E getRowMajor(int i)
getRowMajor in interface Array<E>protected abstract E getBuffer(int index)
public E set(int index, E value)
Sequenceprotected abstract void setBuffer(int index,
E value)
public void fill(E value)
public void fillPosRange(int fromPos,
int toPos,
E value)
fillPosRange in class AbstractSequence<E>public void fill(int fromIndex,
int toIndex,
E value)
fill in class AbstractSequence<E>public void shift(int srcStart,
int dstStart,
int count)
public boolean add(E o)
AbstractSequenceadd in interface java.util.Collection<E>add in interface java.util.List<E>add in class AbstractSequence<E>protected int addPos(int ipos,
E value)
AbstractSequenceaddPos in class AbstractSequence<E>public void add(int index,
E o)
AbstractSequenceadd in interface java.util.List<E>add in class AbstractSequence<E>public boolean addAll(int index,
java.util.Collection<? extends E> c)
AbstractSequenceaddAll in interface java.util.List<E>addAll in class AbstractSequence<E>protected abstract void clearBuffer(int start,
int count)
protected void removePosRange(int ipos0,
int ipos1)
AbstractSequenceremovePosRange in class AbstractSequence<E>ipos0 - start of range, as a poistionipos1 - end of rangepublic void removePos(int ipos,
int count)
AbstractSequenceremovePos in class AbstractSequence<E>ipos - position where elements should be removedcount - 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).public E remove(int index)
remove in interface java.util.List<E>remove in class AbstractSequence<E>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.List<E>remove in class AbstractSequence<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.List<E>removeAll in class AbstractSequence<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.List<E>retainAll in class AbstractSequence<E>public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.List<E>clear in class AbstractSequence<E>public java.lang.String getTag()
protected static int compareToInt(SimpleVector v1, SimpleVector v2)
protected static int compareToLong(SimpleVector v1, SimpleVector v2)
public void consume(int start,
int length,
Consumer out)
consume in class AbstractSequence<E>public void consumePosRange(int iposStart,
int iposEnd,
Consumer out)
consumePosRange in class AbstractSequence<E>public int getNextKind(int ipos)
getNextKind in class AbstractSequence<E>public int getElementKind()