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 classDelegatingResultList.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 voidadd(int index, T element)booleanadd(T o)booleanaddAll(int index, java.util.Collection<? extends T> c)booleanaddAll(java.util.Collection<? extends T> c)voidclear()voidclose()Close the list.booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object other)Tget(int index)ResultList<T>getDelegate()Return the direct delegate.ResultList<T>getInnermostDelegate()Return the native delegate.java.lang.ObjectgetUserObject()Get the opaque user object attached to this receiver.inthashCode()intindexOf(java.lang.Object o)booleanisClosed()Returns true if the list has been closed.booleanisEmpty()booleanisProviderOpen()Returns true if the provider backing this list is open.java.util.Iterator<T>iterator()intlastIndexOf(java.lang.Object o)java.util.ListIterator<T>listIterator()java.util.ListIterator<T>listIterator(int index)Tremove(int index)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)Tset(int index, T element)voidsetUserObject(java.lang.Object opaque)Set the opaque user object to this receiver.intsize()java.util.List<T>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()java.lang.Object[]toArray(java.lang.Object[] a)java.lang.StringtoString()protected java.lang.RuntimeExceptiontranslate(java.lang.RuntimeException re)Translate the OpenJPA exception.java.lang.ObjectwriteReplace()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.ObjectStreamExceptionWrites 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:ResultListReturns true if the provider backing this list is open.- Specified by:
isProviderOpenin interfaceResultList<T>
-
getUserObject
public java.lang.Object getUserObject()
Description copied from interface:ResultListGet the opaque user object attached to this receiver.- Specified by:
getUserObjectin interfaceResultList<T>
-
setUserObject
public void setUserObject(java.lang.Object opaque)
Description copied from interface:ResultListSet the opaque user object to this receiver.- Specified by:
setUserObjectin interfaceResultList<T>
-
close
public void close()
Description copied from interface:ResultListClose the list.- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceResultList<T>
-
isClosed
public boolean isClosed()
Description copied from interface:ResultListReturns true if the list has been closed.- Specified by:
isClosedin 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:
addAllin 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:
indexOfin interfacejava.util.List<T>
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator()
- Specified by:
listIteratorin interfacejava.util.List<T>
-
listIterator
public java.util.ListIterator<T> listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List<T>
-
subList
public java.util.List<T> subList(int fromIndex, int toIndex)
- Specified by:
subListin interfacejava.util.List<T>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-