Perry Smith

Java Questions & Answers

Archive

Home / Java Q & A Archive Page 5 / Java Q & A Archive / Java Main Page

Accessing multiple instances
Thursday, 08-Jul-1999 07:10:34

195.216.12.194 writes:

I need to be able to search through a (indeterminate number) of instances of a class, looking for one instance of that class that fits my search criteria, is there some mechanism that will let me do something like..

      For each instance of class
      if instance.property = search criteria then
      do something
:~::~::~::~::~::~:

David


Response
Re: Accessing multiple instances
Monday, 12-Jul-1999 20:28:29

171.210.132.14 writes:

Log all instances of a class within a static method of the class. Then recall a Vector of those instances and run them through a loop checking for whatever conditions you need.:~::~::~::~::~::~:

MikeD


Home / Java Q & A Archive Page 5 / Java Q & A Archive / Java Main Page