public String toString() {

    if (value == null) {
      return " null ";
    }

    StringBuffer sb = new StringBuffer();

    sb.append("[");

    if (value.equalsIgnoreCase("AND") || value.equalsIgnoreCase("OR")) {

      sb.append(children.get(0));
      sb.append(" ");
      sb.append(value);
      sb.append(" ");
      sb.append(children.get(1));

    } else if (value.equalsIgnoreCase("NOT")) {

      sb.append(value);
      sb.append(" ");
      sb.append(children.get(0));

    } else {
      System.out.println("Error # 2");
    }

    sb.append("]");

    return sb.toString();
  }