public GeoHashQuery joinWith(GeoHashQuery other) { if (other.isPrefix(this)) { return(new GeoHashQuery(this.startValue, other.endValue)); } else if (this.isPrefix(other)) { return(new GeoHashQuery(other.startValue, this.endValue)); } else if (this.isSuperQuery(other)) { return(other); } else if (other.isSuperQuery(this)) { return(this); } else { throw new Exception("Can't join these 2 queries: " + this + ", " + other); } }
public bool canJoinWith(GeoHashQuery other) { return(this.isPrefix(other) || other.isPrefix(this) || this.isSuperQuery(other) || other.isSuperQuery(this)); }