baobab.trace
Class SubTrace

java.lang.Object
  extended by baobab.trace.Trace
      extended by baobab.trace.SubTrace
All Implemented Interfaces:
Joinable<Trace>

public class SubTrace
extends Trace

The SubTrace class represents a subset of a trace

Author:
Marilia Dias Vieira Braga

Constructor Summary
SubTrace(int[] element, int elementSize)
          Constructs a SubTrace
SubTrace(SubTrace rule)
          Constructs a SubTrace, as a clone of a given SubTrace
 
Method Summary
 void addElement(int[] element, int elementSize, int prevNumberOfElements)
          Adds a new element to this trace
 byte[] getBytes(int elementSize, int numberOfElements)
          Produces a string representation of a trace
 int[] getConstraintScore()
           
 java.util.Vector<int[]> getElements(int elementSize, int numberOfElements)
          Decode the trace as a Vector of elements (represented as arrays of ints)
 java.util.Vector<BitList> getRepresentativeElementsAsBitLists(int elementSize, int numberOfElements)
          Decode the trace as a Vector of elements (represented as arrays of BitList)
 void join(Trace trace)
          Join (merge) the object joinable to this object
static SubTrace parse(java.lang.String description, int elementSize, int numberOfElements)
           
static SubTrace parse(java.lang.String description, int elementSize, int numberOfElements, java.util.Hashtable<java.lang.String,java.lang.Integer> mapNamesToInt)
           
static SubTrace parseBitList(byte[] list, int elementSize, int numberOfElements, int numberOfConstraints)
           
 SubTrace reverse(int elementSize, int numberOfElements)
           
 void setConstraintScore(int[] constraintScore)
           
 java.lang.String toString(int elementSize, int numberOfElements)
          Produces a string representation of a trace
 java.lang.String toString(int elementSize, int numberOfElements, java.lang.String[] mapIntToName, boolean condenseNames)
          Produces a string representation of a trace
 java.lang.String toString(int elementSize, int numberOfElements, java.lang.String[] mapIntToName, java.util.Hashtable<java.lang.String,java.util.TreeSet<java.lang.String>> mapNamesToDescriptions, boolean condenseNames)
          Produces a string representation of a trace
 
Methods inherited from class baobab.trace.Trace
getDebugElementData, getElementsAsBitLists, getHeightOf, getNumberOfOccurrences, height, incrementDebugNumberOfElements, incrementOccurrences, isEmpty, normalFormString, normalFormString, parseBitList, setDebugElementData, split, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubTrace

public SubTrace(int[] element,
                int elementSize)
Constructs a SubTrace

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

SubTrace

public SubTrace(SubTrace rule)
Constructs a SubTrace, as a clone of a given SubTrace

Parameters:
rule - the give trace
Method Detail

parse

public static SubTrace parse(java.lang.String description,
                             int elementSize,
                             int numberOfElements,
                             java.util.Hashtable<java.lang.String,java.lang.Integer> mapNamesToInt)

parse

public static SubTrace parse(java.lang.String description,
                             int elementSize,
                             int numberOfElements)

parseBitList

public static SubTrace parseBitList(byte[] list,
                                    int elementSize,
                                    int numberOfElements,
                                    int numberOfConstraints)

getElements

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

Overrides:
getElements in class Trace
Parameters:
elementSize - the maximum value for all elements
numberOfElements - the number of elements on this trace
Returns:
the resulting Vector

getRepresentativeElementsAsBitLists

public java.util.Vector<BitList> getRepresentativeElementsAsBitLists(int elementSize,
                                                                     int numberOfElements)
Decode the trace as a Vector of elements (represented as arrays of BitList)

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

addElement

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

Overrides:
addElement in class Trace
Parameters:
element - the element to be added, represented as an array of ints
elementSize - the maximum value for all elements of this trace
prevNumberOfElements - the previous number of elements on this trace

join

public void join(Trace trace)
Description copied from interface: Joinable
Join (merge) the object joinable to this object

Specified by:
join in interface Joinable<Trace>
Overrides:
join in class Trace
Parameters:
trace - the object to be joined

reverse

public SubTrace reverse(int elementSize,
                        int numberOfElements)
Overrides:
reverse in class Trace

getBytes

public byte[] getBytes(int elementSize,
                       int numberOfElements)
Produces a string representation of a trace

Overrides:
getBytes in class 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(int elementSize,
                                 int numberOfElements)
Produces a string representation of a trace

Overrides:
toString in class 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(int elementSize,
                                 int numberOfElements,
                                 java.lang.String[] mapIntToName,
                                 boolean condenseNames)
Produces a string representation of a trace

Overrides:
toString in class 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(int elementSize,
                                 int numberOfElements,
                                 java.lang.String[] mapIntToName,
                                 java.util.Hashtable<java.lang.String,java.util.TreeSet<java.lang.String>> mapNamesToDescriptions,
                                 boolean condenseNames)
Produces a string representation of a trace

Overrides:
toString in class Trace
Parameters:
elementSize - the maximum value for all elements of this trace
numberOfElements - the number of elements on this trace
Returns:
a string

getConstraintScore

public int[] getConstraintScore()

setConstraintScore

public void setConstraintScore(int[] constraintScore)