|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
org.processmining.plugins.declareminer.visualizing.BaseCollection<E>
public class BaseCollection<E extends Base>
This class is used to store objects that extends class Base, i.e., objects with Integer identification. Each element of the collection has to have a unique ID. On the one hand, this class extends ArrayList, which enables maintaining the order in which elements were added to the collection. On the other hand, this class stores all its elements in a HashMap, which makes sure all elements have unique IDs and enables quick retrieval of objects based on their IDs.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
BaseCollection()
This constructor initiates the ArrayList and the HashMap map. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.util.ArrayList |
---|
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public BaseCollection()
Method Detail |
---|
public boolean add(E e)
add
in interface java.util.Collection<E extends Base>
add
in interface java.util.List<E extends Base>
add
in class java.util.ArrayList<E extends Base>
e
- is the element to be addedpublic 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |