uk.nominet.catnap.dao
Class PageableList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byuk.nominet.catnap.dao.PageableList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class PageableList
extends java.util.ArrayList

Pageable List. Extends Arraylist with a couple of extra fields to allow pageability. The client will interrogate one or more of the fields contained to check whether or not there are more records and possibly for the maximum number.

See Also:
Serialized Form

Field Summary
static int RECORD_COUNT_NOT_AVAILABLE
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PageableList()
           
 
Method Summary
 int getCurrentOffset()
          Get the current offset in the paging loop
 long getFullItemCount()
          Return an indicator as to how many records there are in total if available, -1 if none available.
 int getNextOffset()
          Convenience method for getting the next offset if in a paging loop.
 int getPreviousOffset()
          Convenience method for getting the previous offset if in a paging loop.
 boolean hasNextPage()
          Return a boolean indicating whether or not there are more records to query.
 boolean hasPreviousPage()
          Return a boolean indicating whether or not there are previous records.
 void setNextOffset(int nextOffset)
          Set the next offset in the paging loop (or current offset if no more pages available)
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Field Detail

RECORD_COUNT_NOT_AVAILABLE

public static final int RECORD_COUNT_NOT_AVAILABLE
See Also:
Constant Field Values
Constructor Detail

PageableList

public PageableList()
Method Detail

hasNextPage

public boolean hasNextPage()
Return a boolean indicating whether or not there are more records to query.

Returns:

hasPreviousPage

public boolean hasPreviousPage()
Return a boolean indicating whether or not there are previous records.

Returns:

getFullItemCount

public long getFullItemCount()
Return an indicator as to how many records there are in total if available, -1 if none available.

Returns:

getCurrentOffset

public int getCurrentOffset()
Get the current offset in the paging loop

Returns:

getNextOffset

public int getNextOffset()
Convenience method for getting the next offset if in a paging loop.

Returns:

setNextOffset

public void setNextOffset(int nextOffset)
Set the next offset in the paging loop (or current offset if no more pages available)

Parameters:
nextOffset -

getPreviousOffset

public int getPreviousOffset()
Convenience method for getting the previous offset if in a paging loop.

Returns: