it.tidalwave.util
Class FinderSupport<T>

Package class diagram package FinderSupport
java.lang.Object
  extended by it.tidalwave.util.FinderSupport<T>
All Implemented Interfaces:
Finder<T>, java.io.Serializable, java.lang.Cloneable

public abstract class FinderSupport<T>
extends java.lang.Object
implements Finder<T>

Version:
$Id: FinderSupport.java,v 1fac844c8d8a 2010/03/21 17:00:04 fabrizio $
Author:
Fabrizio Giudici
See Also:
Serialized Form
Status: draft API

Nested Class Summary
 
Nested classes/interfaces inherited from interface it.tidalwave.util.Finder
Finder.SortCriterion, Finder.SortDirection
 
Field Summary
protected  int firstResult
           
protected  int maxResults
           
 
Constructor Summary
FinderSupport(java.lang.String description)
           
 
Method Summary
 int count()
          
protected abstract  java.util.List<T> doCompute()
           
 T firstResult()
          
 Finder from(int firstResult)
          
 Finder max(int maxResults)
          
<X> Finder<X>
ofType(java.lang.Class<X> type)
          
 T result()
          
 java.util.List<? extends T> results()
          
 Finder<T> sort(Finder.SortCriterion criterion)
          
 Finder<T> sort(Finder.SortCriterion criterion, Finder.SortDirection direction)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

firstResult

@Nonnegative
protected int firstResult

maxResults

@Nonnegative
protected int maxResults
Constructor Detail

FinderSupport

public FinderSupport(@Nonnull
                     java.lang.String description)
Method Detail

count

@Nonnegative
public int count()

Specified by:
count in interface Finder<T>

from

@Nonnull
public Finder from(@Nonnegative
                           int firstResult)

Specified by:
from in interface Finder<T>

max

@Nonnull
public Finder max(@Nonnegative
                          int maxResults)

Specified by:
max in interface Finder<T>

ofType

@Nonnull
public <X> Finder<X> ofType(@Nonnull
                                    java.lang.Class<X> type)

Specified by:
ofType in interface Finder<T>

result

@Nonnull
public T result()
         throws NotFoundException

Specified by:
result in interface Finder<T>
Throws:
NotFoundException

firstResult

@Nonnull
public T firstResult()
              throws NotFoundException

Specified by:
firstResult in interface Finder<T>
Throws:
NotFoundException

results

@Nonnull
public java.util.List<? extends T> results()

Specified by:
results in interface Finder<T>

sort

@Nonnull
public Finder<T> sort(@Nonnull
                              Finder.SortCriterion criterion,
                              @Nonnull
                              Finder.SortDirection direction)

Specified by:
sort in interface Finder<T>

sort

@Nonnull
public Finder<T> sort(@Nonnull
                              Finder.SortCriterion criterion)

Specified by:
sort in interface Finder<T>

doCompute

@Nonnull
protected abstract java.util.List<T> doCompute()


Copyright © 2009-2010 Tidalwave s.a.s.. All Rights Reserved.