2.17.2: 2011-06-17

net.sf.basedb.core
Class UnmodifiableResultList<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by net.sf.basedb.core.UnmodifiableResultList<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess, QueryResult, ResultList<T>

public class UnmodifiableResultList<T>
extends ArrayList<T>
implements ResultList<T>

Version:
2.0
Author:
nicklas
See Also:
Serialized Form
Last modified
$Date: 2008-09-11 22:11:02 +0200 (Thu, 11 Sep 2008) $

Field Summary
private static long serialVersionUID
           
private  long totalCount
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
UnmodifiableResultList(List<T> items, long totalCount)
           
 
Method Summary
 void add(int index, T element)
          Not supported.
 boolean add(T o)
          Not supported.
 boolean addAll(Collection<? extends T> c)
          Not supported.
 boolean addAll(int index, Collection<? extends T> c)
          Not supported.
 void clear()
          Not supported.
 boolean containsAll(Collection<?> c)
           
 long getTotalCount()
          Get the total number of items returned by the query, ignoring any limits set by Query.setFirstResult(int) and Query.setMaxResults(int).
 T remove(int index)
          Not supported.
 boolean remove(Object o)
          Not supported.
 boolean removeAll(Collection<?> c)
          Not supported.
 boolean retainAll(Collection<?> c)
          Not supported.
 T set(int index, T element)
          Not supported.
 
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
contains, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, size, subList, toArray, toArray
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

totalCount

private final long totalCount
Constructor Detail

UnmodifiableResultList

public UnmodifiableResultList(List<T> items,
                              long totalCount)
Method Detail

getTotalCount

public long getTotalCount()
Description copied from interface: QueryResult
Get the total number of items returned by the query, ignoring any limits set by Query.setFirstResult(int) and Query.setMaxResults(int). If the Query.setReturnTotalCount(boolean) hasn't been enabled this method may not return a correct value.

Specified by:
getTotalCount in interface QueryResult
Returns:
The total number of items, or -1 if not known
See Also:
Query.setReturnTotalCount(boolean)

add

public boolean add(T o)
Not supported.

Specified by:
add in interface Collection<T>
Specified by:
add in interface List<T>
Overrides:
add in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

add

public void add(int index,
                T element)
Not supported.

Specified by:
add in interface List<T>
Overrides:
add in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

addAll

public boolean addAll(Collection<? extends T> c)
Not supported.

Specified by:
addAll in interface Collection<T>
Specified by:
addAll in interface List<T>
Overrides:
addAll in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

addAll

public boolean addAll(int index,
                      Collection<? extends T> c)
Not supported.

Specified by:
addAll in interface List<T>
Overrides:
addAll in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

clear

public void clear()
Not supported.

Specified by:
clear in interface Collection<T>
Specified by:
clear in interface List<T>
Overrides:
clear in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<T>
Specified by:
containsAll in interface List<T>
Overrides:
containsAll in class AbstractCollection<T>

remove

public T remove(int index)
Not supported.

Specified by:
remove in interface List<T>
Overrides:
remove in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

remove

public boolean remove(Object o)
Not supported.

Specified by:
remove in interface Collection<T>
Specified by:
remove in interface List<T>
Overrides:
remove in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

removeAll

public boolean removeAll(Collection<?> c)
Not supported.

Specified by:
removeAll in interface Collection<T>
Specified by:
removeAll in interface List<T>
Overrides:
removeAll in class AbstractCollection<T>
Throws:
UnsupportedOperationException - Always

retainAll

public boolean retainAll(Collection<?> c)
Not supported.

Specified by:
retainAll in interface Collection<T>
Specified by:
retainAll in interface List<T>
Overrides:
retainAll in class AbstractCollection<T>
Throws:
UnsupportedOperationException - Always

set

public T set(int index,
             T element)
Not supported.

Specified by:
set in interface List<T>
Overrides:
set in class ArrayList<T>
Throws:
UnsupportedOperationException - Always

2.17.2: 2011-06-17