tmf.core: simplify timestamp implementations
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / timestamp / TmfSecondTimestamp.java
CommitLineData
7636a88e 1/*******************************************************************************
ed902a2b 2 * Copyright (c) 2012, 2014 Ericsson
9b749023 3 *
7636a88e 4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
9b749023 8 *
7636a88e 9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
f8177ba2 11 * Francois Chouinard - Standardize on the default toString()
7636a88e 12 *******************************************************************************/
13
2bdf0193 14package org.eclipse.tracecompass.tmf.core.timestamp;
7636a88e 15
16/**
2848c377 17 * A simplified timestamp where scale and precision are set to 0.
9b749023 18 *
b9e37ffd 19 * @author Francois Chouinard
b2c971ec 20 * @since 2.0
7636a88e 21 */
b2c971ec
MK
22public class TmfSecondTimestamp extends TmfTimestamp {
23
24 private final long fValue;
7636a88e 25
26 // ------------------------------------------------------------------------
27 // Constructors
28 // ------------------------------------------------------------------------
29
30 /**
f7703ed6 31 * Default constructor (value = 0)
7636a88e 32 */
b2c971ec 33 public TmfSecondTimestamp() {
7636a88e 34 this(0);
35 }
36
37 /**
38 * Full constructor
39 *
b2c971ec
MK
40 * @param value
41 * the timestamp value
7636a88e 42 */
b2c971ec
MK
43 public TmfSecondTimestamp(final long value) {
44 fValue = value;
7636a88e 45 }
46
b2c971ec
MK
47 @Override
48 public int getScale() {
49 return ITmfTimestamp.SECOND_SCALE;
50 }
51
52 @Override
53 public long getValue() {
54 return fValue;
7636a88e 55 }
7636a88e 56}
This page took 0.090406 seconds and 5 git commands to generate.