|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.util.GeoUri
public final class GeoUri
Represents a URI for encoding a geographical position.
Example geo URI: geo:40.714623,-74.006605
This class is immutable. Use the GeoUri.Builder
object to construct a new
instance, or the parse(java.lang.String)
method to parse a geo URI string.
Examples:
GeoUri uri = new GeoUri.Builder(40.714623, -74.006605).coordC(1.1).build(); GeoUri uri = GeoUri.parse("geo:40.714623,-74.006605,1.1"); GeoUri copy = new GeoUri.Builder(original).coordC(2.1).build();
Nested Class Summary | |
---|---|
static class |
GeoUri.Builder
Builder class for GeoUri . |
Field Summary | |
---|---|
static String |
CRS_WGS84
The coordinate reference system used by GPS (the default). |
Method Summary | |
---|---|
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). |
static GeoUri |
parse(String uri)
Parses a geo URI string. |
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CRS_WGS84
Method Detail |
---|
public static GeoUri parse(String uri)
uri
- the URI string (e.g. "geo:40.714623,-74.006605")
IllegalArgumentException
- if the string is not a valid geo URIpublic Double getCoordA()
public Double getCoordB()
public Double getCoordC()
public String getCrs()
public Double getUncertainty()
public String getParameter(String name)
name
- the parameter name
public Map<String,String> getParameters()
public URI toUri()
URI
object from this geo URI.
URI
objectpublic String toString()
toString
in class Object
public String toString(int decimals)
decimals
- the number of decimals to display for floating point
values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |