Package com.vaadin.featurepack.data.util
Class ListSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.vaadin.featurepack.data.util.ListSet<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>,RandomAccess,SequencedCollection<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 ArrayList.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:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidWorks as java.util.ArrayList#add(int, java.lang.Object) but returns immediately if the element is already in the ListSet.booleanbooleanaddAll(int index, Collection<? extends E> c) booleanaddAll(Collection<? extends E> c) voidclear()clone()booleanbooleancontainsAll(Collection<?> c) intintremove(int index) booleanprotected voidremoveRange(int fromIndex, int toIndex) Methods inherited from class java.util.ArrayList
addFirst, addLast, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, isEmpty, iterator, listIterator, listIterator, removeAll, removeFirst, removeIf, removeLast, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Constructor Details
-
ListSet
public ListSet() -
ListSet
-
ListSet
public ListSet(int initialCapacity)
-
-
Method Details
-
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>- Overrides:
containsAllin classAbstractCollection<E>
-
add
-
add
Works as java.util.ArrayList#add(int, java.lang.Object) but returns immediately if the element is already in the ListSet. -
addAll
-
addAll
-
clear
public void clear() -
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>- Overrides:
lastIndexOfin classArrayList<E>
-
remove
-
remove
-
removeRange
protected void removeRange(int fromIndex, int toIndex) - Overrides:
removeRangein classArrayList<E>
-
set
-
clone
-