baobab.bio.permutation.counter
Class PermutationCounter

java.lang.Object
  extended by baobab.bio.permutation.counter.PermutationCounter
All Implemented Interfaces:
Joinable<PermutationCounter>

public class PermutationCounter
extends java.lang.Object
implements Joinable<PermutationCounter>

Author:
Marilia Dias Vieira Braga

Constructor Summary
PermutationCounter(int[] permutation, long numberOfOccurrences)
          Constructs a PermutationCounter
 
Method Summary
 long getNumberOfOccurrences()
          Gets the number of occurrences of this trace
 int[] getPermutation()
           
 java.lang.String getPermutationAsString()
          Produces a string representation of a permutation counter
 void incrementOccurrences(long add)
          Increments the number of occurrences this permutation
 boolean isEmpty()
          Tests whether this joinable object is empty
 void join(PermutationCounter counter)
          Join (merge) the object joinable to this object
 void split(PermutationCounter counter)
          Split the object joinable from this object
 java.lang.String toString()
          Produces a string representation of a permutation counter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PermutationCounter

public PermutationCounter(int[] permutation,
                          long numberOfOccurrences)
Constructs a PermutationCounter

Parameters:
permutation - the permutation
numberOfOccurrences - the number of occurrences
Method Detail

incrementOccurrences

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

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

getPermutation

public int[] getPermutation()

toString

public java.lang.String toString()
Produces a string representation of a permutation counter

Overrides:
toString in class java.lang.Object
Returns:
a string

getPermutationAsString

public java.lang.String getPermutationAsString()
Produces a string representation of a permutation counter

Returns:
a string

join

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

Specified by:
join in interface Joinable<PermutationCounter>
Parameters:
counter - the object to be joined

split

public void split(PermutationCounter counter)
Description copied from interface: Joinable
Split the object joinable from this object

Specified by:
split in interface Joinable<PermutationCounter>
Parameters:
counter - the object to be splitted

isEmpty

public boolean isEmpty()
Description copied from interface: Joinable
Tests whether this joinable object is empty

Specified by:
isEmpty in interface Joinable<PermutationCounter>
Returns:
true/false