public class CgiQuery
extends java.lang.Object
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.
|
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 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 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