baobab.trace
Class SubTraceCoder
java.lang.Object
baobab.trace.TraceCoder
baobab.trace.SubTraceCoder
- All Implemented Interfaces:
- Coder<Trace>
public class SubTraceCoder
- extends TraceCoder
The SubTraceCoder class codifies a subtrace as a bidimensional array of bytes.
- Author:
- Marilia Dias Vieira Braga
Method Summary |
byte[][] |
code(SubTrace decoded)
|
int[] |
code(SubTrace decoded,
byte[][] coded,
int pos0,
int pos1,
int pos2,
int pos3)
|
byte[][] |
code(java.util.Vector<Trace> rules)
Codes a vector of objects as a bidimensional array of bytes. |
SubTrace |
decode(byte[][] coded)
|
java.util.Vector<Trace> |
decode(byte[][] codedElement,
int numberOfCodedTraces)
Decodes a bidimensional array of bytes as a vector of objects. |
SubTrace |
decode(byte[][] coded,
int pos0,
int len0,
int pos1,
int len1,
int pos2,
int len2,
int pos3,
int len3)
|
int |
getCodedArrayLength()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
code
public byte[][] code(SubTrace decoded)
decode
public SubTrace decode(byte[][] coded)
- Overrides:
decode
in class TraceCoder
code
public int[] code(SubTrace decoded,
byte[][] coded,
int pos0,
int pos1,
int pos2,
int pos3)
decode
public SubTrace decode(byte[][] coded,
int pos0,
int len0,
int pos1,
int len1,
int pos2,
int len2,
int pos3,
int len3)
code
public byte[][] code(java.util.Vector<Trace> rules)
- Description copied from interface:
Coder
- Codes a vector of objects as a bidimensional array of bytes.
If this coder is used by a
CompressibleSortedSet, it is better to code the objects as few long chains
(arrays) of bytes instead of many short chains (arrays). Also, it is
important to code objects in the order they appear in the Vector, so
that they can be decoded in the same order.
- Specified by:
code
in interface Coder<Trace>
- Overrides:
code
in class TraceCoder
- Parameters:
rules
- A vector of objects
- Returns:
- the coded objects as an array of bytes
decode
public java.util.Vector<Trace> decode(byte[][] codedElement,
int numberOfCodedTraces)
- Description copied from interface:
Coder
- Decodes a bidimensional array of bytes as a vector of objects.
- Specified by:
decode
in interface Coder<Trace>
- Overrides:
decode
in class TraceCoder
- Parameters:
codedElement
- the coded objects as a bidimensional array of bytesnumberOfCodedTraces
- the number of objects that are coded
- Returns:
- a vector with the decoded objects
getCodedArrayLength
public int getCodedArrayLength()
- Specified by:
getCodedArrayLength
in interface Coder<Trace>
- Overrides:
getCodedArrayLength
in class TraceCoder