Examples

Parse the kml document yourself using a custom mapping function.

    String addressLine1 = st.standardize("1600 Amphitheatre Parkway, california ", 
    new XmlMappingFunctor<String>(){
      public String execute(String xml) {
        Document doc;
        try {
          //parse the xml string into a document object
          doc = XmlUtils.parse(xml);
          //use XPath to select an value from the document
          return XmlUtils.selectValue(doc, "//ThoroughfareName");
        }
        catch (Exception e){
          throw new GeoException("Unable to parse xml", e);
        }
      }
    });
    
    System.out.println(addressLine1);     

Using additional Utilities functions (see Javadoc for more info):

        GeoUtils.distanceBetweenInKm(usAddr.getCoordinate(), usAddr.getCoordinate());
    GeoUtils.distanceBetweenInMiles(usAddr.getCoordinate(), usAddr.getCoordinate());
    GeoUtils.haversineDistanceBetweenInKm(usAddr.getCoordinate(), usAddr.getCoordinate());
    GeoUtils.haversineDistanceBetweenInMiles(usAddr.getCoordinate(), usAddr.getCoordinate());   

Using Functor and FunctionChain (see Javadoc for more info):

    Functor<Integer, Integer, RuntimeException> add1 = new Functor<Integer, Integer, RuntimeException>(){
      public Integer execute(Integer arg) {
        return arg+1;
      }
    };
    
    FunctionChain<Integer> add2 = new FunctionChain<Integer>(new Functor[]{add1, add1});
    FunctionChain<Integer> add3 = new FunctionChain<Integer>(add1, add2);
        System.out.println(add1.execute(1));
    System.out.println(add2.execute(1));
    System.out.println(add3.execute(1));    

An instance of the kml document returned by Google's geocoding service, you need to parse this xml if you choose to do the parsing yourself. http://www.google.com/apis/maps/documentation/#Geocoding_HTTP_Request

Google did not provide a schema for this document, so I had to create one myself. see geoGoogleSchema.xsd which references a modified schema of xAL.xsd

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
        <Response>
                <name>1600 Amphitheatre Parkway, Mountain View, CA</name>
                <Status>
                        <code>200</code>
                        <request>geocode</request>
                </Status>
                <Placemark id="p1">
                        <address>1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA</address>
                        <AddressDetails Accuracy="8"
                                xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                                <Country>
                                        <CountryNameCode>US</CountryNameCode>
                                        <AdministrativeArea>
                                                <AdministrativeAreaName>CA</AdministrativeAreaName>
                                                <SubAdministrativeArea>
                                                        <SubAdministrativeAreaName>
                                                                Santa Clara
                                                        </SubAdministrativeAreaName>
                                                        <Locality>
                                                                <LocalityName>Mountain View</LocalityName>
                                                                <Thoroughfare>
                                                                        <ThoroughfareName>
                                                                                1600 Amphitheatre Pkwy
                                                                        </ThoroughfareName>
                                                                </Thoroughfare>
                                                                <PostalCode>
                                                                        <PostalCodeNumber>
                                                                                94043
                                                                        </PostalCodeNumber>
                                                                </PostalCode>
                                                        </Locality>
                                                </SubAdministrativeArea>
                                        </AdministrativeArea>
                                </Country>
                        </AddressDetails>
                        <Point>
                                <coordinates>-122.081783,37.423111,0</coordinates>
                        </Point>
                </Placemark>
        </Response>
</kml>