com.mysema.query.paging
Class SimpleListSource<T>

java.lang.Object
  extended by com.mysema.query.paging.SimpleListSource<T>
Type Parameters:
T -
All Implemented Interfaces:
ListSource<T>

public class SimpleListSource<T>
extends Object
implements ListSource<T>

List based implementation of the ListSource interface

Author:
tiwe

Constructor Summary
SimpleListSource(List<T> list)
           
SimpleListSource(T... args)
           
 
Method Summary
 T getResult(int index)
           
 List<T> getResults(int fromIndex, int toIndex)
          Get the results from the given start index to the given end index
 boolean isEmpty()
          true, if not results could be found, otherwise false
 long size()
          total amount of results
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleListSource

public SimpleListSource(List<T> list)

SimpleListSource

public SimpleListSource(T... args)
Method Detail

getResults

public List<T> getResults(int fromIndex,
                          int toIndex)
Description copied from interface: ListSource
Get the results from the given start index to the given end index

Specified by:
getResults in interface ListSource<T>
Parameters:
fromIndex - start index
toIndex - end index
Returns:

isEmpty

public boolean isEmpty()
Description copied from interface: ListSource
true, if not results could be found, otherwise false

Specified by:
isEmpty in interface ListSource<T>
Returns:

size

public long size()
Description copied from interface: ListSource
total amount of results

Specified by:
size in interface ListSource<T>
Returns:

getResult

public T getResult(int index)
Specified by:
getResult in interface ListSource<T>
Returns:


Copyright © 2007-2010 Mysema Ltd. All Rights Reserved.