|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.api.time.Time
Represents a unit time, usually a microsecond. Functionally equivalent to the Frame object, this type uses long integers internally to allow larger ranges of values. While it is unlikely a video will have more than 2^31 frames, it is possible that it will contain more than 2^31 nanoseconds, and this may be useful to track.
Field Summary | |
static Time |
ALPHA
The first moment in time this object can represent. |
static Time |
OMEGA
The last moment in time this object can represent. |
Constructor Summary | |
Time(long i)
Construct a new Time with the given value. |
Method Summary | |
int |
compareTo(java.lang.Object o)
|
double |
doubleValue()
Gets the closest or most appropriate double value for this number. |
boolean |
equals(java.lang.Object o)
|
float |
floatValue()
Gets the closest or most appropriate float value for this number. |
long |
getTime()
Gets the value of the time. |
Instant |
go(long diff)
Returns an Instant diff away from this. For example, i.go(0) can return itself, and
i.go(-1) is equivalent to
i.previous() . |
int |
hashCode()
|
int |
intValue()
Gets the closest or most appropriate int value for this number. |
boolean |
isGreater(Instant i)
If i is a Time, tests to see that this is greater (later) than i. |
boolean |
isLess(Instant t)
If i is a Time, tests to see that this is less (earlier) than i. |
long |
longValue()
Gets the closest or most appropriate long value for this number. |
long |
minus(Instant i)
Gets the difference between this and another instance. |
Incrementable |
next()
Gets the item following this one. Should have true == a.next().prev().equals(a) . |
static Time |
parseTime(java.lang.String val)
Parses a string in the form of an integer as a time. |
Incrementable |
previous()
Gets the item before this one. Should have true == a.prev().next().equals(a) . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static Time ALPHA
public static Time OMEGA
Constructor Detail |
public Time(long i)
i
- the timeMethod Detail |
public static Time parseTime(java.lang.String val)
val
- an integer that represents an instant in time.
java.lang.IllegalArgumentException
- if val isn't a valid intpublic long getTime()
public Incrementable next()
true == a.next().prev().equals(a)
.
next
in interface Incrementable
public Incrementable previous()
true == a.prev().next().equals(a)
.
previous
in interface Incrementable
public long minus(Instant i)
minus
in interface Instant
i
- the amount to subtract
this.value - i.value
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean isGreater(Instant i)
i
- the Time to test against.
true
iff this Time is later than i
java.lang.ClassCastException
- if i is not a Timepublic boolean isLess(Instant t)
t
- the Time to test against.
true
iff this Time is earlier than i
java.lang.ClassCastException
- if i is not a Timepublic boolean equals(java.lang.Object o)
public java.lang.String toString()
public int hashCode()
public Instant go(long diff)
i.go(0)
can return itself, and
i.go(-1)
is equivalent to
i.previous()
.
go
in interface Instant
diff
- the number of instants to move
diff
from this onepublic long longValue()
longValue
in interface Numeric
public int intValue()
intValue
in interface Numeric
public double doubleValue()
doubleValue
in interface Numeric
public float floatValue()
floatValue
in interface Numeric
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |