baobab.trace
Class TraceSortedSet

java.lang.Object
  extended by baobab.util.CompressibleSortedSet<T>
      extended by baobab.util.FreezableCompressibleSortedSet<Trace>
          extended by baobab.trace.TraceSortedSet
Direct Known Subclasses:
SubTraceSortedSet

public class TraceSortedSet
extends FreezableCompressibleSortedSet<Trace>

The TraceSortedSet class represents a sorted set of traces (all traces have the same number of elements). The intern organization of this set allows automatic compression of its data.

Author:
Marilia Dias Vieira Braga

Field Summary
 
Fields inherited from class baobab.util.CompressibleSortedSet
BLOCK_SPLIT_BALANCE, MAXIMUM_NUMBER_OF_ELEMENTS_BY_COMPRESSIBLE_BLOCK, MAXIMUM_NUMBER_OF_UNCOMPRESSED_BLOCKS_FOR_AUTOMATIC_COMPRESSION, MAXIMUM_PENDING_INSERTION_DELETION_LIST_FOR_COMPRESSED_BLOCK
 
Constructor Summary
TraceSortedSet(java.lang.String workDir, int elementSize, int elementsByRule, int x, int y, int z, double balance)
           
 
Method Summary
 int addElement(Trace trace)
          Add an element to this set (in general, additions are not processed one by one, but accumulated and then processed in batch mode, from time to time or when the set is resolved).
 void clear(boolean bk)
          Removes all elements in this set
 long freezeUntilHeight(int newFrozenHeight, boolean release)
           
 Trace getMinimumTraceWithHeight(int height)
           
 long[] getSolutionsByHeight()
           
 int[] getTracesByHeight()
           
 int[] getTracesByWidth()
           
 int removeElement(Trace trace)
          Remove an element from this set (in general, removals are not processed one by one, but accumulated and then processed in batch mode, from time to time or when the set is resolved).
 void setSolutionsByHeight(long[] solutionsByHeight)
           
 void setTracesByHeight(int[] tracesByHeight)
           
 void setTracesByWidth(int[] tracesByWidth)
           
 
Methods inherited from class baobab.util.FreezableCompressibleSortedSet
descendingIterator, firstElement, freeze, freeze, freezeAfterElement, freezeAfterElement, freezeUntilElement, freezeUntilElement, hasRestored, iterator, lastElement, removeFirstFrozen, removeLastFrozen, restore, restoreNext, toString, unfreeze
 
Methods inherited from class baobab.util.CompressibleSortedSet
clear, flushLastDecompressionResult, isEmpty, isResolved, notResolvedSize, resolve, resolvedSize, searchElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TraceSortedSet

public TraceSortedSet(java.lang.String workDir,
                      int elementSize,
                      int elementsByRule,
                      int x,
                      int y,
                      int z,
                      double balance)
Method Detail

addElement

public int addElement(Trace trace)
Description copied from class: CompressibleSortedSet
Add an element to this set (in general, additions are not processed one by one, but accumulated and then processed in batch mode, from time to time or when the set is resolved).

When this addition is processed, if element is Joinable, and an object equivalent to element is already present in this set, element is joined to the object.

Overrides:
addElement in class CompressibleSortedSet<Trace>
Parameters:
trace - the element to be added
Returns:
the result of adding (zero can mean that the addition was put in the pending list; if a decompression was forced and a batch of insertions/removals is processed, result can be more than one, or negative)

removeElement

public int removeElement(Trace trace)
Description copied from class: CompressibleSortedSet
Remove an element from this set (in general, removals are not processed one by one, but accumulated and then processed in batch mode, from time to time or when the set is resolved).

When this removal is processed, if element is Joinable, and an object equivalent to element is present in this set, element is splitted from this object; if the resulting object is empty, it is removed from the set.

Overrides:
removeElement in class CompressibleSortedSet<Trace>
Parameters:
trace - the element to be removed
Returns:
the result of the removal (zero can mean that the removal was just put in the pending list; if a decompression was forced and a batch of insertions/removals is processed, result can be less than -1, or positive)

getMinimumTraceWithHeight

public Trace getMinimumTraceWithHeight(int height)

freezeUntilHeight

public long freezeUntilHeight(int newFrozenHeight,
                              boolean release)

getSolutionsByHeight

public long[] getSolutionsByHeight()

setSolutionsByHeight

public void setSolutionsByHeight(long[] solutionsByHeight)

getTracesByHeight

public int[] getTracesByHeight()

setTracesByHeight

public void setTracesByHeight(int[] tracesByHeight)

getTracesByWidth

public int[] getTracesByWidth()

setTracesByWidth

public void setTracesByWidth(int[] tracesByWidth)

clear

public void clear(boolean bk)
Removes all elements in this set

Overrides:
clear in class FreezableCompressibleSortedSet<Trace>