Exemplo n.º 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;
 }
Exemplo n.º 2
0
 @Override
 public Object getValueAt(int rowIndex, int columnIndex) {
   if (rowIndex == levels.getSize()) {
     return null;
   }
   switch (columnIndex) {
     case 0:
       return rowIndex + 1;
     case 1:
       return levels.getHPGained(levels.getElementAt(rowIndex));
     case 2:
       ClassFacade c = levels.getClassTaken(levels.getElementAt(rowIndex));
       String classKey = c.getKeyName();
       if (finalLevelMap.get(classKey) == rowIndex) {
         return c.toString() + " (" + character.getClassLevel(c) + ")";
       }
       return c.toString();
     default:
       return null;
   }
 }
Exemplo n.º 3
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$
 }
Exemplo n.º 4
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;
 }