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