com.mysema.query.collections
Class AbstractIterable<I,T>

java.lang.Object
  extended by com.mysema.query.collections.AbstractIterable<I,T>
Type Parameters:
T -
All Implemented Interfaces:
Iterable<T>
Direct Known Subclasses:
MultiSourceIterable, SingleSourceIterable

public abstract class AbstractIterable<I,T>
extends Object
implements Iterable<T>

Author:
tiwe

Field Summary
protected  ExprEvaluatorFactory evaluatorFactory
           
protected  IteratorFactory iteratorFactory
           
protected  QueryMetadata metadata
           
 
Constructor Summary
AbstractIterable(QueryMetadata metadata, ExprEvaluatorFactory evaluatorFactory, IteratorFactory iteratorFactory, boolean forCount)
           
 
Method Summary
protected abstract  Iterator<I> initialIterator()
          creates the initial Iterator providing the filtered source content
 Iterator<T> iterator()
           
protected abstract  Iterator<I> orderedIterator(Iterator<I> it)
          reorders the filtered source Iterator based on the ordering criteria of the QueryMetadata
protected abstract  Iterator<T> projectedIterator(Iterator<I> it)
          creates the projection based on the given Iterator and the projection definition of the QueryMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

evaluatorFactory

protected final ExprEvaluatorFactory evaluatorFactory

iteratorFactory

protected final IteratorFactory iteratorFactory

metadata

protected final QueryMetadata metadata
Constructor Detail

AbstractIterable

public AbstractIterable(QueryMetadata metadata,
                        ExprEvaluatorFactory evaluatorFactory,
                        IteratorFactory iteratorFactory,
                        boolean forCount)
Method Detail

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>

initialIterator

protected abstract Iterator<I> initialIterator()
creates the initial Iterator providing the filtered source content

Returns:

orderedIterator

protected abstract Iterator<I> orderedIterator(Iterator<I> it)
reorders the filtered source Iterator based on the ordering criteria of the QueryMetadata

Parameters:
it -
Returns:

projectedIterator

protected abstract Iterator<T> projectedIterator(Iterator<I> it)
creates the projection based on the given Iterator and the projection definition of the QueryMetadata

Parameters:
it -
Returns:


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