Class TupleStore

java.lang.Object
com.semedy.reasoner.edb.ramstore.TupleStore
Direct Known Subclasses:
TupleStoreWithReferenceCounters

public class TupleStore extends Object
  • Field Details

    • _elementData

      public long[] _elementData
      the memory piece where all tuples are residing in a sequence
    • _elements

      public int _elements
      number of tuples
  • Constructor Details

    • TupleStore

      public TupleStore(int arity, ReasoningMonitor monitor)
    • TupleStore

      public TupleStore(int arity)
  • Method Details

    • getArity

      public int getArity()
      get the arity
      Returns:
    • sizeInBytes

      public int sizeInBytes()
      number of bytes used in main memory. Used for cache management
      Returns:
    • newTuple

      public int newTuple() throws IOException
      create a new tuple of length arity and return the address
      Returns:
      Throws:
      IOException
    • getElementData

      public long[] getElementData()
      return the data
      Returns:
    • newTuple

      public int newTuple(long[] buf) throws IOException
      create a new tuple and copy buf into that tuple and return the address
      Parameters:
      buf -
      Returns:
      Throws:
      IOException
    • newTuple

      public int newTuple(TupleBuffer buf) throws IOException
      create a new tuple and copy buf into that tuple and return the address
      Parameters:
      buf -
      Returns:
      Throws:
      IOException
    • removeTuple

      public void removeTuple(int address)
      remove a tuple at address and with a certain length
      Parameters:
      address -
    • size

      public int size()
      return the number of tuples
      Returns:
    • clear

      public void clear()
      clear the tuple store
    • getReferenceCount

      public int getReferenceCount(int t)
      returns a reference counter for tuple t
      Parameters:
      t - , tuple address
      Returns:
    • setReferenceCount

      public void setReferenceCount(int t, int count)
      set the reference count for tuple t
      Parameters:
      t - , tuple
      count - , reference count
    • incReferenceCount

      public void incReferenceCount(int t)
      increment reference count for tuple t
      Parameters:
      t - , tuple
    • decrementNGetReferenceCount

      public int decrementNGetReferenceCount(int t)
      decrement and get reference count for tuple t
      Parameters:
      t - , tuple
      Returns:
    • clone

      public TupleStore clone()
      clone a tuple store with the whole content