public boolean containsElement(ElementType elementType) {
   if (type.equals(elementType)
       || (leftChild != null && leftChild.containsElement(elementType))
       || (rightChild != null && rightChild.containsElement(elementType))) {
     return true;
   }
   return false;
 }
Exemple #2
0
 /**
  * Returns <CODE>true</CODE> if Element is a halogen (F, Cl, Br, I, At).
  *
  * @return <CODE>true</CODE> if Element is a halogen.
  */
 public boolean isHalogen() {
   return elementType.equals(ElementType.HALOGEN);
 }