/** * Gets the first value of a specific location attribute, as a * location object. * * @param name attribute name * @return value of the attribute or null if no attribute * with this name was found on the list * @exception NumberFormatException if some value was * found that could not be converted. */ public Location getLocationAttributeAsObject(String name) { GoogleBaseAttribute attribute = getAttribute(name); if (attribute == null) { return null; } return ConversionUtil.extractLocation(attribute); }
/** * Gets the first value of a specific location attribute, as a * location object. * * @param name attribute name * @return value of the attribute or null if no attribute * with this name was found on the list * @exception NumberFormatException if some value was * found that could not be converted. */ public Location getLocationAttributeAsObject(String name) { GoogleBaseAttribute attribute = getAttribute(name); if (attribute == null) { return null; } return ConversionUtil.extractLocation(attribute); }
/** * Gets all the values of a specific attribute, as a list of * {@link Location} objects. * * @param name attribute name * @return a list of locations, which might be empty but not null * @exception NumberFormatException if some value was * found that could not be converted */ public List<Location> getLocationAttributesAsObjects(String name) { List<? extends GoogleBaseAttribute> attributes = getAttributes(name, GoogleBaseAttributeType.LOCATION); List<Location> retval = new ArrayList<Location>(attributes.size()); for (GoogleBaseAttribute attribute : attributes) { retval.add(ConversionUtil.extractLocation(attribute)); } return retval; }
/** * Gets all the values of a specific attribute, as a list of * {@link Location} objects. * * @param name attribute name * @return a list of locations, which might be empty but not null * @exception NumberFormatException if some value was * found that could not be converted */ public List<Location> getLocationAttributesAsObjects(String name) { List<? extends GoogleBaseAttribute> attributes = getAttributes(name, GoogleBaseAttributeType.LOCATION); List<Location> retval = new ArrayList<Location>(attributes.size()); for (GoogleBaseAttribute attribute : attributes) { retval.add(ConversionUtil.extractLocation(attribute)); } return retval; }