wpi.timesequence
Class TSUtility

java.lang.Object
  extended bywpi.timesequence.TSUtility

public class TSUtility
extends java.lang.Object

This class contains methods for manipulating time sequence attributes and events.

Version:
$Revision: 0.9 $
Author:
Keith A. Pray (kap@wpi.edu)

Field Summary
private static int debug
          Specifies debug info level 0: no debug info 1: input to methods 2: and output from methods 3: and all sorts of stuff
static double DISTANCE_TOLERANCE
          Distance at which two points in time can be considered the same.
static char SET_BEGIN
           
static char SET_DELIMITER
          The delimiters to use for sets of events
static char SET_END
           
static java.lang.String TIME_LINE_NAME
          The name of the data set attribute representing the time line for an instance.
static char TIME_SEQUENCE_DELIMITER
          The delimiters to use for time sequence values
 
Constructor Summary
TSUtility()
           
 
Method Summary
static java.lang.String[] getEvents(java.lang.String v)
          Parses a time sequence event set attribute's value into individual values (events).
static java.lang.String[] getNominalValues(java.lang.String v)
          Parses a time sequence attribute's value into individual nominal values.
static double[] getValues(java.lang.String v)
          Parses a time sequence attribute's value into individual values.
static boolean isTimeSequence(java.lang.String v)
          Tests if the value is a time sequence.
static boolean isTimeSequenceEvent(java.lang.String v)
          Tests if the value is a time sequence event.
static boolean isTimeSequenceEventSet(java.lang.String v)
          Tests if the value is a set of time sequence events.
static void main(java.lang.String[] argv)
          Main method for testing this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_SEQUENCE_DELIMITER

public static char TIME_SEQUENCE_DELIMITER
The delimiters to use for time sequence values


SET_DELIMITER

public static char SET_DELIMITER
The delimiters to use for sets of events


SET_BEGIN

public static char SET_BEGIN

SET_END

public static char SET_END

TIME_LINE_NAME

public static java.lang.String TIME_LINE_NAME
The name of the data set attribute representing the time line for an instance.


DISTANCE_TOLERANCE

public static double DISTANCE_TOLERANCE
Distance at which two points in time can be considered the same. The value is absolute since a percentage requires knowing the total length of the time scale. The default value assumes a time unit of seconds.


debug

private static final int debug
Specifies debug info level 0: no debug info 1: input to methods 2: and output from methods 3: and all sorts of stuff

See Also:
Constant Field Values
Constructor Detail

TSUtility

public TSUtility()
Method Detail

getNominalValues

public static java.lang.String[] getNominalValues(java.lang.String v)
Parses a time sequence attribute's value into individual nominal values. Missing values are mapped to ?.

Parameters:
v - the instance from which the value will come
Returns:
an array of values as strings

getValues

public static double[] getValues(java.lang.String v)
Parses a time sequence attribute's value into individual values. Non-numeric are mapped to NaN. Missing values are mapped to 0.

Parameters:
v - the instance from which the value will come
Returns:
an array of values

getEvents

public static java.lang.String[] getEvents(java.lang.String v)
Parses a time sequence event set attribute's value into individual values (events).

Parameters:
v - the string value to parse
Returns:
an array of event values, null if v not an event set

isTimeSequence

public static boolean isTimeSequence(java.lang.String v)
Tests if the value is a time sequence. Any value with set delimiters will NOT be interpreted as a time sequence.

Parameters:
v - the value to test
Returns:
true if the value is a time sequence, false otherwise

isTimeSequenceEvent

public static boolean isTimeSequenceEvent(java.lang.String v)
Tests if the value is a time sequence event. The value of a time sequence event is a time sequence with only two values.

Parameters:
v - the value to test
Returns:
true if the value is a time sequence event, false otherwise

isTimeSequenceEventSet

public static boolean isTimeSequenceEventSet(java.lang.String v)
Tests if the value is a set of time sequence events. The value of a time sequence event is a time sequence with only two values. A set uses a set delimiter to seperate the events in a string. Note: A set can have a single element.

Parameters:
v - the value to test
Returns:
true if the value is a set of time sequence events, false otherwise

main

public static void main(java.lang.String[] argv)
Main method for testing this class.

Parameters:
argv -