Improve API.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / statevalue / IntegerStateValue.java
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>
5 *
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
10 *
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.core.statevalue;
14
15 /**
16 * A state value containing a simple integer.
17 *
18 * @author alexmont
19 *
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() {
31 return 0;
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 }
This page took 0.061843 seconds and 5 git commands to generate.