grails.gorm
Class PagedResultList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by grails.gorm.PagedResultList
All Implemented Interfaces:
java.lang.Iterable, java.util.Collection, java.util.List

public class PagedResultList
extends java.util.AbstractList

A result list implementation that provides an additional property called 'totalCount' to obtain the total number of records. Useful for pagination.

Since:
1.0

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PagedResultList(org.grails.datastore.mapping.query.Query query)
           
 
Method Summary
 void add(int i, java.lang.Object o)
           
 java.lang.Object get(int i)
           
 int getTotalCount()
           
 java.lang.Object remove(int i)
           
 java.lang.Object set(int i, java.lang.Object o)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

PagedResultList

public PagedResultList(org.grails.datastore.mapping.query.Query query)
Method Detail

getTotalCount

public int getTotalCount()
Returns:
The total number of records for this query

get

public java.lang.Object get(int i)
Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList

set

public java.lang.Object set(int i,
                            java.lang.Object o)
Specified by:
set in interface java.util.List
Overrides:
set in class java.util.AbstractList

remove

public java.lang.Object remove(int i)
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.AbstractList

add

public void add(int i,
                java.lang.Object o)
Specified by:
add in interface java.util.List
Overrides:
add in class java.util.AbstractList

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Specified by:
size in class java.util.AbstractCollection