Packageorg.osmf.smpte.tt.timing
Classpublic class TimeSpan
InheritanceTimeSpan Inheritance Object
Implements IComparable, IEquals

Represents an interval of time



Public Properties
 PropertyDefined By
  days : int
[read-only] Gets the number of whole days
TimeSpan
  hours : int
[read-only] Gets the number of whole hours (excluding entire days)
TimeSpan
  milliseconds : int
[read-only] Gets the number of whole milliseconds (excluding entire seconds)
TimeSpan
  minutes : int
[read-only] Gets the number of whole minutes (excluding entire hours)
TimeSpan
  seconds : int
[read-only] Gets the number of whole seconds (excluding entire minutes)
TimeSpan
  ticks : Number
[read-only] Gets the number of ticks
TimeSpan
  totalDays : Number
[read-only] Gets the total number of days.
TimeSpan
  totalHours : Number
[read-only] Gets the total number of hours.
TimeSpan
  totalMilliseconds : Number
[read-only] Gets the total number of milliseconds.
TimeSpan
  totalMinutes : Number
[read-only] Gets the total number of minutes.
TimeSpan
  totalSeconds : Number
[read-only] Gets the total number of seconds.
TimeSpan
Protected Properties
 PropertyDefined By
  _value : Number
TimeSpan
Public Methods
 MethodDefined By
  
TimeSpan(... args)
TimeSpan
  
Add a given TimeSpan to another
TimeSpan
  
addDate(date:Date):Date
Adds the timespan represented by this instance to the date provided and returns a new date object.
TimeSpan
  
[static] Compare two TimeSpan values.
TimeSpan
  
compareTo(p_value:Object):int
Compares this TimeSpan with the specified TimeSpan for order.
TimeSpan
  
Return the absolute duration of a TimeSpan value.
TimeSpan
  
equals(p_value:Object):Boolean
Tests equality for TimeSpan values
TimeSpan
  
Equals(t1:TimeSpan, t2:TimeSpan):Boolean
[static] Determine if two TimeSpan values are equal.
TimeSpan
  
fromDates(start:Date, end:Date):TimeSpan
[static] Creates a TimeSpan from the different between two dates Note that start can be after end, but it will result in negative values.
TimeSpan
  
fromDays(value:Number):TimeSpan
[static] Creates a TimeSpan from the specified number of days
TimeSpan
  
fromHours(value:Number):TimeSpan
[static] Creates a TimeSpan from the specified number of hours
TimeSpan
  
[static] Creates a TimeSpan from the specified number of milliseconds
TimeSpan
  
fromMinutes(value:Number):TimeSpan
[static] Creates a TimeSpan from the specified number of minutes
TimeSpan
  
fromSeconds(value:Number):TimeSpan
[static] Creates a TimeSpan from the specified number of seconds
TimeSpan
  
fromTicks(ticks:Number):TimeSpan
[static] Creates a TimeSpan from the specified number of ticks
TimeSpan
  
Get the hash code for this instance.
TimeSpan
  
Subtract a given TimeSpan from another.
TimeSpan
  
Negate a TimeSpan value.
TimeSpan
  
parse(p_expression:String):TimeSpan
[static] Parse a string into a TimeSpan value.
TimeSpan
  
Add a given TimeSpan to another
TimeSpan
  
Subtract TimeSpan values.
TimeSpan
  
toString():String
TimeSpan
Public Constants
 ConstantDefined By
  MAX_VALUE : TimeSpan
[static]
TimeSpan
  MILLISECONDS_PER_DAY : Number = 86400000
[static] The number of milliseconds in one day
TimeSpan
  MILLISECONDS_PER_HOUR : Number = 3600000
[static] The number of milliseconds in one hour
TimeSpan
  MILLISECONDS_PER_MINUTE : Number = 60000
[static] The number of milliseconds in one minute
TimeSpan
  MILLISECONDS_PER_SECOND : Number = 1000
[static] The number of milliseconds in one second
TimeSpan
  MIN_VALUE : TimeSpan
[static]
TimeSpan
  TICKS_PER_DAY : Number = 864000000000
[static] The number of ticks in one day
TimeSpan
  TICKS_PER_HOUR : Number = 36000000000
[static] The number of ticks in one hour
TimeSpan
  TICKS_PER_MILLISECOND : Number = 10000
[static] The number of ticks in one millisecond
TimeSpan
  TICKS_PER_MINUTE : Number = 600000000
[static] The number of ticks in one minute
TimeSpan
  TICKS_PER_SECOND : Number = 10000000
[static] The number of ticks in one second
TimeSpan
  ZERO : TimeSpan
[static]
TimeSpan
Property Detail
_valueproperty
protected var _value:Number

daysproperty 
days:int  [read-only]

Gets the number of whole days


Implementation
    public function get days():int
hoursproperty 
hours:int  [read-only]

Gets the number of whole hours (excluding entire days)


Implementation
    public function get hours():int
millisecondsproperty 
milliseconds:int  [read-only]

Gets the number of whole milliseconds (excluding entire seconds)


Implementation
    public function get milliseconds():int
minutesproperty 
minutes:int  [read-only]

Gets the number of whole minutes (excluding entire hours)


Implementation
    public function get minutes():int
secondsproperty 
seconds:int  [read-only]

Gets the number of whole seconds (excluding entire minutes)


Implementation
    public function get seconds():int
ticksproperty 
ticks:Number  [read-only]

Gets the number of ticks


Implementation
    public function get ticks():Number
totalDaysproperty 
totalDays:Number  [read-only]

Gets the total number of days.


Implementation
    public function get totalDays():Number
totalHoursproperty 
totalHours:Number  [read-only]

Gets the total number of hours.


Implementation
    public function get totalHours():Number
totalMillisecondsproperty 
totalMilliseconds:Number  [read-only]

Gets the total number of milliseconds.


Implementation
    public function get totalMilliseconds():Number
totalMinutesproperty 
totalMinutes:Number  [read-only]

Gets the total number of minutes.


Implementation
    public function get totalMinutes():Number
totalSecondsproperty 
totalSeconds:Number  [read-only]

Gets the total number of seconds.


Implementation
    public function get totalSeconds():Number
Constructor Detail
TimeSpan()Constructor
public function TimeSpan(... args)



Parameters
... args
Method Detail
add()method
public function add(ts:TimeSpan):TimeSpan

Add a given TimeSpan to another

Parameters

ts:TimeSpan

Returns
TimeSpan
addDate()method 
public function addDate(date:Date):Date

Adds the timespan represented by this instance to the date provided and returns a new date object.

Parameters

date:Date — The date to add the timespan to

Returns
Date — A new Date with the offseted time
Compare()method 
public static function Compare(t1:TimeSpan, t2:TimeSpan):int

Compare two TimeSpan values.

Parameters

t1:TimeSpan — the first TimeSpan to compare
 
t2:TimeSpan — the second TimeSpan to compare

Returns
int
compareTo()method 
public function compareTo(p_value:Object):int

Compares this TimeSpan with the specified TimeSpan for order. Returns a negative integer, zero, or a positive integer as this TimeSpan is less than, equal to, or greater than the specified TimeSpan.

Parameters

p_value:Object — other TimeSpan to be compared

Returns
int — a negative integer, zero, or a positive integer as this TimeSpan is less than, equal to, or greater than the specified TimeSpan.
duration()method 
public function duration():TimeSpan

Return the absolute duration of a TimeSpan value.

Returns
TimeSpan
equals()method 
public function equals(p_value:Object):Boolean

Tests equality for TimeSpan values

Parameters

p_value:Object — the TimeSpan to compare to this TimeSpan for equality

Returns
Boolean
Equals()method 
public static function Equals(t1:TimeSpan, t2:TimeSpan):Boolean

Determine if two TimeSpan values are equal.

Parameters

t1:TimeSpan — the first TimeSpan to compare
 
t2:TimeSpan — the second TimeSpan to compare

Returns
Boolean
fromDates()method 
public static function fromDates(start:Date, end:Date):TimeSpan

Creates a TimeSpan from the different between two dates Note that start can be after end, but it will result in negative values.

Parameters

start:Date — The start date of the timespan
 
end:Date — The end date of the timespan

Returns
TimeSpan — A TimeSpan that represents the difference between the dates
fromDays()method 
public static function fromDays(value:Number):TimeSpan

Creates a TimeSpan from the specified number of days

Parameters

value:Number — The number of days in the timespan

Returns
TimeSpan — A TimeSpan that represents the specified value
fromHours()method 
public static function fromHours(value:Number):TimeSpan

Creates a TimeSpan from the specified number of hours

Parameters

value:Number — The number of hours in the timespan

Returns
TimeSpan — A TimeSpan that represents the specified value
fromMilliseconds()method 
public static function fromMilliseconds(value:Number):TimeSpan

Creates a TimeSpan from the specified number of milliseconds

Parameters

value:Number — The number of milliseconds in the timespan

Returns
TimeSpan — A TimeSpan that represents the specified value
fromMinutes()method 
public static function fromMinutes(value:Number):TimeSpan

Creates a TimeSpan from the specified number of minutes

Parameters

value:Number — The number of minutes in the timespan

Returns
TimeSpan — A TimeSpan that represents the specified value
fromSeconds()method 
public static function fromSeconds(value:Number):TimeSpan

Creates a TimeSpan from the specified number of seconds

Parameters

value:Number — The number of seconds in the timespan

Returns
TimeSpan — A TimeSpan that represents the specified value
fromTicks()method 
public static function fromTicks(ticks:Number):TimeSpan

Creates a TimeSpan from the specified number of ticks

Parameters

ticks:Number — The number of ticks in the timespan

Returns
TimeSpan — A TimeSpan that represents the specified value
getHashCode()method 
public function getHashCode():int

Get the hash code for this instance.

Returns
int
minus()method 
public function minus(ts:TimeSpan):TimeSpan

Subtract a given TimeSpan from another.

Parameters

ts:TimeSpan

Returns
TimeSpan
negate()method 
public function negate():TimeSpan

Negate a TimeSpan value.

Returns
TimeSpan
parse()method 
public static function parse(p_expression:String):TimeSpan

Parse a string into a TimeSpan value.

Parameters

p_expression:String

Returns
TimeSpan
plus()method 
public function plus(ts:TimeSpan):TimeSpan

Add a given TimeSpan to another

Parameters

ts:TimeSpan

Returns
TimeSpan
subtract()method 
public function subtract(ts:TimeSpan):TimeSpan

Subtract TimeSpan values.

Parameters

ts:TimeSpan

Returns
TimeSpan
toString()method 
public function toString():String

Returns
String
Constant Detail
MAX_VALUEConstant
public static const MAX_VALUE:TimeSpan

MILLISECONDS_PER_DAYConstant 
public static const MILLISECONDS_PER_DAY:Number = 86400000

The number of milliseconds in one day

MILLISECONDS_PER_HOURConstant 
public static const MILLISECONDS_PER_HOUR:Number = 3600000

The number of milliseconds in one hour

MILLISECONDS_PER_MINUTEConstant 
public static const MILLISECONDS_PER_MINUTE:Number = 60000

The number of milliseconds in one minute

MILLISECONDS_PER_SECONDConstant 
public static const MILLISECONDS_PER_SECOND:Number = 1000

The number of milliseconds in one second

MIN_VALUEConstant 
public static const MIN_VALUE:TimeSpan

TICKS_PER_DAYConstant 
public static const TICKS_PER_DAY:Number = 864000000000

The number of ticks in one day

TICKS_PER_HOURConstant 
public static const TICKS_PER_HOUR:Number = 36000000000

The number of ticks in one hour

TICKS_PER_MILLISECONDConstant 
public static const TICKS_PER_MILLISECOND:Number = 10000

The number of ticks in one millisecond

TICKS_PER_MINUTEConstant 
public static const TICKS_PER_MINUTE:Number = 600000000

The number of ticks in one minute

TICKS_PER_SECONDConstant 
public static const TICKS_PER_SECOND:Number = 10000000

The number of ticks in one second

ZEROConstant 
public static const ZERO:TimeSpan