1 17 18 package SOFA.SOFAnode.Util.DFSRChecker.state; 19 20 31 public class DenotedState extends State { 32 33 40 public DenotedState(int index, State state, int children) { 41 this.index = index; 42 this.state = state; 43 this.children = children; 44 } 45 46 47 50 protected void createSignature() { 51 if (index == -1) 52 for (int i = 0; i < children; ++i) 53 signature.set(i, true); 55 else 56 for (int i = 0; i < children; ++i) 57 signature.set(i, (index & (1 << i)) != 0 ? true : false); 58 59 signature.concat(state.getSignature()); 60 } 61 62 65 public boolean equals(State another) { 66 if (!(another instanceof DenotedState)) 67 return false; 68 69 DenotedState dstate = (DenotedState) another; 70 71 if (this.index != dstate.index) 72 return false; 73 74 if (this.signature == null) 75 this.getSignature(); 76 77 if (another.signature == null) 78 another.getSignature(); 79 80 return this.getSignature().equals(dstate.getSignature()); 81 } 82 83 86 final public int index; 87 88 91 final public State state; 92 93 96 private int children; 97 98 99 } 100 | Popular Tags |