org.openrdf.sail.federation.evaluation
Class AlternativeCursor<E>

java.lang.Object
  extended by info.aduna.iteration.CloseableIterationBase<E,X>
      extended by info.aduna.iteration.LookAheadIteration<E,QueryEvaluationException>
          extended by org.openrdf.sail.federation.evaluation.AlternativeCursor<E>
All Implemented Interfaces:
CloseableIteration<E,QueryEvaluationException>, Iteration<E,QueryEvaluationException>

public class AlternativeCursor<E>
extends LookAheadIteration<E,QueryEvaluationException>

If the primary cursor is empty, use the alternative cursor.

Author:
James Leigh

Constructor Summary
AlternativeCursor(CloseableIteration<? extends E,QueryEvaluationException> primary, CloseableIteration<? extends E,QueryEvaluationException> alternative)
           
 
Method Summary
 E getNextElement()
           
 void handleClose()
           
 String toString()
           
 
Methods inherited from class info.aduna.iteration.LookAheadIteration
hasNext, next, remove
 
Methods inherited from class info.aduna.iteration.CloseableIterationBase
close, isClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlternativeCursor

public AlternativeCursor(CloseableIteration<? extends E,QueryEvaluationException> primary,
                         CloseableIteration<? extends E,QueryEvaluationException> alternative)
Method Detail

handleClose

public void handleClose()
                 throws QueryEvaluationException
Overrides:
handleClose in class LookAheadIteration<E,QueryEvaluationException>
Throws:
QueryEvaluationException

getNextElement

public E getNextElement()
                 throws QueryEvaluationException
Specified by:
getNextElement in class LookAheadIteration<E,QueryEvaluationException>
Throws:
QueryEvaluationException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2009 James Leigh Services Inc.. All Rights Reserved.