com.gisgraphy.domain.geoloc.service.geoloc
Class StreetSearchQuery

java.lang.Object
  extended by com.gisgraphy.domain.geoloc.service.AbstractGisQuery
      extended by com.gisgraphy.domain.geoloc.service.geoloc.GeolocQuery
          extended by com.gisgraphy.domain.geoloc.service.geoloc.StreetSearchQuery

public class StreetSearchQuery
extends GeolocQuery

a query to be execute by the @link StreetSearchEngine

Author:
David Masclet

Field Summary
static int NAME_MAX_LENGTH
           
 
Fields inherited from class com.gisgraphy.domain.geoloc.service.geoloc.GeolocQuery
DEFAULT_RADIUS
 
Fields inherited from class com.gisgraphy.domain.geoloc.service.AbstractGisQuery
output, pagination
 
Constructor Summary
StreetSearchQuery(javax.servlet.http.HttpServletRequest req)
          Build a query from an httpRequest based on the StreetServlet parameter names
StreetSearchQuery(com.vividsolutions.jts.geom.Point point, double radius, Pagination pagination, Output output, StreetType streetType, java.lang.Boolean oneWay, java.lang.String name, StreetSearchMode streetSearchMode)
           
StreetSearchQuery(com.vividsolutions.jts.geom.Point point, double radius, StreetType streetType)
           
StreetSearchQuery(com.vividsolutions.jts.geom.Point point, StreetType streetType)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getMaxLimitResult()
           
 java.lang.String getName()
           
 java.lang.Boolean getOneWay()
           
 StreetSearchMode getStreetSearchMode()
           
 StreetType getStreetType()
           
 int hashCode()
           
 java.lang.String toString()
           
 StreetSearchQuery withName(java.lang.String name)
           
 StreetSearchQuery withOneWay(java.lang.Boolean oneWay)
           
 StreetSearchQuery withStreetSearchMode(StreetSearchMode streetSearchMode)
           
 StreetSearchQuery withStreetType(StreetType streetType)
           
 
Methods inherited from class com.gisgraphy.domain.geoloc.service.geoloc.GeolocQuery
getLatitude, getLongitude, getPlaceType, getPoint, getRadius, hasDistanceField, isOutputIndented, withDistanceField, withPlaceType
 
Methods inherited from class com.gisgraphy.domain.geoloc.service.AbstractGisQuery
getFirstPaginationIndex, getLastPaginationIndex, getMaxNumberOfResults, getOutput, getOutputFormat, getOutputLanguage, getOutputStyle, getPagination, withOutput, withPagination
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME_MAX_LENGTH

public static final int NAME_MAX_LENGTH
See Also:
Constant Field Values
Constructor Detail

StreetSearchQuery

public StreetSearchQuery(javax.servlet.http.HttpServletRequest req)
Build a query from an httpRequest based on the StreetServlet parameter names

Parameters:
req - the httprequest to build the query

StreetSearchQuery

public StreetSearchQuery(com.vividsolutions.jts.geom.Point point,
                         double radius,
                         Pagination pagination,
                         Output output,
                         StreetType streetType,
                         java.lang.Boolean oneWay,
                         java.lang.String name,
                         StreetSearchMode streetSearchMode)
Parameters:
point - the text to query, if the query is a number zipcode will be searched
radius - The radius (distance)
pagination - The pagination specification, if null : use default
output - Output The output specification , if null : use default
streetType - the type of street to search , if null : search for all street type.
oneWay - the oneWay type criteria of the street
name - the name the street must contains
streetSearchMode - the streetsearchmode for the specified name
Throws:
An - IllegalArgumentException if the point is null

StreetSearchQuery

public StreetSearchQuery(com.vividsolutions.jts.geom.Point point,
                         double radius,
                         StreetType streetType)
Parameters:
point - the point to search street around
radius - The radius (distance)
streetType - the type of street to search , if null : search for all street type.
Throws:
An - IllegalArgumentException if the point is null

StreetSearchQuery

public StreetSearchQuery(com.vividsolutions.jts.geom.Point point,
                         StreetType streetType)
Parameters:
point - the point to search street around
streetType - the type of street to search , if null : search for all street type.
Method Detail

getStreetType

public StreetType getStreetType()
Returns:
the type of street we'd like to query

withStreetType

public StreetSearchQuery withStreetType(StreetType streetType)
Parameters:
streetType - the StreetType of street we'd like to query
Returns:
The current query to chain methods

getName

public java.lang.String getName()
Returns:
the string the street must contains (aka : '%name%').

withName

public StreetSearchQuery withName(java.lang.String name)
Parameters:
name - the string that the street must contains (aka : '%name%'). not taken into account if empty string or null.
Returns:
The current query to chain methods
Throws:
StreetSearchException - if length is greater than @see NAME_MAX_LENGTH

withOneWay

public StreetSearchQuery withOneWay(java.lang.Boolean oneWay)
Parameters:
oneWay - The oneWay type criteria of the street
Returns:
The current query to chain methods

getMaxLimitResult

public int getMaxLimitResult()
Overrides:
getMaxLimitResult in class GeolocQuery
Returns:
the maximum number of results that the query should return

getOneWay

public java.lang.Boolean getOneWay()
Returns:
the oneWay criteria

getStreetSearchMode

public StreetSearchMode getStreetSearchMode()
Returns:
the street StreetSearchMode

withStreetSearchMode

public StreetSearchQuery withStreetSearchMode(StreetSearchMode streetSearchMode)
Parameters:
streetSearchMode - the StreetSearchMode
Returns:
The current query to chain methods

toString

public java.lang.String toString()
Overrides:
toString in class GeolocQuery

hashCode

public int hashCode()
Overrides:
hashCode in class GeolocQuery

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class GeolocQuery


Copyright © 2010. All Rights Reserved.