2.17.2: 2011-06-17

net.sf.basedb.core
Class AbstractResultList<I>

java.lang.Object
  extended by net.sf.basedb.core.AbstractResultList<I>
All Implemented Interfaces:
Iterable<I>, Collection<I>, List<I>, QueryResult, ResultList<I>
Direct Known Subclasses:
ItemResultList

abstract class AbstractResultList<I>
extends Object
implements ResultList<I>

This is a list of the result from a query. Objects returned from this list are of a type derived from BasicItem. This class implements all operations in the List interface that modifies the list. The implementation simply throws an UnsupportedOperationException

Version:
2.0
Author:
Samuel, Nicklas
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Field Summary
private  long totalCount
           
 
Constructor Summary
AbstractResultList(long totalCount)
           
 
Method Summary
 boolean add(I o)
          Not supported.
 void add(int index, I element)
          Not supported.
 boolean addAll(Collection<? extends I> c)
          Not supported.
 boolean addAll(int index, Collection<? extends I> 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).
 I remove(int index)
          Not supported.
 boolean remove(Object o)
          Not supported.
 boolean removeAll(Collection<?> c)
          Not supported.
 boolean retainAll(Collection<?> c)
          Not supported.
 I set(int index, I element)
          Not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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

totalCount

private final long totalCount
Constructor Detail

AbstractResultList

AbstractResultList(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(I o)
Not supported.

Specified by:
add in interface Collection<I>
Specified by:
add in interface List<I>
Throws:
UnsupportedOperationException - Always

add

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

Specified by:
add in interface List<I>
Throws:
UnsupportedOperationException - Always

addAll

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

Specified by:
addAll in interface Collection<I>
Specified by:
addAll in interface List<I>
Throws:
UnsupportedOperationException - Always

addAll

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

Specified by:
addAll in interface List<I>
Throws:
UnsupportedOperationException - Always

clear

public void clear()
Not supported.

Specified by:
clear in interface Collection<I>
Specified by:
clear in interface List<I>
Throws:
UnsupportedOperationException - Always

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<I>
Specified by:
containsAll in interface List<I>

remove

public I remove(int index)
Not supported.

Specified by:
remove in interface List<I>
Throws:
UnsupportedOperationException - Always

remove

public boolean remove(Object o)
Not supported.

Specified by:
remove in interface Collection<I>
Specified by:
remove in interface List<I>
Throws:
UnsupportedOperationException - Always

removeAll

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

Specified by:
removeAll in interface Collection<I>
Specified by:
removeAll in interface List<I>
Throws:
UnsupportedOperationException - Always

retainAll

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

Specified by:
retainAll in interface Collection<I>
Specified by:
retainAll in interface List<I>
Throws:
UnsupportedOperationException - Always

set

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

Specified by:
set in interface List<I>
Throws:
UnsupportedOperationException - Always

2.17.2: 2011-06-17