Package org.apache.openjpa.kernel
Class DelegatingResultList<T>
- java.lang.Object
-
- org.apache.openjpa.kernel.DelegatingResultList<T>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.List<T>
,ResultList<T>
,Closeable
public class DelegatingResultList<T> extends java.lang.Object implements ResultList<T>
Delegating result list that can also perform exception translation for use in facades.- Since:
- 0.4.0
- Author:
- Marc Prud'hommeaux
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DelegatingResultList.DelegatingListIterator<T>
Delegating iterator that also performs exception translation.
-
Constructor Summary
Constructors Constructor Description DelegatingResultList(ResultList<T> list)
Constructor; supply delegate.DelegatingResultList(ResultList<T> list, RuntimeExceptionTranslator trans)
Constructor; supply delegate and exception translator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T element)
boolean
add(T o)
boolean
addAll(int index, java.util.Collection<? extends T> c)
boolean
addAll(java.util.Collection<? extends T> c)
void
clear()
void
close()
Close the list.boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object other)
T
get(int index)
ResultList<T>
getDelegate()
Return the direct delegate.ResultList<T>
getInnermostDelegate()
Return the native delegate.java.lang.Object
getUserObject()
Get the opaque user object attached to this receiver.int
hashCode()
int
indexOf(java.lang.Object o)
boolean
isClosed()
Returns true if the list has been closed.boolean
isEmpty()
boolean
isProviderOpen()
Returns true if the provider backing this list is open.java.util.Iterator<T>
iterator()
int
lastIndexOf(java.lang.Object o)
java.util.ListIterator<T>
listIterator()
java.util.ListIterator<T>
listIterator(int index)
T
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
T
set(int index, T element)
void
setUserObject(java.lang.Object opaque)
Set the opaque user object to this receiver.int
size()
java.util.List<T>
subList(int fromIndex, int toIndex)
java.lang.Object[]
toArray()
java.lang.Object[]
toArray(java.lang.Object[] a)
java.lang.String
toString()
protected java.lang.RuntimeException
translate(java.lang.RuntimeException re)
Translate the OpenJPA exception.java.lang.Object
writeReplace()
Writes delegate, which may in turn write a normal list.
-
-
-
Constructor Detail
-
DelegatingResultList
public DelegatingResultList(ResultList<T> list)
Constructor; supply delegate.
-
DelegatingResultList
public DelegatingResultList(ResultList<T> list, RuntimeExceptionTranslator trans)
Constructor; supply delegate and exception translator.
-
-
Method Detail
-
getDelegate
public ResultList<T> getDelegate()
Return the direct delegate.
-
getInnermostDelegate
public ResultList<T> getInnermostDelegate()
Return the native delegate.
-
writeReplace
public java.lang.Object writeReplace() throws java.io.ObjectStreamException
Writes delegate, which may in turn write a normal list.- Throws:
java.io.ObjectStreamException
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object other)
-
translate
protected java.lang.RuntimeException translate(java.lang.RuntimeException re)
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
public java.lang.Object getUserObject()
Description copied from interface:ResultList
Get the opaque user object attached to this receiver.- Specified by:
getUserObject
in interfaceResultList<T>
-
setUserObject
public void setUserObject(java.lang.Object opaque)
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
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<T> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
-
add
public boolean add(T o)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends T> c)
- Specified by:
addAll
in interfacejava.util.List<T>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
clear
public void clear()
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOf
in interfacejava.util.List<T>
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOf
in interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<T>
-
subList
public java.util.List<T> subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfacejava.util.List<T>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-