baobab.trace
Class TraceSortedSet
java.lang.Object
baobab.util.CompressibleSortedSet<T>
baobab.util.FreezableCompressibleSortedSet<Trace>
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
Constructor Summary |
TraceSortedSet(java.lang.String workDir,
int elementSize,
int elementsByRule,
int x,
int y,
int z,
double balance)
|
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TraceSortedSet
public TraceSortedSet(java.lang.String workDir,
int elementSize,
int elementsByRule,
int x,
int y,
int z,
double balance)
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>