tmf.core: Internalize timestamp types
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / internal / tmf / core / timestamp / TmfSecondTimestamp.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
11 * Francois Chouinard - Standardize on the default toString()
12 *******************************************************************************/
13
14 package org.eclipse.tracecompass.internal.tmf.core.timestamp;
15
16 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
17 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
18
19 /**
20 * A simplified timestamp where scale and precision are set to 0.
21 *
22 * @author Francois Chouinard
23 * @since 2.0
24 */
25 public class TmfSecondTimestamp extends TmfTimestamp {
26
27 private final long fValue;
28
29 // ------------------------------------------------------------------------
30 // Constructors
31 // ------------------------------------------------------------------------
32
33 /**
34 * Default constructor (value = 0)
35 */
36 public TmfSecondTimestamp() {
37 this(0);
38 }
39
40 /**
41 * Full constructor
42 *
43 * @param value
44 * the timestamp value
45 */
46 public TmfSecondTimestamp(final long value) {
47 fValue = value;
48 }
49
50 @Override
51 public int getScale() {
52 return ITmfTimestamp.SECOND_SCALE;
53 }
54
55 @Override
56 public long getValue() {
57 return fValue;
58 }
59 }
This page took 0.031332 seconds and 5 git commands to generate.