org.teiid.common.buffer
Class AbstractTupleSource

java.lang.Object
  extended by org.teiid.common.buffer.AbstractTupleSource
All Implemented Interfaces:
IndexedTupleSource, TupleSource
Direct Known Subclasses:
BatchIterator

public abstract class AbstractTupleSource
extends java.lang.Object
implements IndexedTupleSource


Field Summary
protected  TupleBatch batch
           
 
Constructor Summary
AbstractTupleSource()
           
 
Method Summary
protected abstract  int available()
           
 void closeSource()
          Closes the Tuple Source.
protected abstract  java.util.List<?> finalRow()
           
protected abstract  TupleBatch getBatch(int row)
           
 int getCurrentIndex()
          Get the current position.
protected  java.util.List<?> getCurrentTuple()
           
 boolean hasNext()
           
 void mark()
          Save the current position that can be restored with a call to IndexedTupleSource.reset()
 java.util.List<?> nextTuple()
          Returns the next tuple
 void reset()
          Restore the previous mark and set the mark back to the first position.
 void setPosition(int position)
          Set the tuple source position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

batch

protected TupleBatch batch
Constructor Detail

AbstractTupleSource

public AbstractTupleSource()
Method Detail

getCurrentIndex

public int getCurrentIndex()
Description copied from interface: IndexedTupleSource
Get the current position. The position is 1 based and reports the position of the tuple that will be retrieved with a call to TupleSource.nextTuple()

Specified by:
getCurrentIndex in interface IndexedTupleSource
Returns:

nextTuple

public java.util.List<?> nextTuple()
                            throws TeiidComponentException,
                                   TeiidProcessingException
Description copied from interface: TupleSource
Returns the next tuple

Specified by:
nextTuple in interface TupleSource
Returns:
the next tuple (a List object), or null if there are no more tuples.
Throws:
TeiidComponentException - indicating a non-business exception such as a communication exception, or other such nondeterministic exception
TeiidProcessingException

getCurrentTuple

protected java.util.List<?> getCurrentTuple()
                                     throws TeiidComponentException,
                                            BlockedException,
                                            TeiidProcessingException
Throws:
TeiidComponentException
BlockedException
TeiidProcessingException

finalRow

protected abstract java.util.List<?> finalRow()
                                       throws BlockedException,
                                              TeiidComponentException,
                                              TeiidProcessingException
Throws:
BlockedException
TeiidComponentException
TeiidProcessingException

getBatch

protected abstract TupleBatch getBatch(int row)
                                throws TeiidComponentException,
                                       TeiidProcessingException
Throws:
TeiidComponentException
TeiidProcessingException

available

protected abstract int available()

closeSource

public void closeSource()
Description copied from interface: TupleSource
Closes the Tuple Source.

Specified by:
closeSource in interface TupleSource

hasNext

public boolean hasNext()
                throws TeiidComponentException,
                       TeiidProcessingException
Specified by:
hasNext in interface IndexedTupleSource
Returns:
true if there are more tuples
Throws:
TeiidComponentException
TeiidProcessingException

reset

public void reset()
Description copied from interface: IndexedTupleSource
Restore the previous mark and set the mark back to the first position.

Specified by:
reset in interface IndexedTupleSource

mark

public void mark()
Description copied from interface: IndexedTupleSource
Save the current position that can be restored with a call to IndexedTupleSource.reset()

Specified by:
mark in interface IndexedTupleSource

setPosition

public void setPosition(int position)
Description copied from interface: IndexedTupleSource
Set the tuple source position

Specified by:
setPosition in interface IndexedTupleSource


Copyright © 2011. All Rights Reserved.