| java.lang.Object org.jacorb.util.Time
Time | public class Time (Code) | | Contains static methods to handle CORBA time values.
author: Andre Spiegel version: $Id: Time.java,v 1.10 2006/07/07 10:57:59 alphonse.bendt Exp $ |
Field Summary | |
final public static long | UNIX_OFFSET Difference between the CORBA Epoch and the Unix Epoch: the time
from 1582/10/15 00:00 until 1970/01/01 00:00 in 100 ns units. |
Method Summary | |
public static UtcT | corbaFuture(long corbaUnits) Returns a CORBA UtcT that represents an instant that lies
a given number of CORBA time units (100 ns) in the future. | public static UtcT | corbaTime() Returns the current time as a CORBA UtcT. | public static UtcT | corbaTime(long unixTime) Converts the given unixTime into a CORBA UtcT. | public static UtcT | corbaTime(java.util.Date date) Converts the given Java date into a CORBA UtcT. | public static UtcT | earliest(UtcT timeA, UtcT timeB) Compares two UtcT time values and returns that which is earlier.
Either argument can be null; this is considered as a time that
lies indefinitely in the future. | public static UtcT | fromCDR(byte[] buffer) Decodes a CDR encapsulation of a UtcT. | public static boolean | hasPassed(UtcT time) Returns true if the instant represented by the given UtcT is
already in the past, false otherwise. | public static long | millisTo(UtcT time) Returns the number of milliseconds between now and the given CORBA
time. | public static byte[] | toCDR(UtcT time) Returns a CDR encapsulation of the given UtcT. | public static void | waitFor(UtcT time) This method blocks until the given time has been reached. |
UNIX_OFFSET | final public static long UNIX_OFFSET(Code) | | Difference between the CORBA Epoch and the Unix Epoch: the time
from 1582/10/15 00:00 until 1970/01/01 00:00 in 100 ns units.
|
corbaFuture | public static UtcT corbaFuture(long corbaUnits)(Code) | | Returns a CORBA UtcT that represents an instant that lies
a given number of CORBA time units (100 ns) in the future.
If the argument is negative, returns null.
|
corbaTime | public static UtcT corbaTime()(Code) | | Returns the current time as a CORBA UtcT.
|
corbaTime | public static UtcT corbaTime(long unixTime)(Code) | | Converts the given unixTime into a CORBA UtcT.
Parameters: unixTime - the number of milliseconds since 1970/01/01 00:00 UTC. |
corbaTime | public static UtcT corbaTime(java.util.Date date)(Code) | | Converts the given Java date into a CORBA UtcT.
|
earliest | public static UtcT earliest(UtcT timeA, UtcT timeB)(Code) | | Compares two UtcT time values and returns that which is earlier.
Either argument can be null; this is considered as a time that
lies indefinitely in the future. If both arguments are null,
this method returns null itself.
|
fromCDR | public static UtcT fromCDR(byte[] buffer)(Code) | | Decodes a CDR encapsulation of a UtcT.
|
hasPassed | public static boolean hasPassed(UtcT time)(Code) | | Returns true if the instant represented by the given UtcT is
already in the past, false otherwise. As a special convenience,
this method also returns false if the argument is null.
|
millisTo | public static long millisTo(UtcT time)(Code) | | Returns the number of milliseconds between now and the given CORBA
time. The value is positive if that time is in the future, and
negative otherwise.
|
toCDR | public static byte[] toCDR(UtcT time)(Code) | | Returns a CDR encapsulation of the given UtcT.
|
waitFor | public static void waitFor(UtcT time)(Code) | | This method blocks until the given time has been reached.
If the time is null, or it has already passed,
then this method returns immediately.
|
|
|