org.apache.commons.scaffold.util
Interface ResultList

All Superinterfaces:
Collection, Iterable
All Known Implementing Classes:
ResultListBase

public interface ResultList
extends Collection

A container for a set of results returned from the resource tier. The list may contain a Map for each record in a set, or a collection of beans. A setter for the list is not provided, so that different implementations can specify the type it expects.

Version:
$Revision: 155464 $ $Date: 2005-02-26 13:26:54 +0000 (Sat, 26 Feb 2005) $
Author:
Ted Husted

Method Summary
 boolean add(Object o)
          Appends the specified element to the end of this list (optional operation).
 boolean addAll(Collection c)
          Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator.
 void clear()
          Removes all of the elements from this list..
 boolean contains(Object element)
          Returns true if this collection contains the specified element.
 boolean containsAll(Collection c)
          Returns true if this collection contains all of the elements in the specified collection.
 Object get(int index)
          Returns the element at the specified position in this list.
 Integer getCode()
          Return the code.
 int getCounter()
          Convenience method for maintaining a counter that can be shared among multiple components in some presentation systems (e.g, Tiles).
 Map getDisplayName()
          Return the displayName map (a HashMap).
 Object getElement(int index)
          Convenience accessor for get().
 Iterator getIterator()
          Convenience accessor for iterator().
 String getLegend()
          Return the legend.
 List getResult()
          Return the result list
 Scroller getScroller()
          Return our scroller.
 int getSize()
          Convenience accessor for size().
 boolean isEmpty()
          Returns true if this collection contains no elements.
 Iterator iterator()
          Return an iterator for the List.
 boolean populate(Object o, int index)
          Populate matching properties on given object, using bean at given index.
 boolean remove(Object o)
          Removes a single instance of the specified element from this collection, if it is present (optional operation).
 boolean removeAll(Collection c)
          Removes all this collection's elements that are also contained in the specified collection.
 boolean retainAll(Collection c)
          Retains only the elements in this collection that are contained in the specified collection.
 void setCode(Integer code)
          Set the code.
 void setCounter(int counter)
          Set a new counter value.
 void setDisplayName(Map displayName)
          Assign a new displayName list.
 void setLegend(String legend)
          Set the legend.
 void setLegend(String name, String value)
          Set the legend.
 void setResult(List result)
          Set our result
 void setScroller(Scroller scroller)
          Set our scroller.
 int size()
          Return the number of elements on the List.
 Object[] toArray()
          Returns an array containing all of the elements in this collection.
 Object[] toArray(Object[] a)
          Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Method Detail

getResult

List getResult()
Return the result list

Returns:
the result list

setResult

void setResult(List result)
Set our result

Parameters:
result - The new result

getScroller

Scroller getScroller()
Return our scroller. The scroller object tracks the client's current position in a result list. The database (or a cache) can return part of a larger list at a time. The scroller object can be used to request the appropriate next or previous entry on the list, and also to display the relative postion of the first item in this batch (x of xx).

Returns:
Our scroller

setScroller

void setScroller(Scroller scroller)
Set our scroller.

Parameters:
scroller - The new scroller

getCounter

int getCounter()
Convenience method for maintaining a counter that can be shared among multiple components in some presentation systems (e.g, Tiles).

Returns:
The next counter value

setCounter

void setCounter(int counter)
Set a new counter value.


getCode

Integer getCode()
Return the code.

Returns:
the code

setCode

void setCode(Integer code)
Set the code.

Parameters:
code - The new code

getLegend

String getLegend()
Return the legend.

Returns:
the legend

setLegend

void setLegend(String legend)
Set the legend.

Parameters:
legend - The new legend

setLegend

void setLegend(String name,
               String value)
Set the legend.

Parameters:
legend - The new legend

getDisplayName

Map getDisplayName()
Return the displayName map (a HashMap). These are localized titles for the properties names in the result list.

Returns:
the displayName list

setDisplayName

void setDisplayName(Map displayName)
Assign a new displayName list. These are localized titles for the properties names in the result list.


toArray

Object[] toArray()
Returns an array containing all of the elements in this collection.

Specified by:
toArray in interface Collection
Returns:
an array containing all of the elements in this collection

toArray

Object[] toArray(Object[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.

Specified by:
toArray in interface Collection
Returns:
an array containing the elements of this collection

isEmpty

boolean isEmpty()
Returns true if this collection contains no elements.

Specified by:
isEmpty in interface Collection
Returns:
true if this collection contains no elements

size

int size()
Return the number of elements on the List.

Specified by:
size in interface Collection
Returns:
the size of the List

contains

boolean contains(Object element)
Returns true if this collection contains the specified element.

Specified by:
contains in interface Collection
Returns:
true if this collection contains the specified element

add

boolean add(Object o)
Appends the specified element to the end of this list (optional operation).

Specified by:
add in interface Collection
Returns:
the row count

iterator

Iterator iterator()
Return an iterator for the List.

Specified by:
iterator in interface Collection
Specified by:
iterator in interface Iterable
Returns:
an iterator for the List

get

Object get(int index)
Returns the element at the specified position in this list.


addAll

boolean addAll(Collection c)
Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator.

Specified by:
addAll in interface Collection

clear

void clear()
Removes all of the elements from this list..

Specified by:
clear in interface Collection

containsAll

boolean containsAll(Collection c)
Returns true if this collection contains all of the elements in the specified collection.

Specified by:
containsAll in interface Collection
Returns:
true if this collection contains all of the elements in the specified collection

remove

boolean remove(Object o)
Removes a single instance of the specified element from this collection, if it is present (optional operation).

Specified by:
remove in interface Collection

removeAll

boolean removeAll(Collection c)
Removes all this collection's elements that are also contained in the specified collection.

Specified by:
removeAll in interface Collection

retainAll

boolean retainAll(Collection c)
Retains only the elements in this collection that are contained in the specified collection.

Specified by:
retainAll in interface Collection

getElement

Object getElement(int index)
Convenience accessor for get().


getIterator

Iterator getIterator()
Convenience accessor for iterator().

Returns:
an iterator for the List

getSize

int getSize()
Convenience accessor for size().

Returns:
the size of the List

populate

boolean populate(Object o,
                 int index)
                 throws Exception
Populate matching properties on given object, using bean at given index. Returns false if index>size. PropertyUtils.describe.

Throws:
Throws - StateException on any error.
Exception


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.