Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 package ros.communication;
00040
00041 public abstract class TimeUnit implements Cloneable {
00042 public int secs;
00043 public int nsecs;
00044
00045 public long totalNsecs() {
00046 return ((long) secs) * 1000000000 + nsecs;
00047 }
00048
00049 public boolean isZero() { return totalNsecs() == 0; }
00050 public boolean isPositive() { return totalNsecs() > 0; }
00051 public boolean isNegative() { return totalNsecs() < 0; }
00052
00053 public void normalize() {
00054 while(nsecs < 0) {
00055 nsecs += 1000000000;
00056 secs -= 1;
00057 }
00058 while(nsecs >= 1000000000) {
00059 nsecs -= 1000000000;
00060 secs += 1;
00061 }
00062 }
00063
00064 public TimeUnit clone() {
00065 try {
00066 return (TimeUnit) super.clone();
00067 } catch (CloneNotSupportedException e) {
00068 throw new RuntimeException("TimeUnit not cloneable?!");
00069 }
00070 }
00071 }
rosjava_jni
Author(s): Maintained by Gheorghe Lisca (lisca@cs.uni-bremen.de) and developed by Jason Wolfe (jawolfe@willowgarage.com), Nicholas Butko (nbutko@cogsci.ucsd.edu), Lorenz Moesenlechner (moesenle@in.tum.de)
autogenerated on Sun Oct 5 2014 22:54:14