Package org.apache.openjpa.kernel
Class DistinctResultList<E>
- java.lang.Object
-
- org.apache.openjpa.kernel.DistinctResultList<E>
-
- Type Parameters:
E- element type
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>
public class DistinctResultList<E> extends java.lang.Object implements java.util.List<E>, java.io.SerializableAn immutable list that imposes uniqueness on its member. This implementation traverses the entire result list on construction. So it is not suitable or efficient for large results. All mutation operations (except clear()) throwUnsupportedOperationException.- Since:
- 2.0.0
- Author:
- Pinaki Poddar
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DistinctResultList(ResultList<E> list, RuntimeExceptionTranslator trans)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, E element)booleanadd(E o)booleanaddAll(int index, java.util.Collection<? extends E> c)booleanaddAll(java.util.Collection<? extends E> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)Eget(int index)intindexOf(java.lang.Object o)booleanisEmpty()java.util.Iterator<E>iterator()intlastIndexOf(java.lang.Object o)java.util.ListIterator<E>listIterator()java.util.ListIterator<E>listIterator(int index)Eremove(int index)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)Eset(int index, E element)intsize()java.util.List<E>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] a)protected java.lang.RuntimeExceptiontranslate(java.lang.RuntimeException re)java.lang.ObjectwriteReplace()
-
-
-
Constructor Detail
-
DistinctResultList
public DistinctResultList(ResultList<E> list, RuntimeExceptionTranslator trans)
-
-
Method Detail
-
add
public boolean add(E o)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends E> c)- Specified by:
addAllin interfacejava.util.List<E>
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOfin interfacejava.util.List<E>
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<E> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<E>
-
listIterator
public java.util.ListIterator<E> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<E>
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
size
public int size()
-
subList
public java.util.List<E> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<E>
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
translate
protected java.lang.RuntimeException translate(java.lang.RuntimeException re)
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamException- Throws:
java.io.ObjectStreamException
-
-