4 package org
.eclipse
.linuxtools
.lttng
.stubs
;
6 import org
.eclipse
.linuxtools
.tmf
.event
.TmfTimestamp
;
12 public class LTTngTimestampStub
extends TmfTimestamp
{
17 private static final long serialVersionUID
= 216576768443708259L;
24 public LTTngTimestampStub(long value
) {
25 super(value
, (byte) -3, 0); // millisecs
29 * @see org.eclipse.linuxtools.tmf.event.TmfTimestamp#toString()
32 public String
toString() {
34 // If we are dealing with units of seconds (or higher),
35 // use the plain formatter
37 Double value
= fValue
* Math
.pow(10, fScale
);
38 return value
.toString();
41 // Define a format string
42 String format
= String
.format("%%1d.%%0%dd", -fScale
);
44 // And format the timestamp value
45 double scale
= Math
.pow(10, fScale
);
46 long seconds
= (long) (fValue
* scale
);
47 long fracts
= fValue
- (long) ((double) seconds
/ scale
);
48 String result
= String
.format(format
, seconds
, fracts
);
This page took 0.030308 seconds and 5 git commands to generate.