Package org.teiid.common.buffer
Class TupleBrowser
- java.lang.Object
-
- org.teiid.common.buffer.TupleBrowser
-
- All Implemented Interfaces:
TupleSource
public class TupleBrowser extends Object implements TupleSource
Implements intelligent browsing over aSTreeTODO: this is not as efficient as it should be over partial matches
-
-
Constructor Summary
Constructors Constructor Description TupleBrowser(STree sTree, List<Object> lowerBound, List<Object> upperBound, boolean direction, boolean readOnly)Construct a range based browserTupleBrowser(STree sTree, TupleSource valueSet, boolean direction)Construct a value based browser.TupleBrowser(STree sTree, TupleSource valueSet, boolean direction, boolean readOnly)Construct a value based browser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseSource()Closes the Tuple Source.List<?>nextTuple()Returns the next tuplevoidremoved()Notify the browser that the last value was deleted.voidreset(TupleSource ts)voidupdate(List<?> tuple)Perform an in-place update of the tuple just returned by the next method WARNING - this must not change the key value
-
-
-
Constructor Detail
-
TupleBrowser
public TupleBrowser(STree sTree, TupleSource valueSet, boolean direction)
Construct a value based browser. TheTupleSourceshould already be in the proper direction.- Parameters:
sTree-valueSet-direction-
-
TupleBrowser
public TupleBrowser(STree sTree, TupleSource valueSet, boolean direction, boolean readOnly)
Construct a value based browser. TheTupleSourceshould already be in the proper direction.- Parameters:
sTree-valueSet-direction-readOnly-
-
TupleBrowser
public TupleBrowser(STree sTree, List<Object> lowerBound, List<Object> upperBound, boolean direction, boolean readOnly) throws TeiidComponentException
Construct a range based browser- Parameters:
sTree-lowerBound-upperBound-direction-- Throws:
TeiidComponentException
-
-
Method Detail
-
nextTuple
public List<?> nextTuple() throws TeiidComponentException, TeiidProcessingException
Description copied from interface:TupleSourceReturns the next tuple- Specified by:
nextTuplein interfaceTupleSource- Returns:
- the next tuple (a List object), or
nullif there are no more tuples. - Throws:
TeiidComponentException- indicating a non-business exception such as a communication exception, or other such nondeterministic exceptionTeiidProcessingException
-
reset
public void reset(TupleSource ts) throws TeiidComponentException
- Throws:
TeiidComponentException
-
update
public void update(List<?> tuple) throws TeiidComponentException
Perform an in-place update of the tuple just returned by the next method WARNING - this must not change the key value- Parameters:
tuple-- Throws:
TeiidComponentException
-
removed
public void removed() throws TeiidComponentExceptionNotify the browser that the last value was deleted.- Throws:
TeiidComponentException
-
closeSource
public void closeSource()
Description copied from interface:TupleSourceCloses the Tuple Source.- Specified by:
closeSourcein interfaceTupleSource
-
-