org.ros.message
Class Duration

java.lang.Object
  extended by org.ros.message.Duration
All Implemented Interfaces:
java.lang.Comparable<Duration>

public class Duration
extends java.lang.Object
implements java.lang.Comparable<Duration>

ROS Duration representation. Time and Duration are primitive types in ROS. ROS represents each as two 32-bit integers: seconds and nanoseconds since epoch. http://www.ros.org/wiki/msg


Field Summary
static Duration MAX_VALUE
           
 int nsecs
           
 int secs
           
 
Constructor Summary
Duration()
           
Duration(double secs)
           
Duration(Duration t)
           
Duration(int secs, int nsecs)
           
 
Method Summary
 Duration add(Duration d)
           
 int compareTo(Duration d)
           
 boolean equals(java.lang.Object obj)
           
static Duration fromMillis(long durationInMillis)
           
static Duration fromNano(long durationInNs)
           
 int hashCode()
           
 boolean isNegative()
           
 boolean isPositive()
           
 boolean isZero()
           
 void normalize()
           
 Duration subtract(Duration d)
           
 java.lang.String toString()
           
 long totalNsecs()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_VALUE

public static final Duration MAX_VALUE

secs

public int secs

nsecs

public int nsecs
Constructor Detail

Duration

public Duration()

Duration

public Duration(int secs,
                int nsecs)

Duration

public Duration(double secs)

Duration

public Duration(Duration t)
Method Detail

add

public Duration add(Duration d)

subtract

public Duration subtract(Duration d)

fromMillis

public static Duration fromMillis(long durationInMillis)

fromNano

public static Duration fromNano(long durationInNs)

normalize

public void normalize()

totalNsecs

public long totalNsecs()

isZero

public boolean isZero()

isPositive

public boolean isPositive()

isNegative

public boolean isNegative()

toString

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

hashCode

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

equals

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

compareTo

public int compareTo(Duration d)
Specified by:
compareTo in interface java.lang.Comparable<Duration>