Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
package org.locationtech.jtstest.geomfunction;


import java.util.Arrays;

import org.locationtech.jts.geom.Geometry;
import org.locationtech.jtstest.util.*;

Expand Down Expand Up @@ -177,6 +179,20 @@ public boolean equals(Object obj)
return true;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + Arrays.hashCode(parameterNames);
result = prime * result + Arrays.hashCode(parameterTypes);
result = prime * result + ((returnType == null) ? 0 : returnType.hashCode());
return result;
}

public int compareTo(Object o)
{
GeometryFunction func = (GeometryFunction) o;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,21 @@ public boolean equals(Object other) {
return modelType == otherPrecisionModel.modelType
&& scale == otherPrecisionModel.scale;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((modelType == null) ? 0 : modelType.hashCode());
long temp;
temp = Double.doubleToLongBits(scale);
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}

/**
* Compares this {@link PrecisionModel} object with the specified object for order.
* A PrecisionModel is greater than another if it provides greater precision.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,29 @@ public boolean equals(Object obj)
&& m12 == trans.m12;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(m00);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(m01);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(m02);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(m10);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(m11);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(m12);
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}

/**
* Gets a text representation of this transformation.
* The string is of the form:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,27 @@ public boolean equals(Object o)
return true;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + pts.length;
if (pts.length > 0) {
Coordinate p0 = pts[0];
Coordinate p1 = pts[pts.length - 1];
if (1 == p0.compareTo(p1)) {
p0 = pts[pts.length - 1];
p1 = pts[0];
}
result = prime * result + p0.hashCode();
result = prime * result + p1.hashCode();
}
return result;
}

/**
* Check if coordinate sequences of the Edges are identical.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,25 @@ public Interval expandToInclude(Interval other) {
public boolean intersects(Interval other) {
return !(other.min > max || other.max < min);
}

public boolean equals(Object o) {
if (! (o instanceof Interval)) { return false; }
Interval other = (Interval) o;
return min == other.min && max == other.max;
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
long temp;
temp = Double.doubleToLongBits(max);
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits(min);
result = prime * result + (int) (temp ^ (temp >>> 32));
return result;
}
}