net.sf.oness.common.model.util
Class PaginatedList

java.lang.Object
  extended bynet.sf.oness.common.all.BaseObject
      extended bynet.sf.oness.common.model.util.PaginatedList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class PaginatedList
extends net.sf.oness.common.all.BaseObject
implements java.util.List

Class that represents a paginated List, with elements from firstElement and at maximum maxElements elements from the full list of size elements.

Note that firstElement starts at 0

Any attempt to access other than the current page will cause an error.

This is a read only implementation and many of the List methods are not implemented.

Version:
$Revision: 1.2 $
Author:
Carlos Sanchez
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.oness.common.all.BaseObject
log
 
Constructor Summary
PaginatedList()
           
PaginatedList(java.util.List list, int firstElement, int maxElements, int size)
           
 
Method Summary
 void add(int arg0, java.lang.Object arg1)
          Unsupported operation
 boolean add(java.lang.Object arg0)
          Unsupported operation
 boolean addAll(java.util.Collection arg0)
          Unsupported operation
 boolean addAll(int arg0, java.util.Collection arg1)
          Unsupported operation
 void clear()
          Unsupported operation
 boolean contains(java.lang.Object arg0)
          Unsupported operation
 boolean containsAll(java.util.Collection arg0)
          Unsupported operation
 java.lang.Object get(int arg0)
          Unsupported operation
 int getFirstElement()
          First element of this page, starting at 0
 int getLastPageNumber()
          Calculate the last page number, starting at 0
 java.util.List getList()
          Get list with the elements of this page
 int getMaxElements()
          Max number of elements in the page
 int getPageNumber()
          Calculate the page number, starting at 0
 int getPageSize()
          Number of elements in this page
 int getSize()
          Number of elements in all the pages
 int indexOf(java.lang.Object arg0)
          Unsupported operation
 boolean isEmpty()
          Unsupported operation
 java.util.Iterator iterator()
          Unsupported operation
 int lastIndexOf(java.lang.Object arg0)
          Unsupported operation
 java.util.ListIterator listIterator()
          Unsupported operation
 java.util.ListIterator listIterator(int arg0)
          Unsupported operation
 java.lang.Object remove(int arg0)
          Unsupported operation
 boolean remove(java.lang.Object arg0)
          Unsupported operation
 boolean removeAll(java.util.Collection arg0)
          Unsupported operation
 boolean retainAll(java.util.Collection arg0)
          Unsupported operation
 java.lang.Object set(int arg0, java.lang.Object arg1)
          Unsupported operation
 void setFirstElement(int firstElement)
           
 void setList(java.util.List list)
           
 void setMaxElements(int maxElements)
           
 void setSize(int size)
          Set the number of elements in all the pages
 int size()
          Number of elements in all the pages
 java.util.List subList(int arg0, int arg1)
          Unsupported operation
 java.lang.Object[] toArray()
          Unsupported operation
 java.lang.Object[] toArray(java.lang.Object[] arg0)
          Unsupported operation
 
Methods inherited from class net.sf.oness.common.all.BaseObject
clone, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

PaginatedList

public PaginatedList()

PaginatedList

public PaginatedList(java.util.List list,
                     int firstElement,
                     int maxElements,
                     int size)
Method Detail

getList

public java.util.List getList()
Get list with the elements of this page

Returns:

setList

public void setList(java.util.List list)

getFirstElement

public int getFirstElement()
First element of this page, starting at 0

Returns:

setFirstElement

public void setFirstElement(int firstElement)

getMaxElements

public int getMaxElements()
Max number of elements in the page

Returns:

setMaxElements

public void setMaxElements(int maxElements)

setSize

public void setSize(int size)
Set the number of elements in all the pages


getPageSize

public int getPageSize()
Number of elements in this page

Returns:

getPageNumber

public int getPageNumber()
Calculate the page number, starting at 0

Returns:

getLastPageNumber

public int getLastPageNumber()
Calculate the last page number, starting at 0

Returns:

iterator

public java.util.Iterator iterator()
Unsupported operation

Specified by:
iterator in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.iterator()

size

public int size()
Number of elements in all the pages

Specified by:
size in interface java.util.List
See Also:
Collection.size()

getSize

public int getSize()
Number of elements in all the pages

See Also:
size()

add

public void add(int arg0,
                java.lang.Object arg1)
Unsupported operation

Specified by:
add in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.add(int, java.lang.Object)

add

public boolean add(java.lang.Object arg0)
Unsupported operation

Specified by:
add in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.add(java.lang.Object)

addAll

public boolean addAll(java.util.Collection arg0)
Unsupported operation

Specified by:
addAll in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.addAll(java.util.Collection)

addAll

public boolean addAll(int arg0,
                      java.util.Collection arg1)
Unsupported operation

Specified by:
addAll in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.addAll(int, java.util.Collection)

clear

public void clear()
Unsupported operation

Specified by:
clear in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.clear()

contains

public boolean contains(java.lang.Object arg0)
Unsupported operation

Specified by:
contains in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.contains(java.lang.Object)

containsAll

public boolean containsAll(java.util.Collection arg0)
Unsupported operation

Specified by:
containsAll in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.containsAll(java.util.Collection)

get

public java.lang.Object get(int arg0)
Unsupported operation

Specified by:
get in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.get(int)

indexOf

public int indexOf(java.lang.Object arg0)
Unsupported operation

Specified by:
indexOf in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.indexOf(java.lang.Object)

isEmpty

public boolean isEmpty()
Unsupported operation

Specified by:
isEmpty in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.isEmpty()

lastIndexOf

public int lastIndexOf(java.lang.Object arg0)
Unsupported operation

Specified by:
lastIndexOf in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.lastIndexOf(java.lang.Object)

listIterator

public java.util.ListIterator listIterator()
Unsupported operation

Specified by:
listIterator in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.listIterator()

listIterator

public java.util.ListIterator listIterator(int arg0)
Unsupported operation

Specified by:
listIterator in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.listIterator(int)

remove

public java.lang.Object remove(int arg0)
Unsupported operation

Specified by:
remove in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.remove(int)

remove

public boolean remove(java.lang.Object arg0)
Unsupported operation

Specified by:
remove in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.remove(java.lang.Object)

removeAll

public boolean removeAll(java.util.Collection arg0)
Unsupported operation

Specified by:
removeAll in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.removeAll(java.util.Collection)

retainAll

public boolean retainAll(java.util.Collection arg0)
Unsupported operation

Specified by:
retainAll in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.retainAll(java.util.Collection)

set

public java.lang.Object set(int arg0,
                            java.lang.Object arg1)
Unsupported operation

Specified by:
set in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.set(int, java.lang.Object)

subList

public java.util.List subList(int arg0,
                              int arg1)
Unsupported operation

Specified by:
subList in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
List.subList(int, int)

toArray

public java.lang.Object[] toArray()
Unsupported operation

Specified by:
toArray in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.toArray()

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg0)
Unsupported operation

Specified by:
toArray in interface java.util.List
Throws:
java.lang.UnsupportedOperationException
See Also:
Collection.toArray(java.lang.Object[])


Copyright © 2003-2005 ONess Project. All Rights Reserved.