User Tools

Site Tools


DzTimeRange

Represents an interval of time with a beginning and an end.

More...

Inherits :

Properties

DAZ Script
DzTimeend
DzTimestart

Constructors

DAZ Script
DzTimeRange ()
DzTimeRange ( String range )
DzTimeRange ( DzTimeRange range )
DzTimeRange ( DzTime start, DzTime end )

Methods

DAZ Script
voidadd ( DzTime time )
voidextendEndsBy ( DzTime time )
DzTimegetDuration ()
voidinclude ( DzTime time )
voidinclude ( DzTimeRange range )
voidintersect ( DzTimeRange range )
BooleanisEmpty ()
BooleanisIncluded ( DzTime time )
BooleanisIncluded ( DzTimeRange range )
voidmakeEmpty ()
Booleanoverlaps ( DzTimeRange range )
voidsubtract ( DzTime time )
StringtoString ()

Detailed Description

TODO: Add detailed description.

Properties


DzTime : end

The end of this time range.


DzTime : start

The start of this time range.

Constructors


DzTimeRange()

Default Constructor. Creates the time range [DZ_MIN_TIME,DZ_MAX_TIME]


DzTimeRange( String range )

Creates a time range by parsing a string.

Parameter(s):

  • range - A string representation of the time range in the form "[ start, end ]"

DzTimeRange( DzTimeRange range )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


DzTimeRange( DzTime start, DzTime end )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Methods


void : add( DzTime time )

Adds the given amount of time to both ends of this range.

Parameter(s):

  • time - The amount of time to add.

void : extendEndsBy( DzTime time )

Extends the ends of this time range by the given amount of time, effectively expanding it by 2 * the specified time.

Parameter(s):

  • time - The amount of time to extend by - must be non-negative.

DzTime : getDuration()

Return Value:

  • The length of this time range (end - start).

void : include( DzTime time )

Expands this time range to include the given time.

Parameter(s):

  • time - The time to include.

void : include( DzTimeRange range )

Expands this time range to include the given time range.

Parameter(s):

  • range - The time range to include.

void : intersect( DzTimeRange range )

Sets this time range to the intersection with the given time range.

Parameter(s):

  • range - The time range to intersect.

Boolean : isEmpty()

Return Value:

  • true if this time range is length 0, otherwise false.

Boolean : isIncluded( DzTime time )

Return Value:

  • true if the given time falls inside this range, otherwise false.

Boolean : isIncluded( DzTimeRange range )

Return Value:

  • true if the given range falls inside this range, otherwise false.

void : makeEmpty()

Sets this time range to be empty.


Boolean : overlaps( DzTimeRange range )

Return Value:

  • true if the given range overlaps this range, otherwise false.

void : subtract( DzTime time )

Subtracts the given amount of time from both ends of this range.

Parameter(s):

  • time - The amount of time to subtract.

String : toString()

Return Value:

  • A string representation of this time range in the form "[ start, end ]".