algo
Class GroovyEditorFunctions

java.lang.Object
  extended by algo.GroovyEditorFunctions

public final class GroovyEditorFunctions
extends java.lang.Object

This class provide methods whose names are easily understandable, and that can be used directly in the textArea of the script editor window.


Constructor Summary
private GroovyEditorFunctions()
          GroovyEditorFunctions is non-instantiable.
 
Method Summary
static java.util.Vector<java.util.Vector<java.lang.Double>> getAllDataAtTime(HoloSDIFdata sdifdata, double time)
          Returns the values corresponding to the given time if the given time is equal to a key of the holoSDIFdata's sdiftreeMap.
static java.lang.Object[] getAllTime(HoloSDIFdata sdifdata)
          Returns an array of double values corresponding to the frame times of the sdifdata, and listed in natural order.
static int getBeginDate(GestionPistes gp)
          Returns the date at which the score selection begins.
static int getDuration(GestionPistes gp)
          Returns the length of the score selection.
static int getEndDate(GestionPistes gp)
          Returns the date at which the score selection is ending.
static HoloSDIFdata getSDIFdata(GestionPistes gp, java.lang.String sdifdataDesc)
          Returns the holoSDIFdata that corresponds to the given description sdifdataDesc.
static double getTimesCount(HoloSDIFdata sdifdata)
          Returns the number of time samples that are contained by the given HoloSDIFdata.
static double maxFieldValue(HoloSDIFdata sdifdata, int fieldIndex)
          Returns the largest value obtained from the sdifdata for the field corresponding to the given fieldIndex
static double meanFieldValue(HoloSDIFdata sdifdata, int fieldIndex)
          Returns the mean value obtained from the sdifdata's field that corresponds to the given fieldIndex
static double minFieldValue(HoloSDIFdata sdifdata, int fieldIndex)
          Returns the smallest value obtained from the sdifdata for the field corresponding to the given fieldIndex
static double random()
          Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.
static double rangeFieldValue(HoloSDIFdata sdifdata, int fieldIndex)
          Returns the range (i.e. maxValue-minValue) of the sdifdata's field that corresponds to the given fieldIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyEditorFunctions

private GroovyEditorFunctions()
GroovyEditorFunctions is non-instantiable.

Method Detail

getAllDataAtTime

public static java.util.Vector<java.util.Vector<java.lang.Double>> getAllDataAtTime(HoloSDIFdata sdifdata,
                                                                                    double time)
Returns the values corresponding to the given time if the given time is equal to a key of the holoSDIFdata's sdiftreeMap.\n If the given time is not equal to a key, it returns a linear interpolation of the values corresponding to the two closest key.\n 'null' is returned if the sdifTreeMap is empty or if the time we look for is out of the treeMap keyset range.


getAllTime

public static java.lang.Object[] getAllTime(HoloSDIFdata sdifdata)
Returns an array of double values corresponding to the frame times of the sdifdata, and listed in natural order.

Parameters:
sdifdata -
Returns:
an array containing all the times of the holoSDIFdata, ranged in natural order.

minFieldValue

public static double minFieldValue(HoloSDIFdata sdifdata,
                                   int fieldIndex)
Returns the smallest value obtained from the sdifdata for the field corresponding to the given fieldIndex. *

Parameters:
sdifdata -
fieldIndex -
Returns:
the smallest value obtained from the given sdifdata for the specified field.

maxFieldValue

public static double maxFieldValue(HoloSDIFdata sdifdata,
                                   int fieldIndex)
Returns the largest value obtained from the sdifdata for the field corresponding to the given fieldIndex. *

Parameters:
sdifdata -
fieldIndex -
Returns:
the largest value obtained from the given sdifdata for the specified field.

meanFieldValue

public static double meanFieldValue(HoloSDIFdata sdifdata,
                                    int fieldIndex)
Returns the mean value obtained from the sdifdata's field that corresponds to the given fieldIndex. *

Parameters:
sdifdata -
fieldIndex -
Returns:
the mean value obtained from the given sdifdata for the specified field.

rangeFieldValue

public static double rangeFieldValue(HoloSDIFdata sdifdata,
                                     int fieldIndex)
Returns the range (i.e. maxValue-minValue) of the sdifdata's field that corresponds to the given fieldIndex. *

Parameters:
sdifdata -
fieldIndex -
Returns:
a double value giving the range of the specified field of the specified holoSDIFdata.

getTimesCount

public static double getTimesCount(HoloSDIFdata sdifdata)
Returns the number of time samples that are contained by the given HoloSDIFdata.

Parameters:
sdifdata -
Returns:
the number of time samples contained by the given holoSDIFdata.

random

public static double random()
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returned values are chosen pseudorandomly with (approximately) uniform distribution from that range.

Returns:
a pseudorandom double greater than or equal to 0.0 and less than 1.0.

getSDIFdata

public static HoloSDIFdata getSDIFdata(GestionPistes gp,
                                       java.lang.String sdifdataDesc)
Returns the holoSDIFdata that corresponds to the given description sdifdataDesc.

Parameters:
gp -
sdifdataDesc - the description of an holoSDIFdata located in the score.
Returns:
the holoSDIFdata that corresponds to the given description.

getBeginDate

public static int getBeginDate(GestionPistes gp)
Returns the date at which the score selection begins. Usage in scriptFile : int dateBegin = getBeginDate(gp); (do no pay attention to the 'gp' parameter).

Parameters:
gp -
Returns:
the date at which the score selection begins.

getEndDate

public static int getEndDate(GestionPistes gp)
Returns the date at which the score selection is ending. Usage in scriptFile : int endDate = getEndDate(gp); (do no pay attention to the 'gp' parameter).

Parameters:
gp -
Returns:
the date at which the score selection is ending.

getDuration

public static int getDuration(GestionPistes gp)
Returns the length of the score selection. Usage in scriptFile : int dur = getDuration(gp); (do no pay attention to the 'gp' parameter).

Parameters:
gp -
Returns:
the length of the score selection.