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 aSTree
TODO: 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 void
closeSource()
Closes the Tuple Source.List<?>
nextTuple()
Returns the next tuplevoid
removed()
Notify the browser that the last value was deleted.void
reset(TupleSource ts)
void
update(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. TheTupleSource
should 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. TheTupleSource
should 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:TupleSource
Returns the next tuple- Specified by:
nextTuple
in interfaceTupleSource
- 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 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 TeiidComponentException
Notify the browser that the last value was deleted.- Throws:
TeiidComponentException
-
closeSource
public void closeSource()
Description copied from interface:TupleSource
Closes the Tuple Source.- Specified by:
closeSource
in interfaceTupleSource
-
-