|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScalarArray
This interface lets you implement your own data structure behind a scalar array.
To instantiate a custom scalar array:
Scalar temp = SleepUtils.getArrayScalar(new MyScalarArray());
When implementing the following interface, keep in mind you are implementing an interface to an array data structure.
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 start,
int end)
return a view into the array, ideally one that uses the same backing store |
Method Detail |
---|
Scalar pop()
Scalar push(Scalar value)
int size()
Scalar getAt(int index)
java.util.Iterator scalarIterator()
Scalar add(Scalar value, int index)
void remove(Scalar value)
Scalar remove(int index)
void sort(java.util.Comparator compare)
ScalarArray sublist(int start, int end)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |