Browse Source

Added xtgend generated classes for sexec

Andreas Mülder 13 years ago
parent
commit
0c8a1dc46f

+ 291 - 0
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FactoryExtension.java

@@ -0,0 +1,291 @@
+package org.yakindu.sct.model.sexec.transformation;
+
+import com.google.inject.Inject;
+import java.util.ArrayList;
+import java.util.HashMap;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.xtext.naming.IQualifiedNameProvider;
+import org.eclipse.xtext.naming.QualifiedName;
+import org.eclipse.xtext.xbase.lib.CollectionLiterals;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
+import org.yakindu.sct.model.sexec.Call;
+import org.yakindu.sct.model.sexec.Check;
+import org.yakindu.sct.model.sexec.CheckRef;
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.ExecutionState;
+import org.yakindu.sct.model.sexec.ScheduleTimeEvent;
+import org.yakindu.sct.model.sexec.SexecFactory;
+import org.yakindu.sct.model.sexec.Step;
+import org.yakindu.sct.model.sexec.TimeEvent;
+import org.yakindu.sct.model.sexec.UnscheduleTimeEvent;
+import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
+import org.yakindu.sct.model.sgraph.Reaction;
+import org.yakindu.sct.model.sgraph.Scope;
+import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statechart;
+import org.yakindu.sct.model.sgraph.Statement;
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.stext.stext.EventDefinition;
+import org.yakindu.sct.model.stext.stext.InterfaceScope;
+import org.yakindu.sct.model.stext.stext.InternalScope;
+import org.yakindu.sct.model.stext.stext.LocalReaction;
+import org.yakindu.sct.model.stext.stext.ReactionTrigger;
+import org.yakindu.sct.model.stext.stext.StextFactory;
+import org.yakindu.sct.model.stext.stext.VariableDefinition;
+
+@SuppressWarnings("all")
+public class FactoryExtension {
+  
+  @Inject
+  private IQualifiedNameProvider qfnProvider;
+  
+  @Inject
+  private StatechartExtensions sce;
+  
+  private final HashMap<ArrayList<?>,ExecutionFlow> _createCache_create = new HashMap<ArrayList<?>,ExecutionFlow>();
+  
+  public ExecutionFlow create(final Statechart statechart) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(statechart);
+    final ExecutionFlow r;
+    synchronized (_createCache_create) {
+      if (_createCache_create.containsKey(_cacheKey)) {
+        return _createCache_create.get(_cacheKey);
+      }
+      SexecFactory _sexecFactory = this.sexecFactory();
+      ExecutionFlow _createExecutionFlow = _sexecFactory.createExecutionFlow();
+      r = _createExecutionFlow;
+      _createCache_create.put(_cacheKey, r);
+    }
+    String _name = statechart.getName();
+    r.setName(_name);
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,InterfaceScope> _createCache_create_1 = new HashMap<ArrayList<?>,InterfaceScope>();
+  
+  protected Scope _create(final InterfaceScope scope) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
+    final InterfaceScope r;
+    synchronized (_createCache_create_1) {
+      if (_createCache_create_1.containsKey(_cacheKey)) {
+        return _createCache_create_1.get(_cacheKey);
+      }
+      StextFactory _stextFactory = this.stextFactory();
+      InterfaceScope _createInterfaceScope = _stextFactory.createInterfaceScope();
+      r = _createInterfaceScope;
+      _createCache_create_1.put(_cacheKey, r);
+    }
+    String _name = scope.getName();
+    r.setName(_name);
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,InternalScope> _createCache_create_2 = new HashMap<ArrayList<?>,InternalScope>();
+  
+  protected Scope _create(final InternalScope scope) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
+    final InternalScope r;
+    synchronized (_createCache_create_2) {
+      if (_createCache_create_2.containsKey(_cacheKey)) {
+        return _createCache_create_2.get(_cacheKey);
+      }
+      StextFactory _stextFactory = this.stextFactory();
+      InternalScope _createInternalScope = _stextFactory.createInternalScope();
+      r = _createInternalScope;
+      _createCache_create_2.put(_cacheKey, r);
+    }
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,EventDefinition> _createCache_create_3 = new HashMap<ArrayList<?>,EventDefinition>();
+  
+  public EventDefinition create(final EventDefinition event) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(event);
+    final EventDefinition r;
+    synchronized (_createCache_create_3) {
+      if (_createCache_create_3.containsKey(_cacheKey)) {
+        return _createCache_create_3.get(_cacheKey);
+      }
+      EventDefinition _copy = EcoreUtil.<EventDefinition>copy(event);
+      r = _copy;
+      _createCache_create_3.put(_cacheKey, r);
+    }
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,VariableDefinition> _createCache_create_4 = new HashMap<ArrayList<?>,VariableDefinition>();
+  
+  public VariableDefinition create(final VariableDefinition v) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(v);
+    final VariableDefinition r;
+    synchronized (_createCache_create_4) {
+      if (_createCache_create_4.containsKey(_cacheKey)) {
+        return _createCache_create_4.get(_cacheKey);
+      }
+      VariableDefinition _copy = EcoreUtil.<VariableDefinition>copy(v);
+      r = _copy;
+      _createCache_create_4.put(_cacheKey, r);
+    }
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,ExecutionState> _createCache_create_5 = new HashMap<ArrayList<?>,ExecutionState>();
+  
+  public ExecutionState create(final State state) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(state);
+    final ExecutionState r;
+    synchronized (_createCache_create_5) {
+      if (_createCache_create_5.containsKey(_cacheKey)) {
+        return _createCache_create_5.get(_cacheKey);
+      }
+      SexecFactory _sexecFactory = this.sexecFactory();
+      ExecutionState _createExecutionState = _sexecFactory.createExecutionState();
+      r = _createExecutionState;
+      _createCache_create_5.put(_cacheKey, r);
+    }
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(state, null);
+    if (_operator_notEquals) {
+      {
+        String _name = state.getName();
+        r.setSimpleName(_name);
+        QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(state);
+        String _string = _fullyQualifiedName.toString();
+        String _replaceAll = _string.replaceAll(" ", "");
+        r.setName(_replaceAll);
+      }
+    }
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,Check> _createCache_createCheck = new HashMap<ArrayList<?>,Check>();
+  
+  public Check createCheck(final ReactionTrigger tr) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
+    final Check r;
+    synchronized (_createCache_createCheck) {
+      if (_createCache_createCheck.containsKey(_cacheKey)) {
+        return _createCache_createCheck.get(_cacheKey);
+      }
+      SexecFactory _sexecFactory = this.sexecFactory();
+      Check _createCheck = _sexecFactory.createCheck();
+      r = _createCheck;
+      _createCache_createCheck.put(_cacheKey, r);
+    }
+    Reaction _reaction = this.sce.reaction(tr);
+    String _id = this.sce.id(_reaction);
+    r.setName(_id);
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_6 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
+  
+  public org.yakindu.sct.model.sexec.Reaction create(final Transition tr) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
+    final org.yakindu.sct.model.sexec.Reaction r;
+    synchronized (_createCache_create_6) {
+      if (_createCache_create_6.containsKey(_cacheKey)) {
+        return _createCache_create_6.get(_cacheKey);
+      }
+      SexecFactory _sexecFactory = this.sexecFactory();
+      org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
+      r = _createReaction;
+      _createCache_create_6.put(_cacheKey, r);
+    }
+    {
+      String _id = this.sce.id(tr);
+      r.setName(_id);
+      r.setTransition(true);
+    }
+    return r;
+  }
+  
+  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_7 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
+  
+  public org.yakindu.sct.model.sexec.Reaction create(final LocalReaction lr) {
+    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(lr);
+    final org.yakindu.sct.model.sexec.Reaction r;
+    synchronized (_createCache_create_7) {
+      if (_createCache_create_7.containsKey(_cacheKey)) {
+        return _createCache_create_7.get(_cacheKey);
+      }
+      SexecFactory _sexecFactory = this.sexecFactory();
+      org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
+      r = _createReaction;
+      _createCache_create_7.put(_cacheKey, r);
+    }
+    {
+      String _id = this.sce.id(lr);
+      r.setName(_id);
+      r.setTransition(false);
+    }
+    return r;
+  }
+  
+  public CheckRef newRef(final Check check) {
+    CheckRef _xblockexpression = null;
+    {
+      SexecFactory _sexecFactory = this.sexecFactory();
+      CheckRef _createCheckRef = _sexecFactory.createCheckRef();
+      final CheckRef r = _createCheckRef;
+      r.setCheck(check);
+      _xblockexpression = (r);
+    }
+    return _xblockexpression;
+  }
+  
+  public Call newCall(final Step step) {
+    Call _xblockexpression = null;
+    {
+      SexecFactory _sexecFactory = this.sexecFactory();
+      Call _createCall = _sexecFactory.createCall();
+      final Call r = _createCall;
+      r.setStep(step);
+      _xblockexpression = (r);
+    }
+    return _xblockexpression;
+  }
+  
+  public ScheduleTimeEvent newScheduleTimeEvent(final TimeEvent te, final Statement timeValue) {
+    ScheduleTimeEvent _xblockexpression = null;
+    {
+      SexecFactory _sexecFactory = this.sexecFactory();
+      ScheduleTimeEvent _createScheduleTimeEvent = _sexecFactory.createScheduleTimeEvent();
+      final ScheduleTimeEvent r = _createScheduleTimeEvent;
+      r.setTimeEvent(te);
+      r.setTimeValue(timeValue);
+      _xblockexpression = (r);
+    }
+    return _xblockexpression;
+  }
+  
+  public UnscheduleTimeEvent newUnscheduleTimeEvent(final TimeEvent te) {
+    UnscheduleTimeEvent _xblockexpression = null;
+    {
+      SexecFactory _sexecFactory = this.sexecFactory();
+      UnscheduleTimeEvent _createUnscheduleTimeEvent = _sexecFactory.createUnscheduleTimeEvent();
+      final UnscheduleTimeEvent r = _createUnscheduleTimeEvent;
+      r.setTimeEvent(te);
+      _xblockexpression = (r);
+    }
+    return _xblockexpression;
+  }
+  
+  public SexecFactory sexecFactory() {
+    return SexecFactory.eINSTANCE;
+  }
+  
+  public StextFactory stextFactory() {
+    return StextFactory.eINSTANCE;
+  }
+  
+  public Scope create(final Scope scope) {
+    if ((scope instanceof InterfaceScope)) {
+      return _create((InterfaceScope)scope);
+    } else if ((scope instanceof InternalScope)) {
+      return _create((InternalScope)scope);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(scope).toString());
+    }
+  }
+}

File diff suppressed because it is too large
+ 1672 - 0
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java


+ 273 - 0
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java

@@ -0,0 +1,273 @@
+package org.yakindu.sct.model.sexec.transformation;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.EcoreUtil2;
+import org.eclipse.xtext.xbase.lib.ComparableExtensions;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.Functions.Function2;
+import org.eclipse.xtext.xbase.lib.IntegerExtensions;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
+import org.eclipse.xtext.xbase.lib.StringExtensions;
+import org.yakindu.sct.model.sgraph.Reaction;
+import org.yakindu.sct.model.sgraph.ReactiveElement;
+import org.yakindu.sct.model.sgraph.Region;
+import org.yakindu.sct.model.sgraph.Scope;
+import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statechart;
+import org.yakindu.sct.model.sgraph.Transition;
+import org.yakindu.sct.model.sgraph.Trigger;
+import org.yakindu.sct.model.sgraph.Vertex;
+import org.yakindu.sct.model.stext.stext.LocalReaction;
+import org.yakindu.sct.model.stext.stext.TimeEventSpec;
+
+@SuppressWarnings("all")
+public class StatechartExtensions {
+  
+  public int maxOrthogonality(final Statechart sc) {
+    EList<Region> _regions = sc.getRegions();
+    final Function2<Integer,Region,Integer> _function = new Function2<Integer,Region,Integer>() {
+        public Integer apply(final Integer o , final Region r) {
+          int _maxOrthogonality = StatechartExtensions.this.maxOrthogonality(r);
+          int _operator_plus = IntegerExtensions.operator_plus(((Integer)_maxOrthogonality), o);
+          return ((Integer)_operator_plus);
+        }
+      };
+    Integer _fold = IterableExtensions.<Region, Integer>fold(_regions, ((Integer)0), _function);
+    return _fold;
+  }
+  
+  public int maxOrthogonality(final Region r) {
+    EList<Vertex> _vertices = r.getVertices();
+    final Function2<Integer,Vertex,Integer> _function = new Function2<Integer,Vertex,Integer>() {
+        public Integer apply(final Integer s , final Vertex v) {
+          int _xblockexpression = (int) 0;
+          {
+            int _maxOrthogonality = StatechartExtensions.this.maxOrthogonality(v);
+            final int mo = _maxOrthogonality;
+            int _xifexpression = (int) 0;
+            boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)mo), s);
+            if (_operator_greaterThan) {
+              _xifexpression = mo;
+            } else {
+              _xifexpression = s;
+            }
+            _xblockexpression = (_xifexpression);
+          }
+          return ((Integer)_xblockexpression);
+        }
+      };
+    Integer _fold = IterableExtensions.<Vertex, Integer>fold(_vertices, ((Integer)0), _function);
+    return _fold;
+  }
+  
+  protected int _maxOrthogonality(final Vertex v) {
+    return 0;
+  }
+  
+  protected int _maxOrthogonality(final State s) {
+    Integer _xifexpression = null;
+    EList<Region> _subRegions = s.getSubRegions();
+    int _size = _subRegions.size();
+    boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)0));
+    if (_operator_greaterThan) {
+      EList<Region> _subRegions_1 = s.getSubRegions();
+      final Function2<Integer,Region,Integer> _function = new Function2<Integer,Region,Integer>() {
+          public Integer apply(final Integer o , final Region r) {
+            int _maxOrthogonality = StatechartExtensions.this.maxOrthogonality(r);
+            int _operator_plus = IntegerExtensions.operator_plus(((Integer)_maxOrthogonality), o);
+            return ((Integer)_operator_plus);
+          }
+        };
+      Integer _fold = IterableExtensions.<Region, Integer>fold(_subRegions_1, ((Integer)0), _function);
+      _xifexpression = _fold;
+    } else {
+      _xifexpression = 1;
+    }
+    return _xifexpression;
+  }
+  
+  public Reaction reaction(final Trigger tr) {
+    EObject _eContainer = tr.eContainer();
+    return ((Reaction) _eContainer);
+  }
+  
+  public Statechart statechart(final State state) {
+    Region _parentRegion = state.getParentRegion();
+    Statechart _statechart = this.statechart(_parentRegion);
+    return _statechart;
+  }
+  
+  public Statechart statechart(final Region region) {
+    Statechart _xifexpression = null;
+    EObject _eContainer = region.eContainer();
+    if ((_eContainer instanceof org.yakindu.sct.model.sgraph.Statechart)) {
+      EObject _eContainer_1 = region.eContainer();
+      _xifexpression = ((Statechart) _eContainer_1);
+    } else {
+      EObject _eContainer_2 = region.eContainer();
+      Statechart _statechart = this.statechart(((State) _eContainer_2));
+      _xifexpression = _statechart;
+    }
+    return _xifexpression;
+  }
+  
+  public List<TimeEventSpec> timeEventSpecs(final State state) {
+    {
+      ArrayList<TimeEventSpec> _arrayList = new ArrayList<TimeEventSpec>();
+      ArrayList<TimeEventSpec> tesList = _arrayList;
+      EList<Transition> _outgoingTransitions = state.getOutgoingTransitions();
+      final Function2<ArrayList<TimeEventSpec>,Transition,ArrayList<TimeEventSpec>> _function = new Function2<ArrayList<TimeEventSpec>,Transition,ArrayList<TimeEventSpec>>() {
+          public ArrayList<TimeEventSpec> apply(final ArrayList<TimeEventSpec> s , final Transition r) {
+            ArrayList<TimeEventSpec> _xblockexpression = null;
+            {
+              List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(r);
+              Iterable<TimeEventSpec> _filter = IterableExtensions.<TimeEventSpec>filter(_eAllContentsAsList, org.yakindu.sct.model.stext.stext.TimeEventSpec.class);
+              final Function1<TimeEventSpec,Boolean> _function_1 = new Function1<TimeEventSpec,Boolean>() {
+                  public Boolean apply(final TimeEventSpec tes) {
+                    boolean _add = s.add(tes);
+                    return ((Boolean)_add);
+                  }
+                };
+              IterableExtensions.<TimeEventSpec>forEach(_filter, _function_1);
+              _xblockexpression = (s);
+            }
+            return _xblockexpression;
+          }
+        };
+      IterableExtensions.<Transition, ArrayList<TimeEventSpec>>fold(_outgoingTransitions, tesList, _function);
+      EList<Reaction> _localReactions = state.getLocalReactions();
+      final Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>> _function_2 = new Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>>() {
+          public ArrayList<TimeEventSpec> apply(final ArrayList<TimeEventSpec> s_1 , final Reaction r_1) {
+            ArrayList<TimeEventSpec> _xblockexpression_1 = null;
+            {
+              List<EObject> _eAllContentsAsList_1 = EcoreUtil2.eAllContentsAsList(r_1);
+              Iterable<TimeEventSpec> _filter_1 = IterableExtensions.<TimeEventSpec>filter(_eAllContentsAsList_1, org.yakindu.sct.model.stext.stext.TimeEventSpec.class);
+              final Function1<TimeEventSpec,Boolean> _function_3 = new Function1<TimeEventSpec,Boolean>() {
+                  public Boolean apply(final TimeEventSpec tes_1) {
+                    boolean _add_1 = s_1.add(tes_1);
+                    return ((Boolean)_add_1);
+                  }
+                };
+              IterableExtensions.<TimeEventSpec>forEach(_filter_1, _function_3);
+              _xblockexpression_1 = (s_1);
+            }
+            return _xblockexpression_1;
+          }
+        };
+      IterableExtensions.<Reaction, ArrayList<TimeEventSpec>>fold(_localReactions, tesList, _function_2);
+      return tesList;
+    }
+  }
+  
+  protected ReactiveElement _reactiveElement(final Reaction r) {
+    Scope _scope = this.scope(r);
+    ReactiveElement _reactiveElement = this.reactiveElement(_scope);
+    return _reactiveElement;
+  }
+  
+  protected ReactiveElement _reactiveElement(final Transition tr) {
+    State _xifexpression = null;
+    Vertex _source = tr.getSource();
+    if ((_source instanceof org.yakindu.sct.model.sgraph.State)) {
+      _xifexpression = ((State) tr);
+    } else {
+      _xifexpression = null;
+    }
+    return _xifexpression;
+  }
+  
+  public Scope scope(final Reaction r) {
+    Scope _xifexpression = null;
+    EObject _eContainer = r.eContainer();
+    if ((_eContainer instanceof org.yakindu.sct.model.sgraph.Scope)) {
+      EObject _eContainer_1 = r.eContainer();
+      _xifexpression = ((Scope) _eContainer_1);
+    }
+    return _xifexpression;
+  }
+  
+  public ReactiveElement reactiveElement(final Scope s) {
+    ReactiveElement _xifexpression = null;
+    EObject _eContainer = s.eContainer();
+    if ((_eContainer instanceof org.yakindu.sct.model.sgraph.ReactiveElement)) {
+      EObject _eContainer_1 = s.eContainer();
+      _xifexpression = ((ReactiveElement) _eContainer_1);
+    }
+    return _xifexpression;
+  }
+  
+  protected String _id(final Object obj) {
+    return null;
+  }
+  
+  protected String _id(final Transition t) {
+    Comparable<? extends Object> _xifexpression = null;
+    Vertex _source = t.getSource();
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_source, null);
+    if (_operator_notEquals) {
+      Vertex _source_1 = t.getSource();
+      EList<Transition> _outgoingTransitions = _source_1.getOutgoingTransitions();
+      int _indexOf = _outgoingTransitions.indexOf(t);
+      _xifexpression = _indexOf;
+    } else {
+      _xifexpression = "";
+    }
+    String _operator_plus = StringExtensions.operator_plus("tr", _xifexpression);
+    return _operator_plus;
+  }
+  
+  protected String _id(final LocalReaction t) {
+    Comparable<? extends Object> _xifexpression = null;
+    ReactiveElement _reactiveElement = this.reactiveElement(t);
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_reactiveElement, null);
+    if (_operator_notEquals) {
+      ReactiveElement _reactiveElement_1 = this.reactiveElement(t);
+      EList<Reaction> _localReactions = _reactiveElement_1.getLocalReactions();
+      int _indexOf = _localReactions.indexOf(t);
+      _xifexpression = _indexOf;
+    } else {
+      _xifexpression = "";
+    }
+    String _operator_plus = StringExtensions.operator_plus("lr", _xifexpression);
+    return _operator_plus;
+  }
+  
+  public int maxOrthogonality(final Vertex s) {
+    if ((s instanceof State)) {
+      return _maxOrthogonality((State)s);
+    } else if ((s instanceof Vertex)) {
+      return _maxOrthogonality((Vertex)s);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(s).toString());
+    }
+  }
+  
+  public ReactiveElement reactiveElement(final Reaction tr) {
+    if ((tr instanceof Transition)) {
+      return _reactiveElement((Transition)tr);
+    } else if ((tr instanceof Reaction)) {
+      return _reactiveElement((Reaction)tr);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(tr).toString());
+    }
+  }
+  
+  public String id(final Object t) {
+    if ((t instanceof LocalReaction)) {
+      return _id((LocalReaction)t);
+    } else if ((t instanceof Transition)) {
+      return _id((Transition)t);
+    } else if ((t instanceof Object)) {
+      return _id((Object)t);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(t).toString());
+    }
+  }
+}