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:net.sf.jasperreports.chartthemes.spring.ScaledDialRange.java

/**
 * Returns a hash code for this instance.
 * //from  w  ww  .  ja v  a2  s. c om
 * @return The hash code.
 */
@Override
public int hashCode() {
    int temp = Float.floatToIntBits(this.lineWidth);
    return 37 * super.hashCode() + (temp ^ (temp >>> 32));

}

From source file:com.xtt.mediatheque.model.Artwork.java

@Override
public boolean equals(final Object obj) {
    if (obj == null) {
        return false;
    }/*from  w  ww  .  j a v a  2  s .  c o m*/
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Artwork other = (Artwork) obj;
    if (Float.floatToIntBits(this.aspectRatio) != Float.floatToIntBits(other.aspectRatio)) {
        return false;
    }
    if ((this.filePath == null) ? (other.filePath != null) : !this.filePath.equals(other.filePath)) {
        return false;
    }
    if (this.height != other.height) {
        return false;
    }
    if ((this.language == null) ? (other.language != null) : !this.language.equals(other.language)) {
        return false;
    }
    if (this.width != other.width) {
        return false;
    }
    if (this.artworkType != other.artworkType) {
        return false;
    }
    return true;
}

From source file:parquet.column.statistics.bloomfilter.BloomFilter.java

public void addFloat(float val) {
    addLong(Float.floatToIntBits(val));
}

From source file:com.alibaba.citrus.util.internal.apache.lang.HashCodeBuilderTests.java

public void testFloat() {
    assertEquals(17 * 37, new HashCodeBuilder(17, 37).append(0f).toHashCode());
    float f = 1234.89f;
    int i = Float.floatToIntBits(f);
    assertEquals(17 * 37 + i, new HashCodeBuilder(17, 37).append(f).toHashCode());
}

From source file:org.diorite.nbt.NbtTagFloat.java

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

From source file:cn.remex.core.util.ObjectUtils.java

/**
 * Return the same value as <code>{@link Float#hashCode()}</code>.
 * @see Float#hashCode()/*from w  w  w  .ja va2s . com*/
 */
public static int hashCode(final float flt) {
    return Float.floatToIntBits(flt);
}

From source file:no.abmu.finances.domain.FloatValidator.java

public int hashCode() {
    int result;/* w w w.  j  a  va2s  .  c  om*/
    result = Float.floatToIntBits(lessThan);
    result = 29 * result + Float.floatToIntBits(greaterThan);
    return result;
}

From source file:com.xtt.mediatheque.model.Artwork.java

@Override
public int hashCode() {
    int hash = 3;
    hash = 71 * hash + Float.floatToIntBits(this.aspectRatio);
    hash = 71 * hash + (this.filePath != null ? this.filePath.hashCode() : 0);
    hash = 71 * hash + this.height;
    hash = 71 * hash + (this.language != null ? this.language.hashCode() : 0);
    hash = 71 * hash + this.width;
    hash = 71 * hash + (this.artworkType != null ? this.artworkType.hashCode() : 0);
    return hash;//w  w w .  j a  v  a 2 s .  c  om
}

From source file:uk.co.modularaudio.mads.base.djeq.ui.DJEQMadUiInstance.java

private void recalculateHigh() {
    final float ampToSend = (curHighKilled ? 0.0f : curHighAmp);
    final long lValue = Float.floatToIntBits(ampToSend);
    sendTemporalValueToInstance(DJEQIOQueueBridge.COMMAND_IN_HP_AMP, lValue);
}

From source file:org.onepf.opfmaps.osmdroid.model.BitmapDescriptor.java

@Override
public int hashCode() {
    int result = source.hashCode();
    result = 31 * result + (image != null ? image.hashCode() : 0);
    result = 31 * result + (path != null ? path.hashCode() : 0);
    result = 31 * result + (hue != +0.0f ? Float.floatToIntBits(hue) : 0);
    result = 31 * result + resourceId;//from  w  w w.j  a v  a2  s.  co  m
    return result;
}