public class NamedList<E extends NamedInterface>
extends java.lang.Object
Constructor and Description |
---|
NamedList()
Creates a new empty NamedList
|
Modifier and Type | Method and Description |
---|---|
void |
add(E element)
adds the element if it does not exist yet, else throws an exception
|
boolean |
addIfNew(E element)
This method adds the element if it does not exist yet.
|
java.lang.String |
dropNameList() |
E |
get(int index) |
java.util.List<E> |
getFullList() |
int |
getSize() |
E |
lookupOnName(java.lang.String name) |
void |
mergeWithNamedList(NamedList<E> otherlist)
Merges two lists.
|
void |
mergeWithNamedListIfNotExist(NamedList<E> otherlist)
Merges with the current list, while removing duplicates.
|
<D extends Named> |
OneEltList(D singleelt)
generates in one line a one element list.
|
public java.util.List<E> getFullList()
public java.lang.String dropNameList()
public E lookupOnName(java.lang.String name)
name
- name to look at. The name should be the cleaned versionpublic int getSize()
public E get(int index)
index
- the index in the list, from 0 (included) to the list size
(excluded)public boolean addIfNew(E element)
element
- public void add(E element)
element
- the element to addpublic void mergeWithNamedList(NamedList<E> otherlist)
otherlist
- the list to merge with this onepublic void mergeWithNamedListIfNotExist(NamedList<E> otherlist)
otherlist
- the list to merge with this one