|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.util.GeoUri
public class GeoUri
Represents a "geo" URI.
Example geo URI: geo:12.341,56.784
Field Summary | |
---|---|
protected Double |
coordA
|
protected Double |
coordB
|
protected Double |
coordC
|
protected String |
crs
|
static String |
CRS_WGS84
The coordinate reference system used by GPS (the default). |
protected static Pattern |
hexPattern
Finds hex values in a parameter value. |
protected static String |
PARAM_CRS
|
protected static String |
PARAM_UNCERTAINTY
|
protected Map<String,String> |
parameters
|
protected Double |
uncertainty
|
protected static char[] |
validParamValueChars
The non-alphanumeric characters which are allowed to exist inside of a parameter value. |
Constructor Summary | |
---|---|
GeoUri()
|
|
GeoUri(Double coordA,
Double coordB,
Double coordC,
String crs,
Double uncertainty)
|
|
GeoUri(String uri)
Parses a geo URI string. |
Method Summary | |
---|---|
void |
addParameter(String name,
String value)
Adds a parameter. |
protected NumberFormat |
buildNumberFormat(int decimals)
|
protected String |
decodeParamValue(String value)
|
protected String |
encodeParamValue(String value)
|
boolean |
equals(Object obj)
|
Double |
getCoordA()
Gets the first coordinate (latitude). |
Double |
getCoordB()
Gets the second coordinate (longitude). |
Double |
getCoordC()
Gets the third coordinate (altitude). |
String |
getCrs()
Gets the coordinate reference system. |
String |
getParameter(String name)
Gets a parameter value. |
Map<String,String> |
getParameters()
Gets all the parameters. |
Double |
getUncertainty()
Gets the uncertainty (how accurate the coordinates are). |
protected boolean |
isLabelText(String text)
|
boolean |
isValid()
Determines if the geo URI is valid or not (i.e. |
void |
removeParameter(String name)
Removes a parameter. |
void |
setCoordA(Double coordA)
Sets the first coordinate (latitude). |
void |
setCoordB(Double coordB)
Sets the second coordinate (longitude). |
void |
setCoordC(Double coordC)
Sets the third coordinate (altitude). |
void |
setCrs(String crs)
Sets the coordinate reference system. |
void |
setUncertainty(Double uncertainty)
Sets the uncertainty (how accurate the coordinates are). |
String |
toString()
Converts this geo URI to its string representation. |
String |
toString(int decimals)
Converts this geo URI to its string representation. |
URI |
toUri()
Creates a URI object from this geo URI. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CRS_WGS84
protected static final char[] validParamValueChars
protected static final Pattern hexPattern
protected static final String PARAM_CRS
protected static final String PARAM_UNCERTAINTY
protected Double coordA
protected Double coordB
protected Double coordC
protected String crs
protected Double uncertainty
protected Map<String,String> parameters
Constructor Detail |
---|
public GeoUri()
public GeoUri(Double coordA, Double coordB, Double coordC, String crs, Double uncertainty)
coordA
- the first coordinate (latitude, required)coordB
- the second coordinate (longitude, required)coordC
- the third coordinate (altitude, optional)crs
- the coordinate system (optional, defaults to WGS-84)uncertainty
- the accuracy of the coordinates (in meters, optional)public GeoUri(String uri)
uri
- the URI string
IllegalArgumentException
- if the string is not a valid geo URIMethod Detail |
---|
public Double getCoordA()
public void setCoordA(Double coordA)
coordA
- the first coordinatepublic Double getCoordB()
public void setCoordB(Double coordB)
coordB
- the second coordinatepublic Double getCoordC()
public void setCoordC(Double coordC)
coordC
- the third coordinate or null to removepublic String getCrs()
public void setCrs(String crs)
crs
- the coordinate reference system (can only contain letters,
numbers, and hyphens) or null to use the default (WGS-84)
IllegalArgumentException
- if the CRS name contains invalid
characterspublic Double getUncertainty()
public void setUncertainty(Double uncertainty)
uncertainty
- the uncertainty (in meters) or null to removepublic void addParameter(String name, String value)
name
- the parameter name (can only contain letters, numbers, and
hyphens)value
- the parameter value
IllegalArgumentException
- if the parameter name contains invalid
characterspublic void removeParameter(String name)
name
- the name of the parameter to removepublic String getParameter(String name)
name
- the parameter name
public Map<String,String> getParameters()
public URI toUri()
URI
object from this geo URI.
URI
objectpublic boolean isValid()
public String toString()
toString
in class Object
public String toString(int decimals)
decimals
- the number of decimals to display for floating point
values
protected boolean isLabelText(String text)
protected String encodeParamValue(String value)
protected String decodeParamValue(String value)
protected NumberFormat buildNumberFormat(int decimals)
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |