E
- element typepublic class SavotSet<E>
extends java.lang.Object
Generic class for other set classes
SavotSet
Constructor and Description |
---|
SavotSet()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(E item)
Add an item to the set
|
void |
ensureCapacity(int minCapacity)
Increases the capacity of this SavotSet instance, if
necessary, to ensure that it can hold at least the number of elements
specified by the minimum capacity argument.
|
E |
getItemAt(int index)
Get an item at a given position (index)
|
int |
getItemCount()
Get the number of items
|
java.util.List<E> |
getItems()
Get the whole set
|
void |
removeAllItems()
Remove all items
|
void |
removeItemAt(int index)
Remove an item at a given position (index)
|
void |
setItems(java.util.ArrayList<E> set)
Set the whole set to a given set
|
void |
trim()
Trims the capacity of this SavotSet instance to be the
list's current size.
|
public final void addItem(E item)
item
- public final E getItemAt(int index)
index
- public final void removeItemAt(int index)
index
- public final void removeAllItems()
public final void setItems(java.util.ArrayList<E> set)
set
- public final java.util.List<E> getItems()
public final int getItemCount()
public final void ensureCapacity(int minCapacity)
minCapacity
- the desired minimum capacitypublic final void trim()