1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 Ericsson
3 * Copyright (c) 2010, 2011 École Polytechnique de Montréal
4 * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
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
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.statesystem
.core
.statevalue
;
15 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 * A state value containing a simple integer.
21 * @author Alexandre Montplaisir
23 final class IntegerStateValue
extends TmfStateValue
{
25 private final int value
;
27 public IntegerStateValue(int valueAsInt
) {
28 this.value
= valueAsInt
;
32 public Type
getType() {
37 public boolean isNull() {
42 public boolean equals(@Nullable Object object
) {
43 if (!(object
instanceof IntegerStateValue
)) {
46 IntegerStateValue other
= (IntegerStateValue
) object
;
47 return (this.value
== other
.value
);
51 public int hashCode() {
56 public @Nullable String
toString() {
57 return String
.format("%3d", value
); //$NON-NLS-1$
60 // ------------------------------------------------------------------------
62 // ------------------------------------------------------------------------
65 public int unboxInt() {
70 public long unboxLong() {
71 /* It's always safe to up-cast an int into a long */
This page took 0.034038 seconds and 5 git commands to generate.