All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.parameter.FloatValue Maven / Gradle / Ivy

There is a newer version: 5.10.7
Show newest version
package org.yamcs.parameter;

import org.yamcs.protobuf.Yamcs.Value.Type;

public class FloatValue extends Value {
    final float v;

    public FloatValue(float v) {
        this.v = v;
    }

    @Override
    public Type getType() {
        return Type.FLOAT;
    }

    @Override
    public float getFloatValue() {
        return v;
    }

    @Override
    public double toDouble() {
        return v;
    }

    @Override
    public int hashCode() {
        return Float.hashCode(v);
    }

    public boolean equals(Object obj) {
        return (obj instanceof FloatValue)
                && (Float.floatToIntBits(((FloatValue) obj).v) == Float.floatToIntBits(v));
    }

    @Override
    public String toString() {
        return Float.toString(v);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy