|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsleep.runtime.CollectionWrapper
public class CollectionWrapper
A read only scalar array for wrapping data structures that implement the java.util.Collection interface. Values will be marshalled into Sleep scalars when accessed.
Field Summary | |
---|---|
protected java.lang.Object[] |
array
|
protected java.util.Collection |
values
|
Constructor Summary | |
---|---|
CollectionWrapper(java.util.Collection _values)
|
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 value)
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 begin,
int end)
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.Collection values
protected java.lang.Object[] array
Constructor Detail |
---|
public CollectionWrapper(java.util.Collection _values)
Method Detail |
---|
public ScalarArray sublist(int begin, int end)
ScalarArray
sublist
in interface ScalarArray
public java.lang.String toString()
toString
in class java.lang.Object
public Scalar pop()
ScalarArray
pop
in interface ScalarArray
public void sort(java.util.Comparator compare)
ScalarArray
sort
in interface ScalarArray
public Scalar push(Scalar value)
ScalarArray
push
in interface ScalarArray
public int size()
ScalarArray
size
in interface ScalarArray
public Scalar remove(int index)
ScalarArray
remove
in interface ScalarArray
public Scalar getAt(int index)
ScalarArray
getAt
in interface ScalarArray
public java.util.Iterator scalarIterator()
ScalarArray
scalarIterator
in interface ScalarArray
public Scalar add(Scalar value, int index)
ScalarArray
add
in interface ScalarArray
public void remove(Scalar value)
ScalarArray
remove
in interface ScalarArray
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |