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:
Serializable,Iterable<E>,Collection<E>,List<E>
public class DistinctResultList<E> extends Object implements List<E>, Serializable
An 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, Collection<? extends E> c)booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)Eget(int index)intindexOf(Object o)booleanisEmpty()Iterator<E>iterator()intlastIndexOf(Object o)ListIterator<E>listIterator()ListIterator<E>listIterator(int index)Eremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)Eset(int index, E element)intsize()List<E>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] a)protected RuntimeExceptiontranslate(RuntimeException re)ObjectwriteReplace()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
-
-
-
-
Constructor Detail
-
DistinctResultList
public DistinctResultList(ResultList<E> list, RuntimeExceptionTranslator trans)
-
-
Method Detail
-
add
public boolean add(E o)
-
addAll
public boolean addAll(Collection<? extends E> c)
-
addAll
public boolean addAll(int index, Collection<? extends E> c)
-
clear
public void clear()
-
contains
public boolean contains(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>
-
isEmpty
public boolean isEmpty()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<E>
-
listIterator
public ListIterator<E> listIterator()
- Specified by:
listIteratorin interfaceList<E>
-
listIterator
public ListIterator<E> listIterator(int index)
- Specified by:
listIteratorin interfaceList<E>
-
remove
public boolean remove(Object o)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
size
public int size()
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
translate
protected RuntimeException translate(RuntimeException re)
-
writeReplace
public Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
-