4 package org
.eclipse
.linuxtools
.internal
.lttng
.stubs
;
6 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfTimestamp
;
12 @SuppressWarnings("nls")
13 public class LTTngTimestampStub
extends TmfTimestamp
{
18 @SuppressWarnings("unused")
19 private static final long serialVersionUID
= 216576768443708259L;
26 public LTTngTimestampStub(long value
) {
27 super(value
, (byte) -3, 0); // millisecs
31 * @see org.eclipse.linuxtools.tmf.event.TmfTimestamp#toString()
34 public String
toString() {
36 long value
= getValue();
37 int scale
= getScale();
39 // If we are dealing with units of seconds (or higher),
40 // use the plain formatter
42 Double dvalue
= value
* Math
.pow(10, scale
);
43 return dvalue
.toString();
46 // Define a format string
47 String format
= String
.format("%%1d.%%0%dd", -scale
);
49 // And format the timestamp value
50 double dscale
= Math
.pow(10, scale
);
51 long seconds
= (long) (value
* dscale
);
52 long fracts
= value
- (long) ((double) seconds
/ dscale
);
53 String result
= String
.format(format
, seconds
, fracts
);
This page took 0.032487 seconds and 5 git commands to generate.