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 | ||
40e01e5a AM |
15 | import org.eclipse.jdt.annotation.Nullable; |
16 | ||
1cbf1a19 FR |
17 | /** |
18 | * A state value containing a long integer (8 bytes). | |
19 | * | |
20 | * @version 1.0 | |
21 | * @author François Rajotte | |
22 | */ | |
23 | final class LongStateValue extends TmfStateValue { | |
24 | ||
40e01e5a | 25 | private final Long valueLong; |
1cbf1a19 FR |
26 | |
27 | public LongStateValue(long valueAsLong) { | |
40e01e5a | 28 | this.valueLong = new Long(valueAsLong); |
1cbf1a19 FR |
29 | } |
30 | ||
31 | @Override | |
32 | public Type getType() { | |
33 | return Type.LONG; | |
34 | } | |
35 | ||
36 | @Override | |
37 | public boolean isNull() { | |
38 | return false; | |
39 | } | |
40 | ||
41 | @Override | |
42 | public Long getValue() { | |
43 | return valueLong; | |
44 | } | |
45 | ||
1cbf1a19 | 46 | @Override |
40e01e5a | 47 | public @Nullable String toString() { |
1cbf1a19 FR |
48 | return String.format("%3d", valueLong); //$NON-NLS-1$ |
49 | } | |
50 | } |