public abstract class CollectionBase
Constructor Summary |
---|
CollectionBase()
Initializes a new instance of the CollectionBase class with the default initial capacity. |
CollectionBase(intcapacity)
Initializes a new instance of the CollectionBase class with the specified capacity. |
Method Summary | ||
---|---|---|
int | add(java.lang.Object o) | |
Adds an item to the CollectionBase instance.
|
||
void | clear() | |
Removes all objects from the CollectionBase instance.
|
||
boolean | contains(java.lang.Object o) | |
Return whether instance contains this object
|
||
java.lang.Object | get(int index) | |
Get an item at specified position.
|
||
int | getCount() | |
Gets the number of elements contained in the CollectionBase instance.
|
||
int | indexOf(java.lang.Object o) | |
Determines the index of a specific item in the CollectionBase instance.
|
||
java.util.Iterator | iterator() | |
Returns an enumerator that iterates through the CollectionBase instance.
|
||
void | removeAt(int index) | |
Removes the item at the specified index.
|
public CollectionBase()
public CollectionBase(int capacity)
capacity
- The number of elements that the new list can initially store.public java.util.Iterator iterator()
public int getCount()
public void clear()
public int add(java.lang.Object o)
o
- The Object to add to the CollectionBase instance.public java.lang.Object get(int index)
index
- Specified position index.public boolean contains(java.lang.Object o)
o
- test objectpublic void removeAt(int index)
index
- The zero-based index of the item to remove.public int indexOf(java.lang.Object o)
o
- Determines the index of a specific item in the CollectionBase instance.