Aztec® Programming Language

Version 1.0 Alpha

Copyright © 2010-2013

Cold Spring® Development Group

All Rights Reserved

Download Aztec

Site Help

aztec.util.TimeInterval

public class TimeInterval from<Base>

Base

TimeInterval

The TimeInterval class represents an interval of time (in seconds). It is used for time addition and subtraction. A TimeInterval object can be created manually using a variety of constructors, and it is also returned as the result of subtracting two Time objects.

TimeInterval Methods

TimeInterval() Constructor for the TimeInterval class using number of seconds
TimeInterval() Constructor for the TimeInterval class using number of Days, Hours, Minutes and Seconds as integers
TimeInterval() Constructor for the TimeInterval class using another TimeInterval object
Value() Returns internal time interval value as number of seconds
SetValue() Sets a new internal time interval value using number of seconds
IsValid() Returns true if TimeInterval object is valid (based on parameters used to create it)
Days() Returns the number of days in the time interval
Hours() Returns the number of hours in the time interval (after days taken out)
Minutes() Returns the number of minutes in the time interval (after days and hours taken out)
Seconds() Returns the number of seconds in the time interval (after days, hours and minutes taken out)
Add() Adds a number of seconds to the TimeInterval value
Add() Adds a TimeInterval object to the TimeInterval value
Sub() Subtracts a number of seconds from the TimeInterval value
Sub() Subtracts a TimeInterval object from the TimeInterval value

Derived Classes

See Also

 


TimeInterval()

public method TimeInterval(int Seconds)

Parameters

Seconds

Number of seconds in interval

Return Value

None

Description

Constructor for the TimeInterval class. This implementation takes a single integer argument which represents the number of seconds in the time interval.

 

TimeInterval Class


TimeInterval()

public method TimeInterval(int Days, int Hours, int Minutes, int Seconds)

Parameters

Days

Number of days in interval

Hours

Number of hours in interval

Minutes

Number of minutes in interval

Seconds

Number of seconds in interval

Return Value

None

Description

Constructor for the TimeInterval class. This implementation takes four integer arguments which represent the individual pieces of the time interval - number of days, number of hours, number of minutes and number of seconds. They are added together to represent the entire interval.

 

TimeInterval Class


TimeInterval()

public method TimeInterval(TimeInterval SourceInterval)

Parameters

SourceInterval

Source time interval used for initialization

Return Value

None

Description

Constructor for the TimeInterval class. This implementation takes a single TimeInterval argument which is used to initialize this new TimeInterval object. Once complete, this new TimeInterval object will represent the same exact interval value as the incoming source TimeInterval object.

 

TimeInterval Class


Value()

public method<int> Value()

Parameters

None

Return Value

Internal time value in seconds

Description

This method returns the number of secondscorresponding to the internal time interval value.

 

TimeInterval Class


SetValue()

public method<bool> SetValue(int Seconds)

Parameters

Seconds

Number of seconds in interval

Return Value

Returns true if the new interval is valid

Description

This method sets the internal time interval value with the number of seconds which is passed in to the method. If the new time interval value is valid, the method returns true and false if not.

 

TimeInterval Class


IsValid()

public method<bool> IsValid()

Parameters

None

Return Value

Returns true if the internal time interval value is valid.

Description

This method returns true if the internal time interval value is valid and false if it is not valid.

 

TimeInterval Class


Days()

public method<int> Days()

Parameters

None

Return Value

Number of days in interval

Description

This method returns the number of days in the time interval. If the internal TimeInterval value is invalid, this method will return zero.

 

TimeInterval Class


Hours()

public method<int> Hours()

Parameters

None

Return Value

Number of hours in interval

Description

This method returns the number of hours in the time interval, after the number of days are removed from the interval. If the internal TimeInterval value is invalid, this method will return zero.

 

TimeInterval Class


Minutes()

public method<int> Minutes()

Parameters

None

Return Value

Number of minutes in interval

Description

This method returns the number of minutes in the time interval, after the number of days and hours are removed from the interval. If the internal TimeInterval value is invalid, this method will return zero.

 

TimeInterval Class


Seconds()

public method<int> Seconds()

Parameters

None

Return Value

Number of seconds in interval

Description

This method returns the number of seconds in the time interval, after the number of days, hours and minutes are removed from the interval. If the internal TimeInterval value is invalid, this method will return zero.

 

TimeInterval Class


Add()

public method<bool> Add(int Seconds)

Parameters

Seconds

Number of seconds to be added

Return Value

True if success

Description

This method adds the number of seconds to the internal TimeInterval value. The method returns true if successful and false if not.

 

TimeInterval Class


Add()

public method<bool> Add(TimeInterval Interval)

Parameters

Interval

Time interval to be added

Return Value

True if success

Description

This method adds the TimeInternal value to the internal TimeInterval value. The method returns true if successful and false if not.

 

TimeInterval Class


Sub()

public method<bool> Sub(int Seconds)

Parameters

Seconds

Number of seconds to be subtracted

Return Value

True if success

Description

This method subtracts the number of seconds from the internal TimeInterval value. The method returns true if successful and false if not.

 

TimeInterval Class


Sub()

public method<bool> Sub(TimeInterval Interval)

Parameters

Interval

Time interval to be subtracted

Return Value

True if success

Description

This method subtracts the TimeInternal value from the internal TimeInterval value. The method returns true if successful and false if not.

 

TimeInterval Class

 

Copyright © 2010-2013

Cold Spring Development Group

All Rights Reserved

Download Aztec