Code example for Address

Methods: getAddressLine, setFeatureName, setThoroughfare

0
				(a.getMaxAddressLineIndex() >= 4) ? a.getAddressLine(4) : "");
		return val.equals("");
	} 
 
	public static Address parseLineOne(Address a) {
		String[] pieces = a.getAddressLine(0).trim().replaceAll(" +", " ").split(" ", 2);
		switch(pieces.length) {
		case 2: 
			a.setFeatureName(pieces[0]);
			a.setThoroughfare(pieces[1]);
			break; 
		case 1: 
			if(pieces[0].matches("^[0-9\\-]+$")) {
				a.setFeatureName(pieces[0]);
				a.setThoroughfare("");
			}else{ 
				a.setFeatureName("");
				a.setThoroughfare(pieces[0]);
			} 
			break; 
		default: 
			a.setFeatureName("");
			a.setThoroughfare("");
			break; 
		} 
		return a;
	}