org.ros.message
Class Duration
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
MAX_VALUE
public static final Duration MAX_VALUE
secs
public int secs
nsecs
public int nsecs
Duration
public Duration()
Duration
public Duration(int secs,
int nsecs)
Duration
public Duration(double secs)
Duration
public Duration(Duration t)
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>