Commit | Line | Data |
---|---|---|
1cbf1a19 FR |
1 | /******************************************************************************* |
2 | * Copyright (c) 2013 École Polytechnique de Montréal | |
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 | * François Rajotte - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.core.statevalue; | |
14 | ||
15 | /** | |
16 | * A state value containing a long integer (8 bytes). | |
17 | * | |
18 | * @version 1.0 | |
19 | * @author François Rajotte | |
20 | */ | |
21 | final class LongStateValue extends TmfStateValue { | |
22 | ||
fa6b1ab8 | 23 | private final long valueLong; |
1cbf1a19 FR |
24 | |
25 | public LongStateValue(long valueAsLong) { | |
fa6b1ab8 | 26 | this.valueLong = valueAsLong; |
1cbf1a19 FR |
27 | } |
28 | ||
29 | @Override | |
30 | public Type getType() { | |
31 | return Type.LONG; | |
32 | } | |
33 | ||
34 | @Override | |
35 | public boolean isNull() { | |
36 | return false; | |
37 | } | |
38 | ||
39 | @Override | |
40 | public Long getValue() { | |
41 | return valueLong; | |
42 | } | |
43 | ||
1cbf1a19 | 44 | @Override |
fa6b1ab8 | 45 | public String toString() { |
1cbf1a19 FR |
46 | return String.format("%3d", valueLong); //$NON-NLS-1$ |
47 | } | |
48 | } |