private static DescriptionQuery_c findDescriptionQueryInstance( ModelRoot modelRoot, ClassQueryInterface_c test, boolean loadComponent) { InstanceList instances = modelRoot.getInstanceList(DescriptionQuery_c.class); synchronized (instances) { for (int i = 0; i < instances.size(); ++i) { DescriptionQuery_c x = (DescriptionQuery_c) instances.get(i); if (test == null || test.evaluate(x)) { if (x.ensureLoaded(loadComponent)) return x; } } } return null; }
public static DescriptionQuery_c[] DescriptionQueryInstances( ModelRoot modelRoot, ClassQueryInterface_c test, boolean loadComponent) { if (loadComponent) { PersistenceManager.ensureAllInstancesLoaded(modelRoot, DescriptionQuery_c.class); } InstanceList instances = modelRoot.getInstanceList(DescriptionQuery_c.class); Vector matches = new Vector(); synchronized (instances) { for (int i = 0; i < instances.size(); ++i) { DescriptionQuery_c x = (DescriptionQuery_c) instances.get(i); if (test == null || test.evaluate(x)) { if (x.ensureLoaded(loadComponent)) matches.add(x); } } if (matches.size() > 0) { DescriptionQuery_c[] ret_set = new DescriptionQuery_c[matches.size()]; matches.copyInto(ret_set); return ret_set; } else { return new DescriptionQuery_c[0]; } } }