Jörn Kottmann wrote:
No I do not think that they could be changed to take type T.
Lets take the case of the contains method.
The javadoc says:
"Check if the index contains an element equal to the given feature
structure according to the
ordering of the index. Note that this is in general not the same as
feature structure identity."
and it for the param fs it says "The FS we're looking for.". There is
no place where
it says that contains can only be called for FSes which have the type
of the index.
The change of the parameter from FeatureStructure to T would also change
the contract of the method a little, because then it would not be
possible anymore
to pass a FeatureStructure which has not type T.
The java developers had similar case in the Collection interface.
Collection has a contains method which has still the signature
contains(Object)
and not contains(E).
See here:
http://java.sun.com/javase/6/docs/api/java/util/Collection.html
Jörn