1 17 18 19 package SOFA.SOFAnode.Util.DFSRChecker.state; 20 21 22 25 abstract public class State implements Comparable { 26 27 28 public State() { 29 this.signature = new Signature(); 30 this.signatureInit = false; 31 this.label = "<no_label>"; 32 this.cycleStart = false; 33 this.cycleTrace = null; 36 } 37 38 43 public boolean equals(State another) { 44 return this.getSignature().equals(another.getSignature()); 45 } 46 47 48 52 public Signature getSignature() { 53 if (!this.signatureInit) { 54 createSignature(); 55 signatureInit = true; 56 } 57 58 return this.signature; 60 } 61 62 66 public int compareTo(Object o) { 67 if (o instanceof State) { 68 return this.getSignature().compareTo(((State)o).getSignature()); 69 } 70 else 71 return -1; 72 } 73 74 75 79 public boolean isAcceptingReachable() { 80 return ((signature.acceptingCycleId >> 63) & 1) != 0; 81 } 82 83 86 abstract protected void createSignature(); 87 88 89 90 95 protected Signature signature; 96 97 101 public String label; 102 103 106 public boolean cycleStart; 107 108 111 public long timestamp; 112 113 116 public String cycleTrace; 117 118 121 private boolean signatureInit; 122 123 } 124 125 | Popular Tags |