/* Factories */
+ (VLCTime *)nullTime;
+ (VLCTime *)timeWithNumber:(NSNumber *)aNumber;
++ (VLCTime *)timeWithInt:(int)aInt;
/* Initializers */
- (id)initWithNumber:(NSNumber *)aNumber;
+- (id)initWithInt:(int)aInt;
/* Properties */
@property (readonly) NSNumber * numberValue;
@property (readonly) NSString * stringValue;
+@property (readonly) int intValue;
/* Comparitors */
- (NSComparisonResult)compare:(VLCTime *)aTime;
return [[[VLCTime alloc] initWithNumber:aNumber] autorelease];
}
++ (VLCTime *)timeWithInt:(int)aInt
+{
+ return [[[VLCTime alloc] initWithInt:aInt] autorelease];
+}
+
/* Initializers */
- (id)initWithNumber:(NSNumber *)aNumber
{
return self;
}
+- (id)initWithInt:(int)aInt
+{
+ if (self = [super init])
+ {
+ if (aInt)
+ value = [[NSNumber numberWithInt: aInt] retain];
+ else
+ value = nil;
+ }
+ return self;
+}
+
- (void)dealloc
{
[value release];
}
}
+- (int)intValue
+{
+ if( value )
+ return [value intValue];
+ return 0;
+}
+
- (NSComparisonResult)compare:(VLCTime *)aTime
{
if (!aTime && !value)