|
|||||||||
| 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<T>
org.geworkbench.bison.datastructure.complex.panels.CSItemList<T>
public class CSItemList<T extends DSNamed>
A default DSItemList implementation that is backed by an ArrayList and a HashMap.
| Field Summary | |
|---|---|
protected java.util.Hashtable<java.lang.String,T> |
objectMap
|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
CSItemList()
|
|
| Method Summary | |
|---|---|
void |
add(int index,
T item)
Inserts the item at the specified index. |
boolean |
add(T item)
Adds a new item to the item list, if it does not already exist. |
boolean |
addAll(java.util.Collection<? extends T> ts)
|
void |
clear()
Clears the contents of this item list. |
boolean |
equals(java.lang.Object o)
|
T |
get(java.lang.String label)
Gets an item by label, using the HashMap. |
T |
get(T item)
Gets an item by item template. |
java.lang.String |
getID()
Gets the ID for this object. |
int |
hashCode()
|
boolean |
remove(java.lang.Object item)
Removes the object from the item list. |
void |
rename(T t,
java.lang.String label)
Renames the given named item. |
void |
setID(java.lang.String id)
Sets the ID for this object. |
| Methods inherited from class java.util.ArrayList |
|---|
addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
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 |
|---|
addAll, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
| Field Detail |
|---|
protected java.util.Hashtable<java.lang.String,T extends DSNamed> objectMap
| Constructor Detail |
|---|
public CSItemList()
| Method Detail |
|---|
public T get(java.lang.String label)
get in interface DSItemList<T extends DSNamed>label - the label of the item.
null if not found.public boolean add(T item)
add in interface java.util.Collection<T extends DSNamed>add in interface java.util.List<T extends DSNamed>add in class java.util.ArrayList<T extends DSNamed>item - the item to add.
true always.public boolean addAll(java.util.Collection<? extends T> ts)
addAll in interface java.util.Collection<T extends DSNamed>addAll in interface java.util.List<T extends DSNamed>addAll in class java.util.ArrayList<T extends DSNamed>
public void add(int index,
T item)
add in interface java.util.List<T extends DSNamed>add in class java.util.ArrayList<T extends DSNamed>index - the index at which to insert the item.item - the item to insert.public T get(T item)
DSNamed.getLabel() method
is called.
get in interface DSItemList<T extends DSNamed>item - the template item.
null if it was not found.public boolean remove(java.lang.Object item)
remove in interface java.util.Collection<T extends DSNamed>remove in interface java.util.List<T extends DSNamed>remove in class java.util.ArrayList<T extends DSNamed>item - the item to remove
true if the item was found and removed, false if it was not found.public java.lang.String getID()
getID in interface DSIdentifiablepublic void setID(java.lang.String id)
setID in interface DSIdentifiableid - the new id for this item list.public void clear()
clear in interface java.util.Collection<T extends DSNamed>clear in interface java.util.List<T extends DSNamed>clear in class java.util.ArrayList<T extends DSNamed>
public void rename(T t,
java.lang.String label)
DSItemList
rename in interface DSItemList<T extends DSNamed>t - item to be renamed (but has not yet been renamed). Must be a member of the list.label - new name for item.public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<T extends DSNamed>equals in interface java.util.List<T extends DSNamed>equals in class java.util.AbstractList<T extends DSNamed>public int hashCode()
hashCode in interface java.util.Collection<T extends DSNamed>hashCode in interface java.util.List<T extends DSNamed>hashCode in class java.util.AbstractList<T extends DSNamed>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||