Known-Items Task Evaluation

Class Item

java.lang.Object
  |
  +--Item
Direct Known Subclasses:
KnownItem, SystemItem

public abstract class Item
extends java.lang.Object

This class represents a item as a portion of a video. A item is defined by its start and stop time and source (or video), and also by its sequence number which is its order in a bunch of results (this number should be external to this class but for convenience it's within the class).


Field Summary
protected  int matched
          Indicates if it matched with another item during a comparison.
protected  java.lang.String src
          The source of the item (or video).
protected  java.lang.String start
          The start time of the item.
protected  java.lang.String stop
          The stop time of the item.
 
Constructor Summary
Item(java.lang.String start, java.lang.String stop, java.lang.String src)
          Constructs Item object with the given parameters.
 
Method Summary
 double getMilliStart()
          Gets the start time in milliseconds as a double.
 double getMilliStop()
          Gets the stop time in milliseconds as a double.
 java.lang.String getSrc()
          Gets the video source of the item.
 java.lang.String getStart()
          Gets the start time in the defined format ("*h*m*s*ms").
 java.lang.String getStop()
          Gets the stop time in the defined format ("*h*m*s*ms").
 boolean intersected(Item t)
          Returns true if there is an intersection with the given item.
 double length()
          Gets the sequence number of the item as an integer.
 java.lang.String maxTime(java.lang.String time1, java.lang.String time2)
          Returns the greater time of two given times in the "*h*m*s*ms" format.
 double maxTimeMilli(java.lang.String time1, java.lang.String time2)
          Returns a double (milliseconds) of the greater time of two given times in the "*h*m*s*ms" format.
 java.lang.String minTime(java.lang.String time1, java.lang.String time2)
          Returns the smaller time of two given times in the "*h*m*s*ms" format.
 double minTimeMilli(java.lang.String time1, java.lang.String time2)
          Returns a double (milliseconds) of the smaller time of two given times in the "*h*m*s*ms" format.
 double toMilliseconds(java.lang.String time)
          Returns a double that represents the given time in milliseconds.
abstract  java.lang.String toString()
          Returns a Xml formatted string representation of this item and its start and stop values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

start

protected java.lang.String start
The start time of the item. Time format is "*h*m*s*ms".

stop

protected java.lang.String stop
The stop time of the item. Time format is "*h*m*s*ms".

src

protected java.lang.String src
The source of the item (or video).

matched

protected int matched
Indicates if it matched with another item during a comparison.
Constructor Detail

Item

public Item(java.lang.String start,
            java.lang.String stop,
            java.lang.String src)
     throws java.lang.Exception
Constructs Item object with the given parameters.
Parameters:
start - The start time of the item in a defined format ("*h*m*s*ms").
stop - The stop time of the item in a defined format ("*h*m*s*ms").
src - The source of the item or video that the item is part of.
seqNum - The sequence number of the item.
Throws:
TransitionDefinitionException - Thrown if the pre frame is not strictly less than the post frame.
Method Detail

getStart

public java.lang.String getStart()
Gets the start time in the defined format ("*h*m*s*ms").

getMilliStart

public double getMilliStart()
Gets the start time in milliseconds as a double.

getStop

public java.lang.String getStop()
Gets the stop time in the defined format ("*h*m*s*ms").

getMilliStop

public double getMilliStop()
Gets the stop time in milliseconds as a double.

getSrc

public java.lang.String getSrc()
Gets the video source of the item.

length

public double length()
Gets the sequence number of the item as an integer.

intersected

public boolean intersected(Item t)
Returns true if there is an intersection with the given item.

maxTime

public java.lang.String maxTime(java.lang.String time1,
                                java.lang.String time2)
                         throws java.lang.NumberFormatException
Returns the greater time of two given times in the "*h*m*s*ms" format.

minTime

public java.lang.String minTime(java.lang.String time1,
                                java.lang.String time2)
                         throws java.lang.NumberFormatException
Returns the smaller time of two given times in the "*h*m*s*ms" format.

maxTimeMilli

public double maxTimeMilli(java.lang.String time1,
                           java.lang.String time2)
                    throws java.lang.NumberFormatException
Returns a double (milliseconds) of the greater time of two given times in the "*h*m*s*ms" format.

minTimeMilli

public double minTimeMilli(java.lang.String time1,
                           java.lang.String time2)
                    throws java.lang.NumberFormatException
Returns a double (milliseconds) of the smaller time of two given times in the "*h*m*s*ms" format.

toMilliseconds

public double toMilliseconds(java.lang.String time)
                      throws java.lang.NumberFormatException
Returns a double that represents the given time in milliseconds.

toString

public abstract java.lang.String toString()
Returns a Xml formatted string representation of this item and its start and stop values. For example: ""
Overrides:
toString in class java.lang.Object

Known-Items Task Evaluation

For information over@nist.gov or rtaban@nist.gov