Пример #1
0
 @Override
 public <T extends IStatement> T getStatement(
     final Class<T> clazz, final String valueOfFacetName) {
   for (final IStatement s : behaviors) {
     final boolean instance = clazz.isAssignableFrom(s.getClass());
     if (instance) {
       if (valueOfFacetName == null) {
         return (T) s;
       }
       final String t = s.getFacet(IKeyword.NAME).literalValue();
       if (t != null) {
         final boolean named = t.equals(valueOfFacetName);
         if (named) {
           return (T) s;
         }
       }
     }
   }
   return null;
 }
Пример #2
0
 @Override
 public void dispose() {
   super.dispose();
   for (final IVariable v : variables.values()) {
     v.dispose();
   }
   variables.clear();
   for (final AspectStatement ac : aspects.values()) {
     ac.dispose();
   }
   aspects.clear();
   for (final ActionStatement ac : actions.values()) {
     ac.dispose();
   }
   actions.clear();
   for (final IStatement c : behaviors) {
     c.dispose();
   }
   behaviors.clear();
   macroSpecies = null;
   parentSpecies = null;
   // TODO dispose micro_species first???
   microSpecies.clear();
 }