Advertisement
GenuineSounds

Untitled

Feb 11th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.31 KB | None | 0 0
  1. @Override
  2. public int hashCode() {
  3.     final int prime = 31;
  4.     int result = 1;
  5.     result = prime * result + Float.floatToIntBits(depth);
  6.     result = prime * result + (generate ? 1231 : 1237);
  7.     result = prime * result + Float.floatToIntBits(hardness);
  8.     result = prime * result + nodes;
  9.     result = prime * result + Float.floatToIntBits(rarity);
  10.     result = prime * result + Float.floatToIntBits(resistance);
  11.     result = prime * result + size;
  12.     result = prime * result + Float.floatToIntBits(spread);
  13.     return result;
  14. }
  15.  
  16. @Override
  17. public boolean equals(Object obj) {
  18.     if (this == obj)
  19.         return true;
  20.     if (obj == null)
  21.         return false;
  22.     if (getClass() != obj.getClass())
  23.         return false;
  24.     Settings other = (Settings) obj;
  25.     if (Float.floatToIntBits(depth) != Float.floatToIntBits(other.depth))
  26.         return false;
  27.     if (generate != other.generate)
  28.         return false;
  29.     if (Float.floatToIntBits(hardness) != Float.floatToIntBits(other.hardness))
  30.         return false;
  31.     if (nodes != other.nodes)
  32.         return false;
  33.     if (Float.floatToIntBits(rarity) != Float.floatToIntBits(other.rarity))
  34.         return false;
  35.     if (Float.floatToIntBits(resistance) != Float.floatToIntBits(other.resistance))
  36.         return false;
  37.     if (size != other.size)
  38.         return false;
  39.     if (Float.floatToIntBits(spread) != Float.floatToIntBits(other.spread))
  40.         return false;
  41.     return true;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement