public class BaseCollection<E extends Base>
extends java.util.ArrayList<E>
Constructor and Description |
---|
BaseCollection()
This constructor initiates the ArrayList and the HashMap map.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
Adds the new element to the collection.
|
E |
getItemWithId(int id)
Returns the element with given ID.
|
int |
nextId()
Returns the ID that should be assigned to the next element in order to be
successfully added to the collection.
|
void |
remove(E e)
Removes one element from the collection.
|
add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public BaseCollection()
public boolean add(E e)
public void remove(E e)
e
- is the element to be removedpublic int nextId()
public E getItemWithId(int id)
id
- of the element to be returned.