1 /*******************************************************************************
2 * Copyright (c) 2013 Ericsson
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
10 * Alexandre Montplaisir - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.tmf
.core
.statevalue
;
15 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 * A state value containing a double primitive.
20 * @author Alexandre Montplaisir
22 final class DoubleStateValue
extends TmfStateValue
{
24 private final double value
;
26 public DoubleStateValue(double value
) {
31 public Type
getType() {
36 public boolean isNull() {
41 public boolean equals(@Nullable Object object
) {
42 if (!(object
instanceof DoubleStateValue
)) {
45 DoubleStateValue other
= (DoubleStateValue
) object
;
46 return (Double
.compare(this.value
, other
.value
) == 0);
50 public int hashCode() {
51 long bits
= Double
.doubleToLongBits(value
);
52 return ((int) bits
) ^
((int) (bits
>>> 32));
56 public @Nullable String
toString() {
57 return String
.format("%3f", value
); //$NON-NLS-1$
60 // ------------------------------------------------------------------------
62 // ------------------------------------------------------------------------
65 public double unboxDouble() {
This page took 0.040016 seconds and 5 git commands to generate.