tmf.core: simplify timestamp implementations
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 8 Apr 2016 14:25:19 +0000 (10:25 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 22 Apr 2016 20:48:18 +0000 (16:48 -0400)
commitc61fcbabb1114355724177061f3d4f6de2df4b89
tree5819cec5cf3d86cc4394c306cd92cb9301289036
parentdbae61184081f664f87d144a33875c0ebb8c58f2
tmf.core: simplify timestamp implementations

This patch makes BIG_BANG and BIG_CRUNCH and ZERO special singleton
objects. They now normalize to themselves. Big bang and big crunch are
always the largest or smallest values.

It also internalizes TmfRealTimestamp inside TmfTimestamp as
TmfTimestamp$Impl.

The timestamp comparison is very streamlined. The performance
should be similar though.

One bug found that will never occur in the real world:
additions with -Long.MIN_VALUE gave errors as -Long.MIN_VALUE ==
LONG.MIN_VALUE.

Change-Id: I284ed1b8f0dd1f6d5299e172dd07128d53ac5945
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/70245
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfNanoTimestampTest.java
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfSecondTimestampTest.java
tmf/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimestampTest.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfNanoTimestamp.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfRealTimestamp.java [deleted file]
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfSecondTimestamp.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimestamp.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimestampDelta.java
This page took 0.027241 seconds and 5 git commands to generate.