|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.isi.stella.Stella_Object
edu.isi.stella.StandardObject
edu.isi.stella.AbstractCollection
edu.isi.stella.Collection
edu.isi.stella.Sequence
edu.isi.stella.Vector
edu.isi.stella.VectorSequence
public class VectorSequence
Extensible sequence implemented by a vector. Whenever we run out of room, we grow the sequence by a factor of two. Note that this keeps the average insertion cost per element constant. This is generally preferable over linked lists unless we need within-list insertions or removals, since it uses less space and has better cache locality.
| Field Summary | |
|---|---|
int |
sequenceLength
|
| Fields inherited from class edu.isi.stella.Vector |
|---|
arraySize, theArray |
| Constructor Summary | |
|---|---|
VectorSequence()
|
|
| Method Summary | |
|---|---|
static Stella_Object |
accessVectorSequenceSlotValue(VectorSequence self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
|
void |
clear()
Clear self by setting its active length to zero. |
Vector |
copy()
Return a copy of the vector sequence self. |
static void |
copyVectorSequence(VectorSequence source,
VectorSequence copy)
|
boolean |
emptyP()
Return true if self has length 0. |
void |
insert(Stella_Object value)
Append value to the END of the sequence self. |
Stella_Object |
last()
Return the last item in the vector self. |
Stella_Object |
lastSetter(Stella_Object value)
|
int |
length()
|
static VectorSequence |
newVectorSequence(int arraySize)
|
boolean |
nonEmptyP()
Return true if self has length > 0. |
boolean |
objectEqualP(Stella_Object y)
Return TRUE iff the sequences x and y are structurally
equivalent. |
Surrogate |
primaryType()
Returns the primary type of self. |
AbstractCollection |
remove(Stella_Object value)
Remove value from the sequence self, and left shift
the values after it to close the gap. |
VectorSequence |
reverse()
Reverse the order of elements in the active portion of self. |
| Methods inherited from class edu.isi.stella.Vector |
|---|
accessVectorSlotValue, allocateIterator, butLast, consify, equalHashCode, fifth, fifthSetter, first, firstSetter, fourth, fourthSetter, initializeVector, insertAt, lastPosition, listify, memberP, newVector, nth, nthSetter, position, printObject, printVector, resizeVector, second, secondSetter, sort, third, thirdSetter |
| Methods inherited from class edu.isi.stella.Sequence |
|---|
orderedP, sequence, yieldConsListFromSequence |
| Methods inherited from class edu.isi.stella.Collection |
|---|
noDuplicatesP |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int sequenceLength
| Constructor Detail |
|---|
public VectorSequence()
| Method Detail |
|---|
public static VectorSequence newVectorSequence(int arraySize)
public boolean objectEqualP(Stella_Object y)
x and y are structurally
equivalent. Uses equalP to test equality of elements.
objectEqualP in class Vectory -
public void clear()
self by setting its active length to zero.
clear in class Vectorpublic Vector copy()
self.
copy in class Vector
public static void copyVectorSequence(VectorSequence source,
VectorSequence copy)
public VectorSequence reverse()
self.
public AbstractCollection remove(Stella_Object value)
value from the sequence self, and left shift
the values after it to close the gap.
remove in class Collectionvalue -
public void insert(Stella_Object value)
value to the END of the sequence self.
Resize the array if necessary.
insert in class Collectionvalue - public Stella_Object lastSetter(Stella_Object value)
lastSetter in class Vectorpublic Stella_Object last()
self.
last in class Vectorpublic int length()
length in class Vectorpublic boolean nonEmptyP()
true if self has length > 0.
nonEmptyP in class Vectorpublic boolean emptyP()
true if self has length 0.
emptyP in class Vector
public static Stella_Object accessVectorSequenceSlotValue(VectorSequence self,
Symbol slotname,
Stella_Object value,
boolean setvalueP)
public Surrogate primaryType()
Stella_Objectself.
Gets defined automatically for every non-abstract subclass of OBJECT.
primaryType in class Vector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||