コード例 #1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((fT == null) ? 0 : fT.hashCode());
   result = prime * result + ((fSch == null) ? 0 : fSch.hashCode());
   return result;
 }
コード例 #2
0
 @Override
 public boolean equals(final Object obj) {
   if (this == obj) return true;
   if (!(obj instanceof TeachersOfSchoolMatch)) { // this should be infrequent			
     if (obj == null) return false;
     if (!(obj instanceof IPatternMatch)) return false;
     IPatternMatch otherSig = (IPatternMatch) obj;
     if (!pattern().equals(otherSig.pattern())) return false;
     return Arrays.deepEquals(toArray(), otherSig.toArray());
   }
   TeachersOfSchoolMatch other = (TeachersOfSchoolMatch) obj;
   if (fT == null) {
     if (other.fT != null) return false;
   } else if (!fT.equals(other.fT)) return false;
   if (fSch == null) {
     if (other.fSch != null) return false;
   } else if (!fSch.equals(other.fSch)) return false;
   return true;
 }