pal.datatype
Class DataTypeUtils

java.lang.Object
  |
  +--pal.datatype.DataTypeUtils
All Implemented Interfaces:
java.io.Serializable

public class DataTypeUtils
extends java.lang.Object
implements java.io.Serializable

helper class for sequence data types.

See Also:
Serialized Form

Constructor Summary
DataTypeUtils()
           
 
Method Summary
static byte[] getByteStates(char[] sequence, DataType dt)
          For converting a sequence to an array of bytes where each byte represents the state of the corresponding character in sequence
static byte[] getByteStates(java.lang.String sequence, DataType dt)
          For converting a sequence to an array of bytes where each byte represents the state of the corresponding character in sequence
static char[][] getChars(int[][] sequences, char unknownChar, DataType dt)
          For converting an array of sequence to arrays of ints where each int represents the state of the corresponding character in sequence
static char[] getChars(int[] sequence, char unknownChar, DataType dt)
          For converting a sequence of ints representing states to an array of chars
static DataType getInstance(int typeID)
          create object according to this code
static int[] getSequenceStates(DataType d, java.lang.String sequence)
          Return states of a sequence.
static int[][] getStates(char[][] sequences, DataType dt)
          For converting an array of sequence to arrays of ints where each int represents the state of the corresponding character in sequence
static int[][] getStates(char[][] sequences, int unknownState, DataType dt)
          For converting an array of sequence to arrays of ints where each int represents the state of the corresponding character in sequence
static int[] getStates(char[] sequence, DataType dt)
          For converting a sequence to an array of ints where each int represents the state of the corresponding character in sequence
static int[] getStates(char[] sequence, int unknownState, DataType dt)
          For converting a sequence to an array of ints where each int represents the state of the corresponding character in sequence
static boolean isGap(DataType d, char c)
          returns true if the character represents a gap in the sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypeUtils

public DataTypeUtils()
Method Detail

getInstance

public static DataType getInstance(int typeID)
create object according to this code
Parameters:
typeID - selected data type
Returns:
DataType object

getSequenceStates

public static final int[] getSequenceStates(DataType d,
                                            java.lang.String sequence)
Return states of a sequence.

isGap

public static final boolean isGap(DataType d,
                                  char c)
returns true if the character represents a gap in the sequence.

getByteStates

public static final byte[] getByteStates(java.lang.String sequence,
                                         DataType dt)
For converting a sequence to an array of bytes where each byte represents the state of the corresponding character in sequence

getByteStates

public static final byte[] getByteStates(char[] sequence,
                                         DataType dt)
For converting a sequence to an array of bytes where each byte represents the state of the corresponding character in sequence

getStates

public static final int[][] getStates(char[][] sequences,
                                      DataType dt)
For converting an array of sequence to arrays of ints where each int represents the state of the corresponding character in sequence

getStates

public static final int[] getStates(char[] sequence,
                                    DataType dt)
For converting a sequence to an array of ints where each int represents the state of the corresponding character in sequence

getStates

public static final int[][] getStates(char[][] sequences,
                                      int unknownState,
                                      DataType dt)
For converting an array of sequence to arrays of ints where each int represents the state of the corresponding character in sequence
Parameters:
unknownState - ensures that the state representation is set to this value (like -1)

getStates

public static final int[] getStates(char[] sequence,
                                    int unknownState,
                                    DataType dt)
For converting a sequence to an array of ints where each int represents the state of the corresponding character in sequence

getChars

public static final char[][] getChars(int[][] sequences,
                                      char unknownChar,
                                      DataType dt)
For converting an array of sequence to arrays of ints where each int represents the state of the corresponding character in sequence
Parameters:
unknownChar - The character uses for unknown states

getChars

public static final char[] getChars(int[] sequence,
                                    char unknownChar,
                                    DataType dt)
For converting a sequence of ints representing states to an array of chars
Parameters:
unknownChar - The character uses for unknown states