org.drools.time
Class TimeUtils

java.lang.Object
  extended by org.drools.time.TimeUtils

public class TimeUtils
extends Object

A helper class with utility methods for time related operations.


Constructor Summary
TimeUtils()
           
 
Method Summary
static Interval[][] calculateTemporalDistance(Interval[][] constraintMatrix)
          This method calculates the transitive closure of the given adjacency matrix in order to find the temporal distance between each event represented in the adjacency matrix.
static long parseTimeString(String time)
          Parses the given time String and returns the corresponding time in milliseconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeUtils

public TimeUtils()
Method Detail

calculateTemporalDistance

public static Interval[][] calculateTemporalDistance(Interval[][] constraintMatrix)
This method calculates the transitive closure of the given adjacency matrix in order to find the temporal distance between each event represented in the adjacency matrix. For more information on the calculation of the temporal distance, please refer to the paper: "Discarding Unused Temporal Information in a Production System", by Dan Teodosiu and Gunter Pollak. This method also uses an adaptation of the Floyd-Warshall algorithm to calculate the transitive closure of the interval matrix. More information can be found here: http://en.wikipedia.org/wiki/Floyd-Warshall_algorithm The adaptation of the algorithm follows the definition of the path addition and path intersection operations as defined in the paper previously mentioned. The algorithm runs in O(n^3).

Parameters:
constraintMatrix - the starting adjacency matrix
Returns:
the resulting temporal distance matrix

parseTimeString

public static long parseTimeString(String time)
Parses the given time String and returns the corresponding time in milliseconds

Parameters:
time -
Returns:
Throws:
NullPointerException - if time is null


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.