1 17 18 package SOFA.SOFAnode.Util.DFSRChecker.DFSR; 19 20 21 import SOFA.SOFAnode.Util.DFSRChecker.node.ConsentNode; 22 import SOFA.SOFAnode.Util.DFSRChecker.node.InvalidParameterException; 23 import SOFA.SOFAnode.Util.DFSRChecker.state.State; 24 25 26 30 public class DFSRConsent implements IDFSRExtension { 31 32 36 public DFSRConsent(ConsentNode automaton) { 37 this.automaton = automaton; 38 } 39 40 43 public void action(State state) throws InvalidParameterException { 44 45 } 46 47 50 public boolean actionNew(State state) throws InvalidParameterException, AcceptingStateException { 51 state.label = new String ("S" + timestamp); 52 state.timestamp = timestamp++; 53 return automaton.isAccepting(state); 54 } 55 56 59 public void actionCycle(State state) throws InvalidParameterException { 60 if (state.getSignature().getCycleId() == Long.MAX_VALUE) { 61 state.cycleStart = true; 62 state.getSignature().setCycleId(state.timestamp); 63 } 64 } 65 66 69 public void actionVisited(State state) throws InvalidParameterException { 70 71 } 72 73 76 public void actionBack(State state) throws InvalidParameterException { 77 78 } 79 80 83 public void reset() { 84 timestamp = 0; 85 } 86 87 91 private long timestamp = 0; 92 93 96 private ConsentNode automaton; 97 } | Popular Tags |