ELEMENTTYPE - The type of the element in the list@NotThreadSafe public class SingleElementList<ELEMENTTYPE> extends Object implements List<ELEMENTTYPE>, IHasSize
List interface handling exactly one element and
no more!| Constructor and Description |
|---|
SingleElementList() |
SingleElementList(ELEMENTTYPE aElement) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(ELEMENTTYPE aElement) |
void |
add(int nIndex,
ELEMENTTYPE aElement) |
boolean |
addAll(Collection<? extends ELEMENTTYPE> aElements) |
boolean |
addAll(int nIndex,
Collection<? extends ELEMENTTYPE> aElements) |
void |
clear() |
boolean |
contains(Object aElement) |
boolean |
containsAll(Collection<?> aElements) |
static <ELEMENTTYPE> |
create(ELEMENTTYPE aElement) |
boolean |
equals(Object o) |
ELEMENTTYPE |
get(int nIndex) |
int |
hashCode() |
int |
indexOf(Object aElement) |
boolean |
isEmpty() |
Iterator<ELEMENTTYPE> |
iterator() |
int |
lastIndexOf(Object aElement) |
ListIterator<ELEMENTTYPE> |
listIterator() |
ListIterator<ELEMENTTYPE> |
listIterator(int nIndex) |
ELEMENTTYPE |
remove(int nIndex) |
boolean |
remove(Object aElement) |
boolean |
removeAll(Collection<?> aElements) |
boolean |
retainAll(Collection<?> aElements) |
ELEMENTTYPE |
set(int nIndex,
ELEMENTTYPE aNewElement) |
int |
size() |
List<ELEMENTTYPE> |
subList(int nFromIndex,
int nToIndex) |
Object[] |
toArray() |
<ARRAYELEMENTTYPE> |
toArray(ARRAYELEMENTTYPE[] aDest) |
String |
toString() |
public SingleElementList()
public SingleElementList(@Nullable ELEMENTTYPE aElement)
public boolean add(@Nullable ELEMENTTYPE aElement)
add in interface Collection<ELEMENTTYPE>add in interface List<ELEMENTTYPE>public void add(@Nonnegative int nIndex, @Nullable ELEMENTTYPE aElement)
add in interface List<ELEMENTTYPE>public boolean addAll(@Nonnull Collection<? extends ELEMENTTYPE> aElements)
addAll in interface Collection<ELEMENTTYPE>addAll in interface List<ELEMENTTYPE>public boolean addAll(@Nonnegative int nIndex, @Nonnull Collection<? extends ELEMENTTYPE> aElements)
addAll in interface List<ELEMENTTYPE>public void clear()
clear in interface Collection<ELEMENTTYPE>clear in interface List<ELEMENTTYPE>public boolean contains(@Nullable Object aElement)
contains in interface Collection<ELEMENTTYPE>contains in interface List<ELEMENTTYPE>public boolean containsAll(@Nonnull Collection<?> aElements)
containsAll in interface Collection<ELEMENTTYPE>containsAll in interface List<ELEMENTTYPE>public ELEMENTTYPE get(@Nonnegative int nIndex)
get in interface List<ELEMENTTYPE>public int indexOf(Object aElement)
indexOf in interface List<ELEMENTTYPE>public boolean isEmpty()
isEmpty in interface IHasSizeisEmpty in interface Collection<ELEMENTTYPE>isEmpty in interface List<ELEMENTTYPE>true if no items are present, false if at
least a single item is present.IHasSize.size()@Nonnull public Iterator<ELEMENTTYPE> iterator()
iterator in interface Iterable<ELEMENTTYPE>iterator in interface Collection<ELEMENTTYPE>iterator in interface List<ELEMENTTYPE>public int lastIndexOf(@Nullable Object aElement)
lastIndexOf in interface List<ELEMENTTYPE>@Nonnull public ListIterator<ELEMENTTYPE> listIterator()
listIterator in interface List<ELEMENTTYPE>@Nonnull public ListIterator<ELEMENTTYPE> listIterator(int nIndex)
listIterator in interface List<ELEMENTTYPE>@Nullable public ELEMENTTYPE remove(int nIndex)
remove in interface List<ELEMENTTYPE>public boolean remove(@Nullable Object aElement)
remove in interface Collection<ELEMENTTYPE>remove in interface List<ELEMENTTYPE>public boolean removeAll(@Nullable Collection<?> aElements)
removeAll in interface Collection<ELEMENTTYPE>removeAll in interface List<ELEMENTTYPE>@UnsupportedOperation public boolean retainAll(@Nonnull Collection<?> aElements)
retainAll in interface Collection<ELEMENTTYPE>retainAll in interface List<ELEMENTTYPE>@Nullable public ELEMENTTYPE set(@Nonnegative int nIndex, @Nullable ELEMENTTYPE aNewElement)
set in interface List<ELEMENTTYPE>@Nonnegative public int size()
size in interface IHasSizesize in interface Collection<ELEMENTTYPE>size in interface List<ELEMENTTYPE>@Nonnull public List<ELEMENTTYPE> subList(int nFromIndex, int nToIndex)
subList in interface List<ELEMENTTYPE>@Nonnull public Object[] toArray()
toArray in interface Collection<ELEMENTTYPE>toArray in interface List<ELEMENTTYPE>@Nonnull public <ARRAYELEMENTTYPE> ARRAYELEMENTTYPE[] toArray(@Nonnull ARRAYELEMENTTYPE[] aDest)
toArray in interface Collection<ELEMENTTYPE>toArray in interface List<ELEMENTTYPE>public boolean equals(Object o)
equals in interface Collection<ELEMENTTYPE>equals in interface List<ELEMENTTYPE>equals in class Objectpublic int hashCode()
hashCode in interface Collection<ELEMENTTYPE>hashCode in interface List<ELEMENTTYPE>hashCode in class Object@Nonnull public static <ELEMENTTYPE> SingleElementList<ELEMENTTYPE> create(@Nullable ELEMENTTYPE aElement)
Copyright © 2006–2015 phloc systems. All rights reserved.