baobab.trace
Class Trace

java.lang.Object
  extended by baobab.trace.Trace

public class Trace
extends java.lang.Object

The LightTraceRule class represents a trace on 1..elementSize. A trace is a precedence organized set of trace sets, which are sorted sets of trace elements. An element is a sorted set of integers on 1..elementSize. A set is a collection of compatible elements (two elements are compatibles when they do not intersect or when one contains the other).

Version:
1.0, August 2006
Author:
Marilia Dias Vieira Braga

Constructor Summary
Trace(byte[] element, int elementSize)
          Constructs a LightTraceRule
Trace(Trace rule)
          Constructs a LightTraceRule, as a clone of a given trace
 
Method Summary
 void addElement(byte[] element, int elementSize, int prevNumberOfElements)
          Adds a new element to this trace
 int[] getDebugElementData()
           
 java.util.Vector<byte[]> getElements(int elementSize, int numberOfElements)
          Decode the trace as a Vector of elements (represented as arrays of bytes)
 long getNumberOfOccurrences()
          Gets the number of occurrences of this trace
 int height(int elementSize, int numberOfElements)
           
 void incrementDebugNumberOfElements()
           
 void incrementOccurrences(long add)
          Increments the number of this trace
 void setDebugElementData(int[] debugData)
           
 java.lang.String toString()
           
 java.lang.String toString(int elementSize, int numberOfElements)
          Produces a string representation of a trace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trace

public Trace(byte[] element,
             int elementSize)
Constructs a LightTraceRule

Parameters:
element - the first element represented as an array of bytes
elementSize - the maximum value for all elements

Trace

public Trace(Trace rule)
Constructs a LightTraceRule, as a clone of a given trace

Parameters:
rule - the give trace
Method Detail

setDebugElementData

public void setDebugElementData(int[] debugData)

getDebugElementData

public int[] getDebugElementData()

incrementDebugNumberOfElements

public void incrementDebugNumberOfElements()

incrementOccurrences

public void incrementOccurrences(long add)
Increments the number of this trace

Parameters:
add - the number of occurrences to add

getNumberOfOccurrences

public long getNumberOfOccurrences()
Gets the number of occurrences of this trace

Returns:
the number of occurrences

getElements

public java.util.Vector<byte[]> getElements(int elementSize,
                                            int numberOfElements)
Decode the trace as a Vector of elements (represented as arrays of bytes)

Parameters:
elementSize - the maximum value for all elements
numberOfElements - the number of elements on this trace
Returns:
the resulting Vector

addElement

public void addElement(byte[] element,
                       int elementSize,
                       int prevNumberOfElements)
Adds a new element to this trace

Parameters:
element - the element to be added, represented as an array of bytes
elementSize - the maximum value for all elements of this trace
prevNumberOfElements - the previous number of elements on this trace

height

public int height(int elementSize,
                  int numberOfElements)

toString

public java.lang.String toString(int elementSize,
                                 int numberOfElements)
Produces a string representation of a trace

Parameters:
elementSize - the maximum value for all elements of this trace
numberOfElements - the number of elements on this trace
Returns:
a string

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object