lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Messer <bmes...@apache.org>
Subject subclasses of abstract Query class are not implementing all methods
Date Thu, 10 Mar 2005 16:20:15 GMT
Hi,

I would like to cache query objects in a hash map. My implementation 
failed, because not all of the Query classes are implementing the 
necessary method: "public int hashCode()". The same counts for the 
"public boolean equals (Object o)", "public String toString(String 
fieldName)" and "public String toString()". To force all subclasses of 
Query to implement this 4 methods, i would like to make them abstract 
within the base class and implement the missing ones in the subclasses. 
So in Query class itself, it would look:

public abstract String toString(String field);
public abstract String toString();
public abstract int hashCode();
public abstract boolean equals(Object o);

I think this would make the API cleaner and more usable.

Thoughts ???

Bernhard


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message