2.17.2: 2011-06-17

net.sf.basedb.core
Class ItemResultList<I extends BasicItem>

java.lang.Object
  extended by net.sf.basedb.core.AbstractResultList<I>
      extended by net.sf.basedb.core.ItemResultList<I>
All Implemented Interfaces:
Iterable<I>, Collection<I>, List<I>, QueryResult, ResultList<I>

public class ItemResultList<I extends BasicItem>
extends AbstractResultList<I>

Return the results of an ItemQuery as a list.

Version:
2.0
Author:
Samuel, Nicklas
See Also:
ItemQuery.list(DbControl)
Last modified
$Date: 2010-01-18 08:31:09 +0100 (Mon, 18 Jan 2010) $

Nested Class Summary
private  class ItemResultList.ResultListIterator<T extends BasicItem>
          Inner class to implement the iterator returned by the iterator() method.
private  class ItemResultList.ResultListListIterator<T extends BasicItem>
          Inner class to implement the iterator returned by the listIterator() method.
 
Field Summary
private  List<? extends BasicData> data
          The internal list of BasicData objects.
private  DbControl dc
          The DbControl that was used in the query.
private  Class<I> itemClass
          The class of the items returned by the query (and this object).
private  Item itemType
          The type of items returned by the query.
 
Constructor Summary
ItemResultList(List<? extends BasicData> data, DbControl dc, Class<I> itemClass, long totalCount)
           
 
Method Summary
 boolean contains(Object o)
           
 boolean equals(Object o)
           
private
<E extends BasicItem>
E
get(Class<E> returnType, BasicData dataObject)
           
 I get(int index)
          Get a BasicItem derived object.
 Item getItemType()
          Get the type of items contained in this list.
 int hashCode()
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 Iterator<I> iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator<I> listIterator()
           
 ListIterator<I> listIterator(int index)
           
 int size()
           
 List<I> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class net.sf.basedb.core.AbstractResultList
add, add, addAll, addAll, clear, containsAll, getTotalCount, remove, remove, removeAll, retainAll, set
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private final List<? extends BasicData> data
The internal list of BasicData objects.


dc

private final DbControl dc
The DbControl that was used in the query.


itemClass

private final Class<I extends BasicItem> itemClass
The class of the items returned by the query (and this object).


itemType

private final Item itemType
The type of items returned by the query.

Constructor Detail

ItemResultList

ItemResultList(List<? extends BasicData> data,
               DbControl dc,
               Class<I> itemClass,
               long totalCount)
Method Detail

contains

public boolean contains(Object o)

get

public I get(int index)
Get a BasicItem derived object.

Returns:
Object of type I or null if no valid item object could be fetched with the internal data object

indexOf

public int indexOf(Object o)

lastIndexOf

public int lastIndexOf(Object o)

isEmpty

public boolean isEmpty()

iterator

public Iterator<I> iterator()

listIterator

public ListIterator<I> listIterator()

listIterator

public ListIterator<I> listIterator(int index)

size

public int size()

subList

public List<I> subList(int fromIndex,
                       int toIndex)

toArray

public Object[] toArray()

toArray

public <T> T[] toArray(T[] a)

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<I extends BasicItem>
Specified by:
equals in interface List<I extends BasicItem>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<I extends BasicItem>
Specified by:
hashCode in interface List<I extends BasicItem>
Overrides:
hashCode in class Object

getItemType

public Item getItemType()
Get the type of items contained in this list.

Returns:
An Item object or null if not known

get

private <E extends BasicItem> E get(Class<E> returnType,
                                    BasicData dataObject)

2.17.2: 2011-06-17