Class ListSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.vaadin.data.util.ListSet<E>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess
public class ListSet<E>- extends ArrayList<E>
ListSet is an internal Vaadin class which implements a combination of a List
and a Set. The main purpose of this class is to provide a list with a fast
contains(Object)
method. Each inserted object must by unique (as
specified by AbstractList.equals(Object)
). The set(int, Object)
method
allows duplicates because of the way Collections.sort(java.util.List)
works.
This class is subject to change and should not be used outside Vaadin core.
See Also:
Serialized Form
ListSet
public ListSet()
ListSet
public ListSet(Collection<? extends E> c)
ListSet
public ListSet(int initialCapacity)
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection<E>
- Specified by:
contains
in interface List<E>
- Overrides:
contains
in class ArrayList<E>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interface Collection<E>
- Specified by:
containsAll
in interface List<E>
- Overrides:
containsAll
in class AbstractCollection<E>
add
public boolean add(E e)
- Specified by:
add
in interface Collection<E>
- Specified by:
add
in interface List<E>
- Overrides:
add
in class ArrayList<E>
add
public void add(int index,
E element)
Works as java.util.ArrayList#add(int, java.lang.Object) but returns
immediately if the element is already in the ListSet.
- Specified by:
add
in interface List<E>
- Overrides:
add
in class ArrayList<E>
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll
in interface Collection<E>
- Specified by:
addAll
in interface List<E>
- Overrides:
addAll
in class ArrayList<E>
addAll
public boolean addAll(int index,
Collection<? extends E> c)
- Specified by:
addAll
in interface List<E>
- Overrides:
addAll
in class ArrayList<E>
clear
public void clear()
- Specified by:
clear
in interface Collection<E>
- Specified by:
clear
in interface List<E>
- Overrides:
clear
in class ArrayList<E>
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interface List<E>
- Overrides:
indexOf
in class ArrayList<E>
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interface List<E>
- Overrides:
lastIndexOf
in class ArrayList<E>
remove
public E remove(int index)
- Specified by:
remove
in interface List<E>
- Overrides:
remove
in class ArrayList<E>
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection<E>
- Specified by:
remove
in interface List<E>
- Overrides:
remove
in class ArrayList<E>
removeRange
protected void removeRange(int fromIndex,
int toIndex)
- Overrides:
removeRange
in class ArrayList<E>
set
public E set(int index,
E element)
- Specified by:
set
in interface List<E>
- Overrides:
set
in class ArrayList<E>
clone
public Object clone()
- Overrides:
clone
in class ArrayList<E>