com.bea.alcs.connect.util
Class PagedList<E>

java.lang.Object
  extended by com.bea.alcs.connect.util.PagedList<E>
Type Parameters:
E - the generic type of the List
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>

public class PagedList<E>
extends java.lang.Object
implements java.util.List<E>

Read-only paged version of a List. All methods which modify the list throw UnsupportedOperationException.


Constructor Summary
PagedList(java.util.List<E> list, Paging paging)
          Creates a paged list of a generic type.
 
Method Summary
 boolean add(E obj)
          Unsupported operation for the read-only list.
 void add(int index, E element)
          Unsupported operation for the read-only list.
 boolean addAll(java.util.Collection<? extends E> coll)
          Unsupported operation for the read-only list.
 boolean addAll(int index, java.util.Collection<? extends E> coll)
          Unsupported operation for the read-only list.
 void clear()
          Unsupported operation for the read-only list.
 boolean contains(java.lang.Object obj)
           
 boolean containsAll(java.util.Collection<?> coll)
           
 E get(int index)
           
 int indexOf(java.lang.Object obj)
           
 boolean isEmpty()
           
 java.util.Iterator<E> iterator()
           
 int lastIndexOf(java.lang.Object obj)
           
 java.util.ListIterator<E> listIterator()
           
 java.util.ListIterator<E> listIterator(int index)
           
 E remove(int index)
          Unsupported operation for the read-only list.
 boolean remove(java.lang.Object obj)
          Unsupported operation for the read-only list.
 boolean removeAll(java.util.Collection<?> coll)
          Unsupported operation for the read-only list.
 boolean retainAll(java.util.Collection<?> coll)
          Unsupported operation for the read-only list.
 E set(int index, E element)
          Unsupported operation for the read-only list.
 int size()
           
 java.util.List<E> subList(int fromIndex, int toIndex)
          Unsupported operation for the read-only list.
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] array)
           
 
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
equals, hashCode
 

Constructor Detail

PagedList

public PagedList(java.util.List<E> list,
                 Paging paging)
Creates a paged list of a generic type.

Parameters:
list - the list to page
paging - the paging information
Method Detail

contains

public boolean contains(java.lang.Object obj)
Specified by:
contains in interface java.util.Collection<E>
Specified by:
contains in interface java.util.List<E>
Parameters:
obj - object
Returns:
true if List contains obj
See Also:
List.contains(Object)

containsAll

public boolean containsAll(java.util.Collection<?> coll)
Specified by:
containsAll in interface java.util.Collection<E>
Specified by:
containsAll in interface java.util.List<E>
Parameters:
coll - collection
Returns:
true if List contains coll
See Also:
List.containsAll(Collection)

get

public E get(int index)
Specified by:
get in interface java.util.List<E>
Parameters:
index - index
Returns:
item at index
See Also:
List.get(int)

indexOf

public int indexOf(java.lang.Object obj)
Specified by:
indexOf in interface java.util.List<E>
Parameters:
obj - object
Returns:
index of obj
See Also:
List.indexOf(Object)

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<E>
Specified by:
isEmpty in interface java.util.List<E>
Returns:
true if the List is empty
See Also:
List.isEmpty()

iterator

public java.util.Iterator<E> iterator()
Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface java.util.Collection<E>
Specified by:
iterator in interface java.util.List<E>
Returns:
iterator
See Also:
List.iterator()

lastIndexOf

public int lastIndexOf(java.lang.Object obj)
Specified by:
lastIndexOf in interface java.util.List<E>
Parameters:
obj - object
Returns:
last index of obj
See Also:
List.lastIndexOf(Object)

listIterator

public java.util.ListIterator<E> listIterator()
Specified by:
listIterator in interface java.util.List<E>
Returns:
ListIterator
See Also:
List.listIterator()

listIterator

public java.util.ListIterator<E> listIterator(int index)
Specified by:
listIterator in interface java.util.List<E>
Parameters:
index - index
Returns:
ListIterator starting at the index
See Also:
List.listIterator(int)

size

public int size()
Specified by:
size in interface java.util.Collection<E>
Specified by:
size in interface java.util.List<E>
Returns:
size
See Also:
List.size()

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>
Returns:
array
See Also:
List.toArray()

toArray

public <T> T[] toArray(T[] array)
Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>
Type Parameters:
T - type of array
Parameters:
array - array
Returns:
array
See Also:
List.toArray(Object[])

add

public void add(int index,
                E element)
Unsupported operation for the read-only list.

Specified by:
add in interface java.util.List<E>
Parameters:
index - index
element - element

add

public boolean add(E obj)
Unsupported operation for the read-only list.

Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.List<E>
Parameters:
obj - object
Returns:
true if operation is successful

addAll

public boolean addAll(java.util.Collection<? extends E> coll)
Unsupported operation for the read-only list.

Specified by:
addAll in interface java.util.Collection<E>
Specified by:
addAll in interface java.util.List<E>
Parameters:
coll - collection
Returns:
boolean if operation is successful

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends E> coll)
Unsupported operation for the read-only list.

Specified by:
addAll in interface java.util.List<E>
Parameters:
index - index
coll - collection
Returns:
true if operation is successful

clear

public void clear()
Unsupported operation for the read-only list.

Specified by:
clear in interface java.util.Collection<E>
Specified by:
clear in interface java.util.List<E>

remove

public E remove(int index)
Unsupported operation for the read-only list.

Specified by:
remove in interface java.util.List<E>
Parameters:
index - index
Returns:
element that was removed

remove

public boolean remove(java.lang.Object obj)
Unsupported operation for the read-only list.

Specified by:
remove in interface java.util.Collection<E>
Specified by:
remove in interface java.util.List<E>
Parameters:
obj - object
Returns:
true if operation was successful

removeAll

public boolean removeAll(java.util.Collection<?> coll)
Unsupported operation for the read-only list.

Specified by:
removeAll in interface java.util.Collection<E>
Specified by:
removeAll in interface java.util.List<E>
Parameters:
coll - collection
Returns:
true if operation was successful

retainAll

public boolean retainAll(java.util.Collection<?> coll)
Unsupported operation for the read-only list.

Specified by:
retainAll in interface java.util.Collection<E>
Specified by:
retainAll in interface java.util.List<E>
Parameters:
coll - collection
Returns:
true if operation was successful

set

public E set(int index,
             E element)
Unsupported operation for the read-only list.

Specified by:
set in interface java.util.List<E>
Parameters:
index - index
element - element
Returns:
element

subList

public java.util.List<E> subList(int fromIndex,
                                 int toIndex)
Unsupported operation for the read-only list.

Specified by:
subList in interface java.util.List<E>
Parameters:
fromIndex - from index
toIndex - to index
Returns:
subList