public class CgiQuery
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
QUERY_CHARS
Legal characters for query part of a URI - see RFC 2396.
|
Constructor and Description |
---|
CgiQuery(java.lang.String base)
Constructs a CGI query.
|
Modifier and Type | Method and Description |
---|---|
CgiQuery |
addArgument(java.lang.String name,
double value)
Adds a floating point argument to this query.
|
CgiQuery |
addArgument(java.lang.String name,
float value)
Adds a single-precision floating point argument to this query.
|
CgiQuery |
addArgument(java.lang.String name,
long value)
Adds an integer argument to this query.
|
CgiQuery |
addArgument(java.lang.String name,
java.lang.String value)
Adds a string argument to this query.
|
void |
allowUnencodedChars(java.lang.String extraChars)
Provides a list of characters that will be passed as parameter or
value content through without percent-encoding.
|
boolean |
equals(java.lang.Object o) |
static java.lang.String |
formatDouble(double value)
Formats a double precision value.
|
static java.lang.String |
formatDouble(double value,
int nsf,
int maxleng)
Formats a floating point value.
|
static java.lang.String |
formatFloat(float value)
Formats a single precision value.
|
int |
hashCode() |
java.lang.String |
toString()
Returns this query as a string.
|
java.net.URL |
toURL()
Returns this query as a URL.
|
public static final java.lang.String QUERY_CHARS
public CgiQuery(java.lang.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 URLjava.lang.IllegalArgumentException
- if base
is not a legal
base URLpublic void allowUnencodedChars(java.lang.String extraChars)
extraChars
- string each of whose characters
will not be percent-encodedpublic CgiQuery addArgument(java.lang.String name, long value)
name
- argument namevalue
- value for the argumentpublic CgiQuery addArgument(java.lang.String name, double value)
name
- argument namevalue
- value for the argumentpublic CgiQuery addArgument(java.lang.String name, float value)
name
- argument namevalue
- value for the argumentpublic CgiQuery addArgument(java.lang.String name, java.lang.String value)
name
- argument namevalue
- unescaped value for the argumentpublic java.net.URL toURL()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String formatDouble(double value)
value
- valuepublic static java.lang.String formatFloat(float value)
value
- valuepublic static java.lang.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 notation