예제 #1
0
 public static void clearInstances(ModelRoot modelRoot) {
   InstanceList instances = modelRoot.getInstanceList(InformalArgument_c.class);
   synchronized (instances) {
     for (int i = instances.size() - 1; i >= 0; i--) {
       ((NonRootModelElement) instances.get(i)).delete_unchecked();
     }
   }
 }
예제 #2
0
 private static InformalArgument_c findInformalArgumentInstance(
     ModelRoot modelRoot, ClassQueryInterface_c test, boolean loadComponent) {
   InstanceList instances = modelRoot.getInstanceList(InformalArgument_c.class);
   synchronized (instances) {
     for (int i = 0; i < instances.size(); ++i) {
       InformalArgument_c x = (InformalArgument_c) instances.get(i);
       if (test == null || test.evaluate(x)) {
         if (x.ensureLoaded(loadComponent)) return x;
       }
     }
   }
   return null;
 }
예제 #3
0
 private static Graphnode_c findGraphnodeInstance(
     ModelRoot modelRoot, ClassQueryInterface_c test, boolean loadComponent) {
   InstanceList instances = modelRoot.getInstanceList(Graphnode_c.class);
   synchronized (instances) {
     for (int i = 0; i < instances.size(); ++i) {
       Graphnode_c x = (Graphnode_c) instances.get(i);
       if (test == null || test.evaluate(x)) {
         return x;
       }
     }
   }
   return null;
 }
예제 #4
0
 public static Graphnode_c[] GraphnodeInstances(
     ModelRoot modelRoot, ClassQueryInterface_c test, boolean loadComponent) {
   InstanceList instances = modelRoot.getInstanceList(Graphnode_c.class);
   Vector matches = new Vector();
   synchronized (instances) {
     for (int i = 0; i < instances.size(); ++i) {
       Graphnode_c x = (Graphnode_c) instances.get(i);
       if (test == null || test.evaluate(x)) {
         matches.add(x);
       }
     }
     if (matches.size() > 0) {
       Graphnode_c[] ret_set = new Graphnode_c[matches.size()];
       matches.copyInto(ret_set);
       return ret_set;
     } else {
       return new Graphnode_c[0];
     }
   }
 }
예제 #5
0
 public static InformalArgument_c[] InformalArgumentInstances(
     ModelRoot modelRoot, ClassQueryInterface_c test, boolean loadComponent) {
   if (loadComponent) {
     PersistenceManager.ensureAllInstancesLoaded(modelRoot, InformalArgument_c.class);
   }
   InstanceList instances = modelRoot.getInstanceList(InformalArgument_c.class);
   Vector matches = new Vector();
   synchronized (instances) {
     for (int i = 0; i < instances.size(); ++i) {
       InformalArgument_c x = (InformalArgument_c) instances.get(i);
       if (test == null || test.evaluate(x)) {
         if (x.ensureLoaded(loadComponent)) matches.add(x);
       }
     }
     if (matches.size() > 0) {
       InformalArgument_c[] ret_set = new InformalArgument_c[matches.size()];
       matches.copyInto(ret_set);
       return ret_set;
     } else {
       return new InformalArgument_c[0];
     }
   }
 }