com.mizar.addressing.usaddress
Class AbstractAddressQuery

java.lang.Object
  extended by com.mizar.addressing.usaddress.AbstractAddressQuery
Direct Known Subclasses:
KeyinParser

public abstract class AbstractAddressQuery
extends java.lang.Object


Field Summary
protected  java.lang.String address
           
protected  ArlLocation arl
           
static int COUNTY
           
protected  java.lang.Long countyId
           
protected  java.lang.String countyName
           
protected  java.lang.String filterClause
           
static java.lang.String INTERSECTION_PATTERN
           
protected  java.lang.String keyword
           
static int KEYWORD
           
static int NONE
           
static int PLACE
           
protected  java.lang.Long placeId
           
protected  java.lang.String placeName
           
protected  java.lang.String relativeLocationFacet
           
protected  java.lang.Long relativeLocationId
           
protected  java.lang.Integer relativeLocationType
           
protected  java.lang.Long siteId
           
protected  java.lang.String sql
           
protected  java.lang.String state
           
static int STATE
           
protected  java.lang.Long streetId
           
protected  java.lang.String streetName
           
static int TOWN
           
protected  java.lang.Long townId
           
protected  java.lang.String townName
           
static int UNDEFINED
           
protected  java.lang.String zip
           
static int ZIP
           
 
Constructor Summary
AbstractAddressQuery()
           
AbstractAddressQuery(java.lang.String query)
           
 
Method Summary
abstract  java.lang.String appendSpatialFilter(java.lang.String alias, java.lang.StringBuffer query)
           
 void clear()
           
 java.lang.String getAddress()
           
 USAddressStreet getAddressStreet()
           
static java.lang.String getAnyInteractClause(java.lang.String oAlias, java.lang.String oGeom, java.lang.String lAlias, java.lang.String lGeom)
           
 ArlLocation getArl()
           
 java.lang.String getCompletedFilterClause()
           
 java.lang.Long getCountyId()
           
 java.lang.String getCountyName()
           
 java.lang.String getFilterClause()
           
 java.lang.String getKeyword()
           
static java.lang.String getNearestNeighborsClause(java.lang.String oAlias, java.lang.String oGeom, java.lang.String lAlias, java.lang.String lGeom, int count)
           
 java.lang.Long getPlaceId()
           
 java.lang.String getPlaceName()
           
 java.lang.String getRelativeLocationFacet()
           
 java.lang.Long getRelativeLocationId()
           
 java.lang.Integer getRelativeLocationType()
           
 javax.faces.model.SelectItem[] getRelativeLocationTypes()
           
 java.lang.Long getSiteId()
           
 java.lang.String getSql()
           
 java.lang.String getState()
           
 java.lang.Long getStreetId()
           
 java.lang.String getStreetName()
           
static java.lang.String[] getStreetsFromIntersection(java.lang.String location)
           
 java.lang.Long getTownId()
           
 java.lang.String getTownName()
           
static java.lang.String getWithinDistanceClause(java.lang.String oAlias, java.lang.String oGeom, java.lang.String lAlias, java.lang.String lGeom, double dValue, java.lang.String uValue)
           
 java.lang.String getZip()
           
 java.lang.String inferKeyword()
           
 void interpretKeyin(java.lang.String arlString)
           
static java.lang.String looksLikeCounty(java.lang.String location)
           
static java.lang.Long looksLikeId(java.lang.String location)
           
static boolean looksLikeIntersection(java.lang.String testString)
          If the testString contains one and only one of the regex pattern "( at | and |&|\\+|-|/)" and both parts of the pattern contain something and at least one side contains something that looks like a street name and street type or street number then this method will return true.
static java.lang.String looksLikeKeyword(java.lang.String keyword, java.lang.String location)
           
static boolean looksLikeNothing(java.lang.String location)
           
static java.lang.String looksLikePlace(java.lang.String location)
           
static java.lang.Long looksLikeSiteId(java.lang.String location)
           
static java.lang.String looksLikeState(java.lang.String location)
           
static boolean looksLikeStreet(java.lang.String testString)
           
static java.lang.Long looksLikeStreetId(java.lang.String location)
           
static java.lang.String looksLikeZip(java.lang.String location)
           
static void main(java.lang.String[] argv)
           
 void setAddress(java.lang.String address)
           
 void setCountyId(java.lang.Long countyId)
           
 void setCountyName(java.lang.String countyName)
           
 void setFilterClause(java.lang.String filterClause)
           
 void setPlaceId(java.lang.Long placeId)
           
 void setPlaceName(java.lang.String placeName)
           
 void setRelativeLocationId(java.lang.Long relativeLocationId)
           
 void setRelativeLocationType(java.lang.Integer relativeLocationType)
           
 void setSiteId(java.lang.Long siteId)
           
 void setSql(java.lang.String sql)
           
 void setState(java.lang.String state)
           
 void setStreetId(java.lang.Long streetId)
           
 void setStreetName(java.lang.String streetName)
           
 void setTownId(java.lang.Long townId)
           
 void setTownName(java.lang.String townName)
           
 void setUSAddress(java.lang.String usAddress)
           
 void setZip(java.lang.String zip)
           
abstract  boolean tryToSetCountyId(java.lang.String countyName)
           
abstract  boolean tryToSetPlaceId(java.lang.String placeName)
           
protected  boolean tryToSetTown(java.lang.String rLocation)
           
abstract  boolean tryToSetTownId(java.lang.String townName)
           
 void validateAddress(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value)
          validate the address input the format should be integer (####) or integer-integer (###-####) The value is string, but need to validate to certain format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNDEFINED

public static final int UNDEFINED
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

STATE

public static final int STATE
See Also:
Constant Field Values

COUNTY

public static final int COUNTY
See Also:
Constant Field Values

TOWN

public static final int TOWN
See Also:
Constant Field Values

ZIP

public static final int ZIP
See Also:
Constant Field Values

PLACE

public static final int PLACE
See Also:
Constant Field Values

KEYWORD

public static final int KEYWORD
See Also:
Constant Field Values

INTERSECTION_PATTERN

public static final java.lang.String INTERSECTION_PATTERN
See Also:
Constant Field Values

keyword

protected java.lang.String keyword

arl

protected ArlLocation arl

streetId

protected java.lang.Long streetId

siteId

protected java.lang.Long siteId

address

protected java.lang.String address

streetName

protected java.lang.String streetName

zip

protected java.lang.String zip

state

protected java.lang.String state

placeName

protected java.lang.String placeName

countyName

protected java.lang.String countyName

townName

protected java.lang.String townName

countyId

protected java.lang.Long countyId

townId

protected java.lang.Long townId

placeId

protected java.lang.Long placeId

relativeLocationId

protected java.lang.Long relativeLocationId

sql

protected java.lang.String sql

relativeLocationType

protected java.lang.Integer relativeLocationType

relativeLocationFacet

protected java.lang.String relativeLocationFacet

filterClause

protected java.lang.String filterClause
Constructor Detail

AbstractAddressQuery

public AbstractAddressQuery()

AbstractAddressQuery

public AbstractAddressQuery(java.lang.String query)
Method Detail

tryToSetTownId

public abstract boolean tryToSetTownId(java.lang.String townName)

tryToSetPlaceId

public abstract boolean tryToSetPlaceId(java.lang.String placeName)

tryToSetCountyId

public abstract boolean tryToSetCountyId(java.lang.String countyName)

appendSpatialFilter

public abstract java.lang.String appendSpatialFilter(java.lang.String alias,
                                                     java.lang.StringBuffer query)

clear

public void clear()

interpretKeyin

public void interpretKeyin(java.lang.String arlString)

inferKeyword

public java.lang.String inferKeyword()

tryToSetTown

protected boolean tryToSetTown(java.lang.String rLocation)

setUSAddress

public void setUSAddress(java.lang.String usAddress)

getWithinDistanceClause

public static java.lang.String getWithinDistanceClause(java.lang.String oAlias,
                                                       java.lang.String oGeom,
                                                       java.lang.String lAlias,
                                                       java.lang.String lGeom,
                                                       double dValue,
                                                       java.lang.String uValue)

getNearestNeighborsClause

public static java.lang.String getNearestNeighborsClause(java.lang.String oAlias,
                                                         java.lang.String oGeom,
                                                         java.lang.String lAlias,
                                                         java.lang.String lGeom,
                                                         int count)

getAnyInteractClause

public static java.lang.String getAnyInteractClause(java.lang.String oAlias,
                                                    java.lang.String oGeom,
                                                    java.lang.String lAlias,
                                                    java.lang.String lGeom)

looksLikeStreetId

public static java.lang.Long looksLikeStreetId(java.lang.String location)

looksLikeSiteId

public static java.lang.Long looksLikeSiteId(java.lang.String location)

looksLikeId

public static java.lang.Long looksLikeId(java.lang.String location)

looksLikeCounty

public static java.lang.String looksLikeCounty(java.lang.String location)

looksLikeState

public static java.lang.String looksLikeState(java.lang.String location)

looksLikePlace

public static java.lang.String looksLikePlace(java.lang.String location)

looksLikeZip

public static java.lang.String looksLikeZip(java.lang.String location)

looksLikeKeyword

public static java.lang.String looksLikeKeyword(java.lang.String keyword,
                                                java.lang.String location)

looksLikeNothing

public static boolean looksLikeNothing(java.lang.String location)

validateAddress

public void validateAddress(javax.faces.context.FacesContext context,
                            javax.faces.component.UIComponent component,
                            java.lang.Object value)
validate the address input the format should be integer (####) or integer-integer (###-####) The value is string, but need to validate to certain format

Parameters:
context -
component -
value -

setStreetId

public void setStreetId(java.lang.Long streetId)

getStreetId

public java.lang.Long getStreetId()

setSiteId

public void setSiteId(java.lang.Long siteId)

getSiteId

public java.lang.Long getSiteId()

setStreetName

public void setStreetName(java.lang.String streetName)

getStreetName

public java.lang.String getStreetName()

setAddress

public void setAddress(java.lang.String address)

getAddress

public java.lang.String getAddress()

setZip

public void setZip(java.lang.String zip)

getZip

public java.lang.String getZip()

setState

public void setState(java.lang.String state)

getState

public java.lang.String getState()

setPlaceName

public void setPlaceName(java.lang.String placeName)

getPlaceName

public java.lang.String getPlaceName()

setTownId

public void setTownId(java.lang.Long townId)

getTownId

public java.lang.Long getTownId()

setCountyId

public void setCountyId(java.lang.Long countyId)

getCountyId

public java.lang.Long getCountyId()

setCountyName

public void setCountyName(java.lang.String countyName)

getCountyName

public java.lang.String getCountyName()

setTownName

public void setTownName(java.lang.String townName)

getTownName

public java.lang.String getTownName()

setPlaceId

public void setPlaceId(java.lang.Long placeId)

getPlaceId

public java.lang.Long getPlaceId()

setSql

public void setSql(java.lang.String sql)

getSql

public java.lang.String getSql()

getKeyword

public java.lang.String getKeyword()

getArl

public ArlLocation getArl()

setRelativeLocationId

public void setRelativeLocationId(java.lang.Long relativeLocationId)

getRelativeLocationId

public java.lang.Long getRelativeLocationId()

getRelativeLocationType

public java.lang.Integer getRelativeLocationType()

setRelativeLocationType

public void setRelativeLocationType(java.lang.Integer relativeLocationType)

getRelativeLocationTypes

public javax.faces.model.SelectItem[] getRelativeLocationTypes()

getRelativeLocationFacet

public java.lang.String getRelativeLocationFacet()

setFilterClause

public void setFilterClause(java.lang.String filterClause)

getFilterClause

public java.lang.String getFilterClause()

getCompletedFilterClause

public java.lang.String getCompletedFilterClause()
Returns:
filterClause after replacing the contents of any quoted strings with their JSF-EL resolved value.

getAddressStreet

public USAddressStreet getAddressStreet()

looksLikeIntersection

public static boolean looksLikeIntersection(java.lang.String testString)
If the testString contains one and only one of the regex pattern "( at | and |&|\\+|-|/)" and both parts of the pattern contain something and at least one side contains something that looks like a street name and street type or street number then this method will return true.

Parameters:
testString -
Returns:
true if testString looks like an intersection

looksLikeStreet

public static boolean looksLikeStreet(java.lang.String testString)
Parameters:
testString -
Returns:
true if testString contains a name and either a U.S.P.S. street type or address number.

getStreetsFromIntersection

public static java.lang.String[] getStreetsFromIntersection(java.lang.String location)

main

public static void main(java.lang.String[] argv)