Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
r9341 r9371 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.mappaint.styleelement; 3 4 import java.util.Objects; 3 5 4 6 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 66 68 @Override 67 69 public boolean equals(Object obj) { 68 if (obj == null || getClass() != obj.getClass()) 69 return false; 70 if (!super.equals(obj)) 71 return false; 72 final RepeatImageElement other = (RepeatImageElement) obj; 73 if (!this.pattern.equals(other.pattern)) return false; 74 if (this.offset != other.offset) return false; 75 if (this.spacing != other.spacing) return false; 76 if (this.phase != other.phase) return false; 77 if (this.align != other.align) return false; 78 return true; 70 if (this == obj) return true; 71 if (obj == null || getClass() != obj.getClass()) return false; 72 if (!super.equals(obj)) return false; 73 RepeatImageElement that = (RepeatImageElement) obj; 74 return Float.compare(that.offset, offset) == 0 && 75 Float.compare(that.spacing, spacing) == 0 && 76 Float.compare(that.phase, phase) == 0 && 77 Objects.equals(pattern, that.pattern) && 78 align == that.align; 79 79 } 80 80 81 81 @Override 82 82 public int hashCode() { 83 int hash = super.hashCode(); 84 hash = 83 * hash + this.pattern.hashCode(); 85 hash = 83 * hash + Float.floatToIntBits(this.offset); 86 hash = 83 * hash + Float.floatToIntBits(this.spacing); 87 hash = 83 * hash + Float.floatToIntBits(this.phase); 88 hash = 83 * hash + this.align.hashCode(); 89 return hash; 83 return Objects.hash(super.hashCode(), pattern, offset, spacing, phase, align); 90 84 } 91 85
Note:
See TracChangeset
for help on using the changeset viewer.