/* (non-Javadoc) * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (accept ? 1231 : 1237); result = prime * result + ((colour == null) ? 0 : colour.hashCode()); result = prime * result + ((kind == null) ? 0 : kind.hashCode()); result = prime * result + ((sequence == null) ? 0 : sequence.hashCode()); return result; }
/* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof AugmentPTAData)) return false; final AugmentPTAData other = (AugmentPTAData) obj; if (accept != other.accept) return false; if (colour == null) { if (other.colour != null) return false; } else if (!colour.equals(other.colour)) return false; if (!kind.equals(other.kind)) return false; if (!sequence.equals(other.sequence)) return false; return true; }
/** * Does nothing in the simulator. * * @param mode value loaded from XML. */ @Override public synchronized void Restart(RestartLearningEnum mode) { // First, we call the expected method if (Thread.currentThread() == secondThread) { whatToCompareWith.Restart(mode); rMode = mode; } else decoratedLearner.Restart(mode); syncOnCallOf(KIND_OF_METHOD.M_RESTART); if (Thread.currentThread() != secondThread) { // checking. if (!rMode.equals(mode)) failureCode = new IllegalArgumentException("different Restart mode"); rMode = null; // reset stored data } syncOnCallOf(KIND_OF_METHOD.M_METHODEXIT); // aims to stop one of the threads running fast // from the first checkCall and overwriting the stored value before the other // thread had a chance to use it in a comparison. }