|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IntegerCollection
This interface represents an abstract collection of integer values.
Method Summary | |
---|---|
int |
add(int value)
Add a value to the collection. |
void |
add(int[] array)
Add the values of an array. |
void |
add(IntegerCollection collection)
Add the values of an other integer collection. |
void |
clear()
Removes all values from this collection. |
boolean |
contains(int value)
If the collection contains a value |
int |
get(int index)
Return a value from this collection. |
int |
getCount()
Returns the count of values in this collection. |
int |
indexOf(int value)
Return the index of a value, otherwise -1. |
boolean |
isEmpty()
If this collection contains no values |
int |
peek()
Peek a value of the end of this collection. |
int |
pop()
Pops a value of the end of this collection. |
void |
push(int value)
Pushs a value on top to this collection. |
void |
push(int[] values)
Push values from an array on top on this collection. |
void |
remove(int index)
Removes a value giving by an index. |
void |
removeValue(int value)
Removes a value from this collection. |
void |
set(int index,
int value)
Replace a value, given by an index. |
void |
swap(int index1,
int index2)
Swaps two values from this collection. |
java.lang.String |
toString()
Return a string representation of the collection. |
Method Detail |
---|
int add(int value)
value
- Integer value.
void add(IntegerCollection collection)
collection
- Collection of integer values.void add(int[] array)
array
- Array of integer values.void remove(int index)
index
- Index of the integer value.void set(int index, int value)
index
- Index of the value, which should be replaced.value
- The new value.int get(int index)
index
- Index of the value.
int getCount()
int indexOf(int value)
value
- Value, which should found in this collection.
boolean contains(int value)
value
- Value, which should found in this collection.
void removeValue(int value)
value
- Value to remove.boolean isEmpty()
int pop()
void push(int value)
value
- Value, which should be added.void push(int[] values)
values
- Array of integer values.int peek()
void clear()
void swap(int index1, int index2)
index1
- Index from the first value.index2
- Index from the second value.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 |