Package org.apache.openjpa.kernel
Class DelegatingResultList<T>
java.lang.Object
org.apache.openjpa.kernel.DelegatingResultList<T>
- All Implemented Interfaces:
Serializable
,Iterable<T>
,Collection<T>
,List<T>
,ResultList<T>
,Closeable
Delegating result list that can also perform exception translation
for use in facades.
- Since:
- 0.4.0
- Author:
- Marc Prud'hommeaux
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Delegating iterator that also performs exception translation. -
Constructor Summary
ConstructorDescriptionDelegatingResultList
(ResultList<T> list) Constructor; supply delegate.DelegatingResultList
(ResultList<T> list, RuntimeExceptionTranslator trans) Constructor; supply delegate and exception translator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends T> c) boolean
addAll
(Collection<? extends T> c) void
clear()
void
close()
Close the list.boolean
boolean
containsAll
(Collection<?> c) boolean
get
(int index) Return the direct delegate.Return the native delegate.Get the opaque user object attached to this receiver.int
hashCode()
int
boolean
isClosed()
Returns true if the list has been closed.boolean
isEmpty()
boolean
Returns true if the provider backing this list is open.iterator()
int
listIterator
(int index) remove
(int index) boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) void
setUserObject
(Object opaque) Set the opaque user object to this receiver.int
size()
subList
(int fromIndex, int toIndex) Object[]
toArray()
Object[]
toString()
protected RuntimeException
Translate the OpenJPA exception.Writes delegate, which may in turn write a normal list.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Constructor Details
-
DelegatingResultList
Constructor; supply delegate. -
DelegatingResultList
Constructor; supply delegate and exception translator.
-
-
Method Details
-
getDelegate
Return the direct delegate. -
getInnermostDelegate
Return the native delegate. -
writeReplace
Writes delegate, which may in turn write a normal list.- Throws:
ObjectStreamException
-
hashCode
public int hashCode() -
equals
-
translate
Translate the OpenJPA exception. -
isProviderOpen
public boolean isProviderOpen()Description copied from interface:ResultList
Returns true if the provider backing this list is open.- Specified by:
isProviderOpen
in interfaceResultList<T>
-
getUserObject
Description copied from interface:ResultList
Get the opaque user object attached to this receiver.- Specified by:
getUserObject
in interfaceResultList<T>
-
setUserObject
Description copied from interface:ResultList
Set the opaque user object to this receiver.- Specified by:
setUserObject
in interfaceResultList<T>
-
close
public void close()Description copied from interface:ResultList
Close the list.- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceResultList<T>
-
isClosed
public boolean isClosed()Description copied from interface:ResultList
Returns true if the list has been closed.- Specified by:
isClosed
in interfaceResultList<T>
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
-
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
subList
-
toString
-