jp.go.aist.rtm.RTC.util
Class TimeValue

java.lang.Object
  extended by jp.go.aist.rtm.RTC.util.TimeValue

public class TimeValue
extends java.lang.Object

Class that expresses time


Constructor Summary
TimeValue()
           Default constructor
TimeValue(double timeval)
          
TimeValue(long sec, long usec)
           Constructor
TimeValue(TimeValue tm)
           Copy constructor
 
Method Summary
 TimeValue convert(double time)
           Converts the numerical itno time
 long getSec()
           Gets the set time (second).
 long getUsec()
           Gets the set time (micro second).
 TimeValue minus(TimeValue tm)
           Subtracts time.
 TimeValue plus(TimeValue tm)
           Adds time.
 long sec()
           Gets sec return sec
 int sign()
           Judges the sign of the maintained content
 double toDouble()
           Converts time into the numerical
 long usec()
           Gets usec return usec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeValue

public TimeValue()
Default constructor


TimeValue

public TimeValue(long sec,
                 long usec)
Constructor

Parameters:
sec - Second
usec - Micro second

TimeValue

public TimeValue(double timeval)

Parameters:
timeval - Set value

TimeValue

public TimeValue(TimeValue tm)
Copy constructor

Parameters:
tm - Copy origin
Method Detail

getSec

public long getSec()
Gets the set time (second).

Returns:
set time (second)

getUsec

public long getUsec()
Gets the set time (micro second).

Returns:
set time (micro second)

minus

public TimeValue minus(TimeValue tm)
Subtracts time.

Parameters:
tm - Subtacted time
Returns:
Subtraction result

plus

public TimeValue plus(TimeValue tm)
Adds time.

Parameters:
tm - Added time
Returns:
Addition result

convert

public TimeValue convert(double time)
Converts the numerical itno time

Parameters:
time - Numerical value of conversion origin
Returns:
Conversion result

toDouble

public double toDouble()
Converts time into the numerical

Returns:
Conversion result

sec

public long sec()
Gets sec return sec


usec

public long usec()
Gets usec return usec


sign

public int sign()
Judges the sign of the maintained content

Returns:
positive is 1,negative is -1,0 is 0