public abstract class SimpleVector<E> extends AbstractSequence<E> implements Sequence<E>, Array<E>, java.util.RandomAccess
Modifier and Type | Field and Description |
---|---|
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) |
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) |
int |
createPos(int index,
boolean isAfter)
Generate a position at a given index.
|
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 E |
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, contains, containsAll, copyPos, 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, unsupportedException
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, replaceAll, sort, spliterator, subList, toArray, toArray
consume
get, getEffectiveIndex, getLowBound, getSize, isEmpty, rank, set
public int size
public final int size()
AbstractSequence
protected 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)
AbstractSequence
isAfterPos
in class AbstractSequence<E>
protected int nextIndex(int ipos)
AbstractSequence
nextIndex
in class AbstractSequence<E>
public int createPos(int index, boolean isAfter)
AbstractSequence
createPos
in class AbstractSequence<E>
index
- offset from beginning of desired positionisAfter
- should the position have the isAfter propertypublic int nextPos(int ipos)
AbstractSequence
nextPos
in class AbstractSequence<E>
protected abstract java.lang.Object getBuffer()
public E get(int index)
AbstractSequence
public java.lang.Object getPosNext(int ipos)
AbstractSequence
getPosNext
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)
Sequence
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)
AbstractSequence
add
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)
AbstractSequence
addPos
in class AbstractSequence<E>
public void add(int index, E o)
AbstractSequence
add
in interface java.util.List<E>
add
in class AbstractSequence<E>
public boolean addAll(int index, java.util.Collection<? extends E> c)
AbstractSequence
addAll
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)
AbstractSequence
removePosRange
in class AbstractSequence<E>
ipos0
- start of range, as a poistionipos1
- end of rangepublic void removePos(int ipos, int count)
AbstractSequence
removePos
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)
public boolean consumeNext(int ipos, Consumer out)
AbstractSequence
consumeNext
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()