not sure if I understand you correctly, but it looks to me like your DataSet class must implement your Filter interface and it's methods.
as for polymorphism, if your DataSet class implements the Filter interface, it will always pas an 'is a Filter' test.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
By analogy with interfaces like Comparator, I would interpret this as follows:
Create a class (eg "BalanceFilter") that implements Filter, and in its accept(...) method only accepts accounts with balances > some arbitrary threshold value. Then in the DataSet class instantiate a BalanceFilter with threshold value of 1000, and use that instance to filter out the low-balance accounts.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
let me guess ... it says it can't find the geMeasure() method?
well, as far as I know, the Object class doesn't contain such a method, and your maximum is an instance of Object.
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
your maximum should not be an instance of Object, but of one of your own classes (the same as m, I think .. haven't looked at your entire code, just looks to me that way based on the last code you posted)
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
I'll check it at home, but I'm almost leaving here.
I think your problem is the getMax() and such.
you (almost) never should use instances of Object, always classes that extend from Object (which means any class :) )
stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433