org.teiid.common.buffer
Class TupleBrowser

java.lang.Object
  extended by org.teiid.common.buffer.TupleBrowser
All Implemented Interfaces:
TupleSource

public class TupleBrowser
extends java.lang.Object
implements TupleSource

Implements intelligent browsing over a STree TODO: this is not as efficient as it should be over partial matches


Constructor Summary
TupleBrowser(STree sTree, java.util.List<java.lang.Object> lowerBound, java.util.List<java.lang.Object> upperBound, boolean direction)
          Construct a range based browser
TupleBrowser(STree sTree, TupleSource valueSet, boolean direction)
          Construct a value based browser.
 
Method Summary
 void closeSource()
          Closes the Tuple Source.
 java.util.List<?> nextTuple()
          Returns the next tuple
 void removed()
          Notify the browser that the last value was deleted.
 void update(java.util.List<?> tuple)
          Perform an in-place update of the tuple just returned by the next method WARNING - this must not change the key value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleBrowser

public TupleBrowser(STree sTree,
                    TupleSource valueSet,
                    boolean direction)
Construct a value based browser. The TupleSource should already be in the proper direction.

Parameters:
sTree -
valueSet -
direction -

TupleBrowser

public TupleBrowser(STree sTree,
                    java.util.List<java.lang.Object> lowerBound,
                    java.util.List<java.lang.Object> upperBound,
                    boolean direction)
             throws TeiidComponentException
Construct a range based browser

Parameters:
sTree -
lowerBound -
upperBound -
direction -
Throws:
TeiidComponentException
Method Detail

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

update

public void update(java.util.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()
Notify the browser that the last value was deleted.


closeSource

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

Specified by:
closeSource in interface TupleSource


Copyright © 2011. All Rights Reserved.