- return "TmfTimestamp [fValue=" + fValue + ", fScale=" + fScale + ", fPrecision=" + fPrecision + "]";
+ return toString(TmfTimestampFormat.getDefaulTimeFormat());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp#toString(org.eclipse.linuxtools.tmf.core.event.TmfTimestampFormat)
+ */
+ /**
+ * @since 2.0
+ */
+ @Override
+ public String toString(final TmfTimestampFormat format) {
+ try {
+ ITmfTimestamp ts = normalize(0, ITmfTimestamp.NANOSECOND_SCALE);
+ return format.format(ts.getValue());
+ }
+ catch (ArithmeticException e) {
+ return format.format(0);
+ }