com.vaadin.data.util
Class ListSet<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<E>
              extended by com.vaadin.data.util.ListSet<E>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess

public class ListSet<E>
extends java.util.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

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ListSet()
           
ListSet(java.util.Collection<? extends E> c)
           
ListSet(int initialCapacity)
           
 
Method Summary
 boolean add(E e)
           
 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.
 boolean addAll(java.util.Collection<? extends E> c)
           
 boolean addAll(int index, java.util.Collection<? extends E> c)
           
 void clear()
           
 java.lang.Object clone()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
 int indexOf(java.lang.Object o)
           
 int lastIndexOf(java.lang.Object o)
           
 E remove(int index)
           
 boolean remove(java.lang.Object o)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 E set(int index, E element)
           
 
Methods inherited from class java.util.ArrayList
ensureCapacity, get, isEmpty, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

ListSet

public ListSet()

ListSet

public ListSet(java.util.Collection<? extends E> c)

ListSet

public ListSet(int initialCapacity)
Method Detail

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<E>
Specified by:
contains in interface java.util.List<E>
Overrides:
contains in class java.util.ArrayList<E>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<E>
Specified by:
containsAll in interface java.util.List<E>
Overrides:
containsAll in class java.util.AbstractCollection<E>

add

public boolean add(E e)
Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.List<E>
Overrides:
add in class java.util.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 java.util.List<E>
Overrides:
add in class java.util.ArrayList<E>

addAll

public boolean addAll(java.util.Collection<? extends E> c)
Specified by:
addAll in interface java.util.Collection<E>
Specified by:
addAll in interface java.util.List<E>
Overrides:
addAll in class java.util.ArrayList<E>

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends E> c)
Specified by:
addAll in interface java.util.List<E>
Overrides:
addAll in class java.util.ArrayList<E>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<E>
Specified by:
clear in interface java.util.List<E>
Overrides:
clear in class java.util.ArrayList<E>

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List<E>
Overrides:
indexOf in class java.util.ArrayList<E>

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List<E>
Overrides:
lastIndexOf in class java.util.ArrayList<E>

remove

public E remove(int index)
Specified by:
remove in interface java.util.List<E>
Overrides:
remove in class java.util.ArrayList<E>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<E>
Specified by:
remove in interface java.util.List<E>
Overrides:
remove in class java.util.ArrayList<E>

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Overrides:
removeRange in class java.util.ArrayList<E>

set

public E set(int index,
             E element)
Specified by:
set in interface java.util.List<E>
Overrides:
set in class java.util.ArrayList<E>

clone

public java.lang.Object clone()
Overrides:
clone in class java.util.ArrayList<E>


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.