java - How do I refactor ArrayList<MyClass> into MyClassLIst? -
i have project in eclipse (kepler), , using using following in quite few places
ararylist<person> person;
and
person = new arraylist<person>();
and methods return , take
arraylist<person>
is there easy way refactor arraylist in personarraylist extends arraylist?
i able have methods like
arraylist<people> getallwithphonenumber(string phonenumber) { }
update: underlying reason question based on following need. maintaining list of people objects in arraylist, decided needed have functionality such being able search list , return 1 or more people based on properties. original plan create new class extends arraylist , add methods class.
my current thinking create people class has arraylist rather extending arraylist
i think right approach. please comment if going down bad path.
thanks comments; helped me think thru (i amateur @ stuff, fun learning)
class personarraylist extends arraylist<person>{}
Comments
Post a Comment