mirror of
https://github.com/apache/lucene.git
synced 2025-02-06 18:18:38 +00:00
Add .equals/.hashCode to allow for comparisons of SpanOrQuerys
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@234254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9b3aa1aec0
commit
718380d17e
@ -79,6 +79,25 @@ public class SpanOrQuery extends SpanQuery {
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
final SpanOrQuery that = (SpanOrQuery) o;
|
||||
|
||||
if (!clauses.equals(that.clauses)) return false;
|
||||
if (!field.equals(that.field)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int result;
|
||||
result = clauses.hashCode();
|
||||
result = 29 * result + field.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
private class SpanQueue extends PriorityQueue {
|
||||
public SpanQueue(int size) {
|
||||
initialize(size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user