public int getValue() {
    if (isExpanded()) {
      if (!andOrTerm2.isExpanded())
        return equalityTerm.getValue();
      if (andOrTerm2.getOp().equals("and")) {
        if (equalityTerm.getValue() != 0 && andOrTerm2.getValue() != 0)
          return 1;
        else
          return 0;
      }
      else if (andOrTerm2.getOp().equals("or")) {
        if (equalityTerm.getValue() != 0 || andOrTerm2.getValue() != 0)
          return 1;
        else
          return 0;
      }
      else
        return equalityTerm.getValue();
    }
    else
      return 1;
  }