JNodeOS v1.2.0 API

edu.utah.janos.nodeos
Class TimeSpec

java.lang.Object
  |
  +--edu.utah.janos.nodeos.pj_TimeSpec
        |
        +--edu.utah.janos.nodeos.TimeSpec

public final class TimeSpec
extends pj_TimeSpec

A TimeSpec holds a time value as reported by the NodeOS.


Field Summary
static int MICRO
           
static int MILLI
           
static int NANO
          Handy unit constants.
 
Constructor Summary
TimeSpec()
          Construct a TimeSpec object with a time value of zero.
TimeSpec(int seconds, int nanoseconds)
           
TimeSpec(TimeSpec ts)
           
 
Method Summary
 TimeSpec add(TimeSpec ts)
           
 TimeSpec copy(TimeSpec ts)
           
 boolean equals(java.lang.Object obj)
           
 int getLength()
           
 int getNanoSeconds()
           
 int getSeconds()
           
static void getTime(TimeSpec ts)
          Get the current time.
 double getTotalMillis()
           
 boolean greaterThan(TimeSpec ts)
           
 int hashCode()
           
 int marshal(BufferHandle bh, int offset)
           
 void setNanoSeconds(int ns)
           
 void setSeconds(int s)
           
 TimeSpec subtract(TimeSpec ts)
           
 java.lang.String toString()
           
 int unmarshal(BufferHandle bh, int offset)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NANO

public static final int NANO
Handy unit constants.

MICRO

public static final int MICRO

MILLI

public static final int MILLI
Constructor Detail

TimeSpec

public TimeSpec(int seconds,
                int nanoseconds)
Parameters:
seconds - Number of elapsed seconds.
nanoseconds - Number of elapsed nanoseconds in addition to the
nanoseconds - seconds value.

TimeSpec

public TimeSpec(TimeSpec ts)
Parameters:
ts - The TimeSpec object to copy.

TimeSpec

public TimeSpec()
Construct a TimeSpec object with a time value of zero.
Method Detail

getTime

public static void getTime(TimeSpec ts)
Get the current time.
Parameters:
ts - The TimeSpec object to fill out.

copy

public TimeSpec copy(TimeSpec ts)
Parameters:
ts - The TimeSpec whose values should be copied into `this'.
Returns:
`this'

getSeconds

public int getSeconds()
Returns:
The seconds value.

setSeconds

public void setSeconds(int s)
Parameters:
s - The seconds value.

getNanoSeconds

public int getNanoSeconds()
Returns:
The nanoseconds value.

setNanoSeconds

public void setNanoSeconds(int ns)
Parameters:
ns - The nanoseconds value.

getTotalMillis

public double getTotalMillis()
Returns:
The total number of elapsed milliseconds.

add

public TimeSpec add(TimeSpec ts)
Parameters:
ts - The TimeSpec whose values should be added to `this'.
Returns:
`this'

subtract

public TimeSpec subtract(TimeSpec ts)
Parameters:
ts - The TimeSpec whose values should be subtracted from `this'
Returns:
`this'

greaterThan

public boolean greaterThan(TimeSpec ts)
Parameters:
ts - The TimeSpec whose values should be compared with `this'.
Returns:
True if `this' is greater than `ts'.

getLength

public int getLength()
Returns:
The number of bytes needed to encode this TimeSpec.

marshal

public int marshal(BufferHandle bh,
                   int offset)
Parameters:
bh - The buffer to marshal this TimeSpec into.
offset - The offset in the buffer to start marshalling.

unmarshal

public int unmarshal(BufferHandle bh,
                     int offset)
Parameters:
bh - The buffer that contains the marshalled TimeSpec.
offset - The offset in the buffer to start unmarshalling.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

JNodeOS v1.2.0 API

This documentation is Copyright (C) 1998-2002 The University of Utah. All Rights Reserved. See the file LICENSE for distribution terms.
Documentation, software, and mailing list archives for Janos can be found at the Janos Project web site: http://www.cs.utah.edu/flux/janos/
Generated on Mar 17, 2002