Commit | Line | Data |
---|---|---|
a52fde77 AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2012 Ericsson | |
3 | * Copyright (c) 2010, 2011 École Polytechnique de Montréal | |
4 | * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com> | |
2cb26548 | 5 | * |
a52fde77 AM |
6 | * All rights reserved. This program and the accompanying materials are |
7 | * made available under the terms of the Eclipse Public License v1.0 which | |
8 | * accompanies this distribution, and is available at | |
9 | * http://www.eclipse.org/legal/epl-v10.html | |
2cb26548 | 10 | * |
a52fde77 AM |
11 | *******************************************************************************/ |
12 | ||
13 | package org.eclipse.linuxtools.tmf.core.statevalue; | |
14 | ||
15 | /** | |
16 | * A state value containing a simple integer. | |
a52fde77 | 17 | * |
2cb26548 AM |
18 | * @version 1.0 |
19 | * @author Alexandre Montplaisir | |
a52fde77 AM |
20 | */ |
21 | final class IntegerStateValue extends TmfStateValue { | |
22 | ||
23 | private final int valueInt; | |
24 | ||
25 | public IntegerStateValue(int valueAsInt) { | |
26 | this.valueInt = valueAsInt; | |
27 | } | |
28 | ||
29 | @Override | |
30 | public byte getType() { | |
0e05a268 | 31 | return ITmfStateValue.TYPE_INTEGER; |
a52fde77 AM |
32 | } |
33 | ||
34 | @Override | |
35 | public boolean isNull() { | |
36 | return false; | |
37 | } | |
38 | ||
39 | @Override | |
40 | public Integer getValue() { | |
41 | return valueInt; | |
42 | } | |
43 | ||
44 | @Override | |
45 | public byte[] toByteArray() { | |
46 | return null; | |
47 | } | |
48 | ||
49 | @Override | |
50 | public String toString() { | |
51 | return String.format("%3d", valueInt); //$NON-NLS-1$ | |
52 | } | |
53 | } |