コード例 #1
0
ファイル: LanguageNode.java プロジェクト: matmas/pneditor
 public Set<Transition> getNextTransitions() {
   Set<Transition> nextTransitions = new HashSet<Transition>();
   for (LanguageNode node : nextNodes) {
     nextTransitions.add(node.getTransition());
   }
   return nextTransitions;
 }
コード例 #2
0
ファイル: LanguageNode.java プロジェクト: matmas/pneditor
 public LanguageNode getNextNode(Transition transition) {
   for (LanguageNode node : nextNodes) {
     if (node.getTransition() == transition) {
       return node;
     }
   }
   return null;
 }
コード例 #3
0
ファイル: LanguageNode.java プロジェクト: matmas/pneditor
  public Set<FiringSequence> getWrongContinuationsRecursively() {
    Set<FiringSequence> wrongContinuations = new HashSet<FiringSequence>();

    for (Transition disallowedNextTransition : getDisallowedNextTransitions()) {
      FiringSequence firingSequence = new FiringSequence();
      firingSequence.add(disallowedNextTransition);
      wrongContinuations.add(firingSequence);
    }

    for (LanguageNode nextNode : getNextNodes()) {
      for (FiringSequence nextFiringSequence : nextNode.getWrongContinuationsRecursively()) {
        FiringSequence firingSequence = new FiringSequence();
        firingSequence.add(nextNode.transition);
        firingSequence.addAll(nextFiringSequence);
        wrongContinuations.add(firingSequence);
      }
    }

    return wrongContinuations;
  }
コード例 #4
0
ファイル: LanguageNode.java プロジェクト: matmas/pneditor
  public Set<FiringSequence> getCorrectContinuationsRecursively() {
    Set<FiringSequence> correctContinuations = new HashSet<FiringSequence>();

    if (transition != null) { // transition == null if it is rootNode
      FiringSequence firingSequence = new FiringSequence();
      firingSequence.add(transition);
      correctContinuations.add(firingSequence);
    }

    for (LanguageNode nextNode : getNextNodes()) {
      for (FiringSequence nextFiringSequence : nextNode.getCorrectContinuationsRecursively()) {
        FiringSequence firingSequence = new FiringSequence();
        if (transition != null) { // not root node
          firingSequence.add(transition);
        }
        firingSequence.addAll(nextFiringSequence);
        correctContinuations.add(firingSequence);
      }
    }
    return correctContinuations;
  }