/*
   *
   *   Date      By	Description
   * MM/DD/YYYY
   * ----------  --	-----------
   * 04/28/2004  INB	Created.
   *
   */
  public AddressPermissions(String stringI) throws java.lang.Exception {
    super();

    int eql = stringI.indexOf("=");

    if (eql == -1) {
      // If there is no equals (=), then the entire thing is the
      // address.
      setAddress(stringI);

    } else if (eql == 0) {
      // No actual address was provided.
      throw new java.lang.IllegalArgumentException("No address provided in " + stringI);

    } else {
      // Otherwise, we have permissions as well as an address.
      String permString = stringI.substring(eql + 1);

      if (permString.length() == 0) {
        // If there are no permissions provided, then that's an
        // error.
        throw new java.lang.IllegalArgumentException(
            "No permissions provided with address " + "epecification " + stringI);
      }

      // Turn on the appropriate permissions bits.
      setPermissions(0x00);
      char permChar;
      int idx1;

      for (int idx = 0; idx < permString.length(); ++idx) {
        // Determine which permission is being granted by each
        // character in the permissions string.
        permChar = permString.charAt(idx);

        // Find the matching access character.
        for (idx1 = 0; idx1 < ACCESS_VALUES.length; ++idx1) {
          if (permChar == ACCESS_VALUES[idx1]) {
            break;
          }
        }

        if (idx1 == ACCESS_VALUES.length) {
          // No matching character was found, throw an exception.
          throw new java.lang.IllegalArgumentException(
              "Unrecognized permission access character in " + stringI);
        }

        // Set the corresponding bit.
        setPermissions(getPermissions() | (0x01 << idx1));
      }

      // Set the address.
      setAddress(stringI.substring(0, eql));
    }

    if (getAddress().equals("*")) {
      // If this is the default wildcard address, then use the
      // default wildcard.
      setWildcard(AddressAuthorization.Wildcard);

    } else if (getAddress().equalsIgnoreCase("localhost")) {
      // If the address is localhost, then map it to the actual localhost
      // address.
      if (Localhost == null) {
        Localhost = TCP.buildAddress("localhost");
        Localhost = Localhost.substring(6, com.rbnb.compat.Utilities.lastIndexOf(Localhost, ":"));
        Localhost_Wildcard = new com.rbnb.utility.Wildcards(Localhost);
      }
      setAddress(Localhost);
      setWildcard(Localhost_Wildcard);

    } else {
      // Otherwise, create a new wildcard.
      setWildcard(new com.rbnb.utility.Wildcards(getAddress()));
    }
  }