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