public class CgiQuery extends Object
| Modifier and Type | Field and Description | 
|---|---|
static String | 
QUERY_CHARS
Legal characters for query part of a URI - see RFC 2396. 
 | 
| Constructor and Description | 
|---|
CgiQuery(String base)
Constructs a CGI query. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
CgiQuery | 
addArgument(String name,
           double value)
Adds a floating point argument to this query. 
 | 
CgiQuery | 
addArgument(String name,
           float value)
Adds a single-precision floating point argument to this query. 
 | 
CgiQuery | 
addArgument(String name,
           long value)
Adds an integer argument to this query. 
 | 
CgiQuery | 
addArgument(String name,
           String value)
Adds a string argument to this query. 
 | 
void | 
allowUnencodedChars(String extraChars)
Provides a list of characters that will be passed as parameter or
 value content through without percent-encoding. 
 | 
boolean | 
equals(Object o)  | 
static String | 
formatDouble(double value)
Formats a double precision value. 
 | 
static String | 
formatDouble(double value,
            int nsf,
            int maxleng)
Formats a floating point value. 
 | 
static String | 
formatFloat(float value)
Formats a single precision value. 
 | 
int | 
hashCode()  | 
String | 
toString()
Returns this query as a string. 
 | 
URL | 
toURL()
Returns this query as a URL. 
 | 
public static final String QUERY_CHARS
public CgiQuery(String base)
base argument may optionally be a
 partially-formed CGI-query, that is, one ending in a '?'
 and zero or more '&name=value' pairs.base - base part of the CGI URLIllegalArgumentException - if base is not a legal
          base URLpublic void allowUnencodedChars(String extraChars)
extraChars - string each of whose characters
                      will not be percent-encodedpublic CgiQuery addArgument(String name, long value)
name - argument namevalue - value for the argumentpublic CgiQuery addArgument(String name, double value)
name - argument namevalue - value for the argumentpublic CgiQuery addArgument(String name, float value)
name - argument namevalue - value for the argumentpublic CgiQuery addArgument(String name, String value)
name - argument namevalue - unescaped value for the argumentpublic URL toURL()
public String toString()
public static String formatDouble(double value)
value - valuepublic static String formatFloat(float value)
value - valuepublic static String formatDouble(double value, int nsf, int maxleng)
value - valuensf - number of significant figuresmaxleng - maximum length of string - if longer than this, 
          will return to exponential notationCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.