Пример #1
0
 /* (non-Javadoc)
  * @see java.lang.Object#hashCode()
  */
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + getOuterType().hashCode();
   result = prime * result + ((cls == null) ? 0 : cls.hashCode());
   result = prime * result + ((level == null) ? 0 : level.hashCode());
   result = prime * result + ((rootNode == null) ? 0 : rootNode.hashCode());
   result = prime * result + ((spell == null) ? 0 : spell.hashCode());
   return result;
 }
Пример #2
0
 @Override
 public String toString() {
   String countStr = "";
   if (count != 1) {
     countStr = " (x" + count + ")"; // $NON-NLS-1$ //$NON-NLS-2$
   }
   if (spell != null) {
     return spell.toString() + countStr;
   } else if (cls != null) {
     return cls.toString() + countStr;
   } else if (rootNode != null) {
     return rootNode.toString() + countStr;
   }
   return LanguageBundle.getFormattedString("in_spellEmptyNode", countStr); // $NON-NLS-1$
 }
Пример #3
0
 /* (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 (getClass() != obj.getClass()) {
     return false;
   }
   SpellNodeImpl other = (SpellNodeImpl) obj;
   if (!getOuterType().equals(other.getOuterType())) {
     return false;
   }
   if (level == null) {
     if (other.level != null) {
       return false;
     }
   } else if (!level.equals(other.level)) {
     return false;
   }
   if (spell == null) {
     if (other.spell != null) {
       return false;
     }
   } else if (!spell.equals(other.spell)) {
     return false;
   }
   if (cls == null) {
     if (other.cls != null) {
       return false;
     }
   } else if (!cls.equals(other.cls)) {
     return false;
   }
   if (rootNode == null) {
     if (other.rootNode != null) {
       return false;
     }
   } else if (!rootNode.equals(other.rootNode)) {
     return false;
   }
   return true;
 }