T - a NamedObject type.public class UniqueList<T extends NamedObject> extends AbstractList<T> implements List<T>
add or
set, then an IllegalArgumentException is thrown.modCount| Constructor and Description |
|---|
UniqueList()
Creates the list
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
T |
get(int index) |
T |
getByName(String name) |
Set<String> |
nameSet() |
T |
remove(int index) |
boolean |
remove(Object o) |
T |
removeByName(String name) |
T |
set(int index,
T element) |
int |
size() |
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListaddAll, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streampublic void add(int index,
T element)
add in interface List<T extends NamedObject>add in class AbstractList<T extends NamedObject>public T get(int index)
get in interface List<T extends NamedObject>get in class AbstractList<T extends NamedObject>public T getByName(String name)
name - the namepublic T remove(int index)
remove in interface List<T extends NamedObject>remove in class AbstractList<T extends NamedObject>public boolean remove(Object o)
remove in interface Collection<T extends NamedObject>remove in interface List<T extends NamedObject>remove in class AbstractCollection<T extends NamedObject>public T removeByName(String name)
name - the name of the element to removepublic T set(int index, T element)
set in interface List<T extends NamedObject>set in class AbstractList<T extends NamedObject>public int size()
size in interface Collection<T extends NamedObject>size in interface List<T extends NamedObject>size in class AbstractCollection<T extends NamedObject>Copyright © 2016–2021. All rights reserved.