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 void
add(int index, E element)
boolean
add(E o)
boolean
addAll(int index, Collection<? extends E> c)
boolean
addAll(Collection<? extends E> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
E
get(int index)
int
indexOf(Object o)
boolean
isEmpty()
Iterator<E>
iterator()
int
lastIndexOf(Object o)
ListIterator<E>
listIterator()
ListIterator<E>
listIterator(int index)
E
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
E
set(int index, E element)
int
size()
List<E>
subList(int fromIndex, int toIndex)
Object[]
toArray()
<T> T[]
toArray(T[] a)
protected RuntimeException
translate(RuntimeException re)
Object
writeReplace()
-
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:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceList<E>
-
isEmpty
public boolean isEmpty()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<E>
-
listIterator
public ListIterator<E> listIterator()
- Specified by:
listIterator
in interfaceList<E>
-
listIterator
public ListIterator<E> listIterator(int index)
- Specified by:
listIterator
in 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
-
-