Example usage for java.lang Float floatToIntBits

List of usage examples for java.lang Float floatToIntBits

Introduction

In this page you can find the example usage for java.lang Float floatToIntBits.

Prototype

@HotSpotIntrinsicCandidate
public static int floatToIntBits(float value) 

Source Link

Document

Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout.

Usage

From source file:com.quartercode.disconnected.sim.member.interest.Interest.java

@Override
public int hashCode() {

    final int prime = 31;
    int result = 1;
    result = prime * result + Float.floatToIntBits(priority);
    return result;
}

From source file:it.univaq.disim.mobile.cityshop.business.domain.Prodotto.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }/*from  ww w . java  2s . c o m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Prodotto other = (Prodotto) obj;
    if (this.id != other.id) {
        return false;
    }
    if (Float.floatToIntBits(this.prezzo) != Float.floatToIntBits(other.prezzo)) {
        return false;
    }
    if (!Objects.equals(this.nome, other.nome)) {
        return false;
    }
    if (!Objects.equals(this.descrizione, other.descrizione)) {
        return false;
    }
    if (!Objects.equals(this.foto, other.foto)) {
        return false;
    }
    if (!Objects.equals(this.categoria, other.categoria)) {
        return false;
    }
    if (!Objects.equals(this.brand, other.brand)) {
        return false;
    }
    if (!Objects.equals(this.negozio, other.negozio)) {
        return false;
    }
    return true;
}

From source file:Encdec.java

public static int enc_floatbe(float f, byte[] dst, int di) {
    return enc_uint32be(Float.floatToIntBits(f), dst, di);
}

From source file:com.coroptis.coidi.op.view.entities.AbstractEntity.java

/**
 * Utility method for <code>equals()</code> methods.
 * //from   w ww  .  ja  v a 2s.  com
 * @param f1
 *            one float
 * @param f2
 *            another float
 * @return <code>true</code> if they're equal
 */
protected boolean areEqual(final float f1, final float f2) {
    return Float.floatToIntBits(f1) == Float.floatToIntBits(f2);
}

From source file:com.hybris.mobile.lib.location.geofencing.data.GeofenceObject.java

@Override
public int hashCode() {
    int result;/*from w w w  .  j  a v  a 2  s .  co m*/
    long temp;
    result = id != null ? id.hashCode() : 0;
    temp = Double.doubleToLongBits(latitude);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(longitude);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    result = 31 * result + (radius != +0.0f ? Float.floatToIntBits(radius) : 0);
    result = 31 * result + (int) (expirationDuration ^ (expirationDuration >>> 32));
    result = 31 * result + transitionType;
    result = 31 * result + (notificationByTransition != null ? notificationByTransition.hashCode() : 0);
    return result;
}

From source file:org.diorite.material.ToolData.java

@Override
public int hashCode() {
    int result = this.toolMaterial.hashCode();
    result = (31 * result) + this.toolType.hashCode();
    result = (31 * result) + ((this.damage != +0.0f) ? Float.floatToIntBits(this.damage) : 0);
    result = (31 * result) + ((this.attackSpeed != +0.0f) ? Float.floatToIntBits(this.attackSpeed) : 0);
    return result;
}

From source file:HashCode.java

/**
 * Calculates hash code for floats.// www  .  ja  va2 s  . co m
 */
public static int hash(int seed, float aFloat) {
    return hash(seed, Float.floatToIntBits(aFloat));
}

From source file:com.quartercode.disconnected.sim.member.interest.Interest.java

@Override
public boolean equals(Object obj) {

    if (this == obj) {
        return true;
    }/*w  w w.j  av  a 2 s .c om*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    Interest other = (Interest) obj;
    if (Float.floatToIntBits(priority) != Float.floatToIntBits(other.priority)) {
        return false;
    }
    return true;
}

From source file:Main.java

/** Equals for <tt>float</tt> fields. */
static public boolean areEqual(float aThis, float aThat) {

    return Float.floatToIntBits(aThis) == Float.floatToIntBits(aThat);
}

From source file:net.sf.fspdfs.chartthemes.spring.ScaledDialRange.java

/**
 * Returns a hash code for this instance.
 * /* w  w w.j a va2  s  . co  m*/
 * @return The hash code.
 */
public int hashCode() {
    int temp = Float.floatToIntBits(this.lineWidth);
    return 37 * super.hashCode() + (temp ^ (temp >>> 32));

}