|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsleep.engine.types.ListContainer
public class ListContainer
A linked list backing for Sleep Arrays. Most array ops are better off with this type of backing
| Field Summary | |
|---|---|
protected java.util.List |
values
|
| Constructor Summary | |
|---|---|
ListContainer()
|
|
ListContainer(java.util.Collection initialValues)
initial values must be a collection of Scalar's |
|
ListContainer(java.util.List list)
|
|
| Method Summary | |
|---|---|
Scalar |
add(Scalar value,
int index)
add an element to the array at the specified index |
Scalar |
getAt(int index)
get an element at the specified index |
Scalar |
pop()
remove the topmost element from the array |
Scalar |
push(Scalar value)
add an element onto the end of the array |
Scalar |
remove(int index)
remove an element at the specified index |
void |
remove(Scalar key)
remove all elements with the same identity as the specified scalar |
java.util.Iterator |
scalarIterator()
return an iterator |
int |
size()
return the size of the array |
void |
sort(java.util.Comparator compare)
sort this array with the specified comparator |
ScalarArray |
sublist(int from,
int to)
return a view into the array, ideally one that uses the same backing store |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List values
| Constructor Detail |
|---|
public ListContainer()
public ListContainer(java.util.List list)
public ListContainer(java.util.Collection initialValues)
| Method Detail |
|---|
public ScalarArray sublist(int from,
int to)
ScalarArray
sublist in interface ScalarArraypublic Scalar pop()
ScalarArray
pop in interface ScalarArraypublic Scalar push(Scalar value)
ScalarArray
push in interface ScalarArraypublic int size()
ScalarArray
size in interface ScalarArraypublic void sort(java.util.Comparator compare)
ScalarArray
sort in interface ScalarArraypublic Scalar getAt(int index)
ScalarArray
getAt in interface ScalarArraypublic void remove(Scalar key)
ScalarArray
remove in interface ScalarArraypublic Scalar remove(int index)
ScalarArray
remove in interface ScalarArraypublic java.util.Iterator scalarIterator()
ScalarArray
scalarIterator in interface ScalarArray
public Scalar add(Scalar value,
int index)
ScalarArray
add in interface ScalarArraypublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||