Public Member Functions | Static Public Member Functions

VCInterval Class Reference

A VisualCommander representation of a duration of time. More...

List of all members.

Public Member Functions

(id) - initWithSeconds:
 Create a new, autoreleased interval representing a number of seconds.
(id) - initWithCount:forUnit:
 Create a new, autoreleased interval representing an exact amount of the specified unit.
(id) - initWithAmount:forUnit:
 Create a new, autoreleased interval representing a floating-point amount of a specified unit.
(double) - dividedByInterval:
 Return the number of times another interval can be divided into the receiver.
(VCInterval *) - dividedIntoIntervals:
 Return the interval generated by dividing the receiver into a specified number of sub-intervals.
(NSComparisonResult) - compare:
 Compare the length of the receiver with another interval.

Static Public Member Functions

(id) + intervalWithSeconds:
 Create a new, autoreleased interval representing a number of seconds.
(id) + intervalWithCount:forUnit:
 Create a new, autoreleased interval representing an exact amount of the specified unit.
(id) + intervalWithAmount:forUnit:
 Create a new, autoreleased interval representing a floating-point amount of a specified unit.

Detailed Description

VCInterval provides a high-resolution representation of a time duration, to match the VCTimestamp time representation. An interval only represents a duration- it does not encode a specific start and stop date for that interval.


Member Function Documentation

- (NSComparisonResult) compare: (VCInterval *)  anotherInterval

Compare the length of the receiver with the length of a second interval.

Parameters:
anotherIntervalThe interval with which the receiver should be compared.
Returns:
If the receiver is the same length as anotherInterval, returns NSOrderedSame. If the receiver is longer than anotherInterval, returns NSOrderedDescending. Otherwise returns NSOrderedAscending.
- (double) dividedByInterval: (VCInterval *)  interval

Find the number of times the provided interval divides into the receiver.

Parameters:
intervalThe interval to divide into the receiver.
Returns:
The number of times that interval will divide into the reciever.
- (VCInterval *) dividedIntoIntervals: (double)  numberOfIntervals

Divide the length of the receiver by numberOfIntervals, and return a new interval representing the divided length.

Parameters:
numberOfIntervalsThe number by which the receiver's length should be divided.
Returns:
A new interval, representing the length of the receiver divided by numberOfIntervals.

The documentation for this class was generated from the following files: