holoedit.functions
Class ScriptEditorFunctions

java.lang.Object
  extended by holoedit.functions.ScriptEditorFunctions

public final class ScriptEditorFunctions
extends java.lang.Object

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


Field Summary
static GestionPistes[] gp
           
 
Constructor Summary
private ScriptEditorFunctions()
          ScriptEditorFunctions is non-instantiable.
 
Method Summary
static java.util.Vector<java.util.Vector<java.lang.Double>> getAllDataAtTime(SDIFdataInstance sdifdata, double scoreTime)
          Returns the values corresponding to the given SCORE time in ms if the given time is equal to a key of the holoSDIFdata's map.
static int getBeginDate()
          Returns the date at which the score selection begins.
static int getDuration()
          Returns the length of the score selection.
static int getEndDate()
          Returns the date at which the score selection is ending.
static java.util.Vector<java.lang.Double> getFieldAtTime(SDIFdataInstance sdifdata, double scoreTime, int fieldIndex)
          Returns The field corresponding to the given field index at the given SCORE time in ms if the given time is equal to a key of the holoSDIFdata's map.
static SDIFdataInstance getSDIFdata(java.lang.String sdifdataDesc)
          Returns the holoSDIFdata that corresponds to the given description sdifdataDesc.
static java.lang.Double[] getTimes(SDIFdataInstance sdifdata)
          Returns an array of double values corresponding to the frame times of the given sdifdata, and listed in natural order.
static double getTimesCount(SDIFdataInstance sdifdata)
          Returns the number of time samples that are contained by the given HoloSDIFdata.
static HoloPoint getTrajectoryPoint(int pointIndex)
          Returns A point of the selected trajectory, according to the given index.
static int getTrajectorySize()
          Returns The number of points of the selected trajectory.
static boolean hasDataAtTime(SDIFdataInstance sdifdata, double time)
           
static int howManyDataAtTime(SDIFdataInstance sdifdata, double scoreTime)
          Returns the number of values contained by the sdifdata at the given SCORE time in ms
static double maxFieldValue(SDIFdataInstance sdifdata, int fieldIndex)
          Returns the largest value obtained from the sdifdata's field that corresponds to the given fieldIndex.
static double meanFieldValue(SDIFdataInstance sdifdata, int fieldIndex)
          Returns the mean value obtained from the sdifdata's field that corresponds to the given fieldIndex.
static double minFieldValue(SDIFdataInstance sdifdata, int fieldIndex)
          Returns the smallest value obtained from the sdifdata for the field corresponding to the given fieldIndex.
static double rangeFieldValue(SDIFdataInstance 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
 

Field Detail

gp

public static GestionPistes[] gp
Constructor Detail

ScriptEditorFunctions

private ScriptEditorFunctions()
ScriptEditorFunctions is non-instantiable.

Method Detail

getSDIFdata

public static SDIFdataInstance getSDIFdata(java.lang.String sdifdataDesc)
Returns the holoSDIFdata that corresponds to the given description sdifdataDesc.

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

getAllDataAtTime

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


getFieldAtTime

public static java.util.Vector<java.lang.Double> getFieldAtTime(SDIFdataInstance sdifdata,
                                                                double scoreTime,
                                                                int fieldIndex)
Returns The field corresponding to the given field index at the given SCORE time in ms if the given time is equal to a key of the holoSDIFdata's map.
If the given time is not equal to a key, it returns a linear interpolation of the field values corresponding to the two closest key.
'null' is returned if the sdifTreeMap is empty or if the time we look for is out of the map keyset range.


howManyDataAtTime

public static int howManyDataAtTime(SDIFdataInstance sdifdata,
                                    double scoreTime)
Returns the number of values contained by the sdifdata at the given SCORE time in ms


getTimes

public static java.lang.Double[] getTimes(SDIFdataInstance sdifdata)
Returns an array of double values corresponding to the frame times of the given sdifdata, and listed in natural order.

Returns:
An array containing all the times of the holoSDIFdata, listed in natural order.

hasDataAtTime

public static boolean hasDataAtTime(SDIFdataInstance sdifdata,
                                    double time)
Returns:
A boolean if time is within range of the treeMap keyset

getTimesCount

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

Returns:
The number of time samples contained by the given holoSDIFdata.

minFieldValue

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


maxFieldValue

public static double maxFieldValue(SDIFdataInstance sdifdata,
                                   int fieldIndex)
Returns the largest value obtained from the sdifdata's field that corresponds to the given fieldIndex.


meanFieldValue

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


rangeFieldValue

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

Returns:
A double value giving the range of the specified field of the specified holoSDIFdata.

getBeginDate

public static int getBeginDate()
Returns the date at which the score selection begins.
Usage in a script :
int dateBegin = getBeginDate(gp);

Returns:
The date at which the score selection begins.

getEndDate

public static int getEndDate()
Returns the date at which the score selection is ending.
Usage in a script :
int endDate = getEndDate(gp);

Returns:
The date at which the score selection is ending.

getDuration

public static int getDuration()
Returns the length of the score selection.
Usage in a script :
int dur = getDuration(gp);

Returns:
The length of the score selection.

getTrajectoryPoint

public static HoloPoint getTrajectoryPoint(int pointIndex)
Returns A point of the selected trajectory, according to the given index. The trackNumber is defined by the ComboBoxes of the left panel of the ScriptEditor Window.

Parameters:
pointIndex - Index of the point.
Returns:
A point of the selected trajectory.

getTrajectorySize

public static int getTrajectorySize()
Returns The number of points of the selected trajectory. The trackNumber is defined by the ComboBoxes of the left panel of the ScriptEditor Window.

Returns:
How many points are contained by the selected part of a trajectory.