|
|||||||||
| 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 ScalarArraypublic java.lang.String toString()
toString in class java.lang.Objectpublic Scalar pop()
ScalarArray
pop in interface ScalarArraypublic void sort(java.util.Comparator compare)
ScalarArray
sort in interface ScalarArraypublic Scalar push(Scalar value)
ScalarArray
push in interface ScalarArraypublic int size()
ScalarArray
size in interface ScalarArraypublic Scalar remove(int index)
ScalarArray
remove in interface ScalarArraypublic Scalar getAt(int index)
ScalarArray
getAt in interface ScalarArraypublic java.util.Iterator scalarIterator()
ScalarArray
scalarIterator in interface ScalarArray
public Scalar add(Scalar value,
int index)
ScalarArray
add in interface ScalarArraypublic 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 | ||||||||