|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfi.helsinki.cs.ohtu.mpeg2.ClockOps
class ClockOps
Implements assorted methods to handle the 33-bit 90kHz MPEG system clock values.
Field Summary | |
---|---|
static int |
TICK_RATE
The number of system clock ticks per second |
Constructor Summary | |
---|---|
private |
ClockOps()
|
Method Summary | |
---|---|
static long |
add(long t,
double s)
Adds system clock ticks and seconds. |
static long |
add(long a,
long b)
Adds two system clock values. |
static boolean |
isLessThan(long a,
long b)
Compares whether the first system clock value is less than (or precedes) the second value. |
static long |
normalize(long t)
Normalizes (that is, gets mod 2^33 - 1) of a system clock value. |
static double |
toSeconds(long t)
Converts system clock ticks to seconds. |
static long |
toTicks(double s)
Converts seconds to system clock ticks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TICK_RATE
Constructor Detail |
---|
private ClockOps()
Method Detail |
---|
public static long toTicks(double s)
s
- the seconds to convert
public static double toSeconds(long t)
t
- the system clock ticks
public static long add(long a, long b)
a
- the first system clock valueb
- the second system clock value
public static long add(long t, double s)
t
- the system clock tickss
- the seconds to add
public static long normalize(long t)
t
- the system clock value
public static boolean isLessThan(long a, long b)
a - b
is
at least 2^32, one of the values (not both!) is assumed to have
wrapped around.
a
- the first system clock valueb
- the second system clock value
true
if a
is less than
(or precedes) b
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |