Public Member Functions | Static Public Member Functions

VCTimestamp Class Reference

Timestamp for data within VisualCommander. More...

List of all members.

Public Member Functions

(id) - initWithNSDate:
 Create a new timestamp from an NSDate object.
(id) - initWithTimestamp:plusInterval:
 Create a new timestamp by adding an interval to an existing timestamp.
(id) - initWithTimestamp:minusInterval:
 Create a new timestamp by subtracting an interval from an existing timestamp.
(id) - initWithJulianDate:
 Create a new timestamp from a double representation of a julian date.
(VCInterval *) - intervalSinceTimestamp:
 Find the interval between two timestamps.
(double) - julianDate
 Get the julian date represented by this timestamp.
(NSComparisonResult) - compare:
 Compare one timestamp to another to determine chronological ordering.

Static Public Member Functions

(id) + timestampWithNSDate:
 Create a new, autoreleased timestamp from an NSDate object.
(id) + timestampWithTimestamp:plusInterval:
 Create a new, autoreleased timestamp by adding an interval to an existing timestamp.
(id) + timestampWithTimestamp:minusInterval:
 Create a new, autoreleased timestamp by subtracting an interval from an existing timestamp.
(id) + timestampWithJulianDate:
 Create a new, autoreleased timestamp from a double representation of a julian date.

Detailed Description

A VisualCommander-specific representation of time, providing high-resolution timestamps over a wide range of potential dates. All data produced by sessions is tagged with timestamps.


Member Function Documentation

- (NSComparisonResult) compare: (VCTimestamp *)  anotherTimestamp

Compare the chronological ordering of the timestamp with a second timestamp.

Parameters:
anotherTimestampThe timestamp with which to compare the receiver.
Returns:
If the receiver is identical to anotherTimestamp, or either is nil, returns NSOrderedSame. If the receiver is chronologically earlier than anotherTimestamp, returns NSOrderedAscending. Otherwise, returns NSOrderedDescending.
- (id) initWithJulianDate: (double)  jD

Initialize a timestamp that represents a Julian date.

Parameters:
jDA double representation of a Julian date
Returns:
The receiver is returned.
- (id) initWithNSDate: (NSDate *)  aDate

Initialize a timestamp from an NSDate object.

Parameters:
aDateAn NSDate object. Must not be nil. Must not be the NSDate representations [NSDate distantPast] or [NSDate distantFuture].
Returns:
The receiver is returned.
- (id) initWithTimestamp: (VCTimestamp *)  timestamp
minusInterval: (VCInterval *)  interval 

Initialize a timestamp by subtracting an interval from an existing timestamp.

Parameters:
timestampThe base timestamp, from which an interval will be subtracted.
intervalThe interval to subtract
Returns:
The receiver is returned.
- (id) initWithTimestamp: (VCTimestamp *)  timestamp
plusInterval: (VCInterval *)  interval 

Initialize a timestamp by adding an interval to an existing timestamp.

Parameters:
timestampThe base timestamp, to which an interval will be added.
intervalThe interval to add
Returns:
The receiver is returned.
- (VCInterval *) intervalSinceTimestamp: (VCTimestamp *)  timestamp

Find the interval between the provided timestamp and the receiver, (receiver - timestamp).

Parameters:
timestampThe base timestamp to be subtracted from the receiver.
Returns:
The interval between timestamp and the receiver.
- (double) julianDate

Convert this timestamp into a Julian date. Note that VCTimestamp can express a higher resolution than a Julian date, so some truncation may occur.

Returns:
The julian date representation of the receiver.
+ (id) timestampWithJulianDate: (double)  jD

Create a new, autoreleased timestamp that represents a Julian date.

Parameters:
jDA double representation of a Julian date
Returns:
The new timestamp.
+ (id) timestampWithNSDate: (NSDate *)  aDate

Create a new, autoreleased timestamp from an NSDate object.

Parameters:
aDateAn NSDate object. Must not be nil. Must not be the NSDate representations [NSDate distantPast] or [NSDate distantFuture].
Returns:
The new timestamp.
+ (id) timestampWithTimestamp: (VCTimestamp *)  timestamp
minusInterval: (VCInterval *)  interval 

Create a new, autoreleased timestamp by subtracting an interval from an existing timestamp.

Parameters:
timestampThe base timestamp, from which an interval will be subtracted.
intervalThe interval to subtract
Returns:
The new timestamp
+ (id) timestampWithTimestamp: (VCTimestamp *)  timestamp
plusInterval: (VCInterval *)  interval 

Create a new, autoreleased timestamp by adding an interval to an existing timestamp.

Parameters:
timestampThe base timestamp, to which an interval will be added.
intervalThe interval to add
Returns:
The new timestamp

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