|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.lists.AbstractSequence gnu.lists.SimpleVector
public abstract class SimpleVector
A SimpleVector implement as a simple array plus a current size. Methods with the word "Buffer" are methods which use the underlying array, ignoring the 'size' field. Can be used to implement CommonLisp simple vectors, but all simple vectors are also adjustable (by re-allocating the buffer) and have a fill pointer (the size field).
Field Summary | |
---|---|
int |
size
The (current) number of elements. |
Fields inherited from interface gnu.lists.Sequence |
---|
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, GROUP_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 Summary | |
---|---|
SimpleVector()
|
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object o)
See java.util.List. |
boolean |
add(java.lang.Object o)
See java.util.Collection. |
boolean |
addAll(int index,
java.util.Collection c)
See java.util.Collection. |
protected int |
addPos(int ipos,
java.lang.Object value)
Add a value at a specified Pos. |
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(int fromIndex,
int toIndex,
java.lang.Object value)
|
void |
fill(java.lang.Object value)
|
void |
fillPosRange(int fromPos,
int toPos,
java.lang.Object value)
|
java.lang.Object |
get(int index)
See java.util.List. |
protected abstract java.lang.Object |
getBuffer()
|
protected abstract java.lang.Object |
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. |
java.lang.Object |
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. |
java.lang.Object |
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. |
boolean |
retainAll(java.util.Collection c)
|
java.lang.Object |
set(int index,
java.lang.Object value)
|
protected abstract java.lang.Object |
setBuffer(int index,
java.lang.Object 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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gnu.lists.Sequence |
---|
elements, isEmpty |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList, toArray, toArray |
Methods inherited from interface gnu.lists.Consumable |
---|
consume |
Methods inherited from interface gnu.lists.Array |
---|
get, getEffectiveIndex, getLowBound, getSize, isEmpty, rank, set |
Field Detail |
---|
public int size
Constructor Detail |
---|
public SimpleVector()
Method Detail |
---|
public final int size()
AbstractSequence
size
in interface Sequence
size
in interface java.util.Collection
size
in interface java.util.List
size
in class AbstractSequence
public void setSize(int size)
public abstract int getBufferLength()
public abstract void setBufferLength(int length)
protected boolean isAfterPos(int ipos)
AbstractSequence
isAfterPos
in class AbstractSequence
protected int nextIndex(int ipos)
AbstractSequence
nextIndex
in class AbstractSequence
public int createPos(int index, boolean isAfter)
AbstractSequence
createPos
in class AbstractSequence
index
- offset from beginning of desired positionisAfter
- should the position have the isAfter propertypublic int nextPos(int ipos)
AbstractSequence
nextPos
in class AbstractSequence
protected abstract java.lang.Object getBuffer()
public java.lang.Object get(int index)
AbstractSequence
get
in interface Sequence
get
in interface java.util.List
get
in class AbstractSequence
public java.lang.Object getPosNext(int ipos)
AbstractSequence
getPosNext
in class AbstractSequence
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 java.lang.Object getRowMajor(int i)
getRowMajor
in interface Array
protected abstract java.lang.Object getBuffer(int index)
public java.lang.Object set(int index, java.lang.Object value)
set
in interface java.util.List
set
in class AbstractSequence
protected abstract java.lang.Object setBuffer(int index, java.lang.Object value)
public void fill(java.lang.Object value)
fill
in interface Sequence
fill
in class AbstractSequence
public void fillPosRange(int fromPos, int toPos, java.lang.Object value)
fillPosRange
in class AbstractSequence
public void fill(int fromIndex, int toIndex, java.lang.Object value)
fill
in class AbstractSequence
public void shift(int srcStart, int dstStart, int count)
public boolean add(java.lang.Object o)
AbstractSequence
add
in interface java.util.Collection
add
in interface java.util.List
add
in class AbstractSequence
protected int addPos(int ipos, java.lang.Object value)
AbstractSequence
addPos
in class AbstractSequence
public void add(int index, java.lang.Object o)
AbstractSequence
add
in interface java.util.List
add
in class AbstractSequence
public boolean addAll(int index, java.util.Collection c)
AbstractSequence
addAll
in interface java.util.List
addAll
in class AbstractSequence
protected abstract void clearBuffer(int start, int count)
protected void removePosRange(int ipos0, int ipos1)
AbstractSequence
removePosRange
in class AbstractSequence
ipos0
- start of range, as a poistionipos1
- end of rangepublic void removePos(int ipos, int count)
AbstractSequence
removePos
in class AbstractSequence
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 java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class AbstractSequence
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class AbstractSequence
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class AbstractSequence
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class AbstractSequence
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class AbstractSequence
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
public void consumePosRange(int iposStart, int iposEnd, Consumer out)
consumePosRange
in class AbstractSequence
public int getNextKind(int ipos)
getNextKind
in class AbstractSequence
public int getElementKind()
public Array transpose(int[] lowBounds, int[] dimensions, int offset0, int[] factors)
transpose
in interface Array
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |