org.objectweb.medor.eval.prefetch.lib
Class IntermediaryPrefetchBufferImpl

java.lang.Object
  extended byorg.objectweb.medor.eval.prefetch.lib.IntermediaryPrefetchBufferImpl
All Implemented Interfaces:
IntermediaryPrefetchBuffer, PrefetchBuffer

public class IntermediaryPrefetchBufferImpl
extends java.lang.Object
implements IntermediaryPrefetchBuffer

Author:
Y.Bersihand

Constructor Summary
IntermediaryPrefetchBufferImpl(PrefetchBuffer delegatePb, int[] associationTable)
           
 
Method Summary
 void addPrefetchTuple()
          Adds to this cache a prefetched tuple that is the one which currently traversed within the associated tuple collection.
 void close()
           
 int[] getAssociationTable()
          Gets the association table.
 PrefetchBuffer getDelegatePrefetchBuffer()
          Gets the delegate prefetch buffer
 Tuple getTuple(java.lang.Object index)
          Uses the association table to change the tuple retrieved from the delegatePb into a valid tuple for this prefetch buffer.
 TupleCollection getTupleCollection(java.lang.Object index)
          Returns the tuple collection positionned on the tuple identified by index.
 boolean isClosed()
           
 void setAssociationTable(int[] indexes)
          Sets the association table between the tuple of the delegate prefetch buffer and its tuple.
 void setDelegatePrefetchBuffer(PrefetchBuffer pb)
          Sets the delegate prefetch buffer
 void setTupleCollection(TupleCollection tc)
          Associates a tuple collection to this PrefetchBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntermediaryPrefetchBufferImpl

public IntermediaryPrefetchBufferImpl(PrefetchBuffer delegatePb,
                                      int[] associationTable)
Method Detail

setDelegatePrefetchBuffer

public void setDelegatePrefetchBuffer(PrefetchBuffer pb)
Description copied from interface: IntermediaryPrefetchBuffer
Sets the delegate prefetch buffer

Specified by:
setDelegatePrefetchBuffer in interface IntermediaryPrefetchBuffer

getDelegatePrefetchBuffer

public PrefetchBuffer getDelegatePrefetchBuffer()
Description copied from interface: IntermediaryPrefetchBuffer
Gets the delegate prefetch buffer

Specified by:
getDelegatePrefetchBuffer in interface IntermediaryPrefetchBuffer
Returns:

setAssociationTable

public void setAssociationTable(int[] indexes)
Description copied from interface: IntermediaryPrefetchBuffer
Sets the association table between the tuple of the delegate prefetch buffer and its tuple. Example: Tuple of the delegate pb : [f1, f2, f3, f4] association table : [0,3] because to build its tuple, only the fields f1 and f4 are needed.

Specified by:
setAssociationTable in interface IntermediaryPrefetchBuffer
Parameters:
indexes -

getAssociationTable

public int[] getAssociationTable()
Description copied from interface: IntermediaryPrefetchBuffer
Gets the association table.

Specified by:
getAssociationTable in interface IntermediaryPrefetchBuffer

addPrefetchTuple

public void addPrefetchTuple()
                      throws MedorException
Description copied from interface: PrefetchBuffer
Adds to this cache a prefetched tuple that is the one which currently traversed within the associated tuple collection.

Specified by:
addPrefetchTuple in interface PrefetchBuffer
Throws:
MedorException

setTupleCollection

public void setTupleCollection(TupleCollection tc)
                        throws MedorException
Description copied from interface: PrefetchBuffer
Associates a tuple collection to this PrefetchBuffer. It should contain the tuples that will be registered with the prefetch structure.

Specified by:
setTupleCollection in interface PrefetchBuffer
Parameters:
tc - The associated tuple collection.
Throws:
MedorException

close

public void close()
           throws MedorException
Specified by:
close in interface PrefetchBuffer
Throws:
MedorException

isClosed

public boolean isClosed()
Specified by:
isClosed in interface PrefetchBuffer

getTuple

public Tuple getTuple(java.lang.Object index)
               throws MedorException
Uses the association table to change the tuple retrieved from the delegatePb into a valid tuple for this prefetch buffer. If no delegate pb tuple found, return null.

Specified by:
getTuple in interface PrefetchBuffer
Throws:
MedorException

getTupleCollection

public TupleCollection getTupleCollection(java.lang.Object index)
                                   throws MedorException
Description copied from interface: PrefetchBuffer
Returns the tuple collection positionned on the tuple identified by index.

Specified by:
getTupleCollection in interface PrefetchBuffer
Throws:
MedorException