public class QueryBuilder extends Object
| Constructor and Description |
|---|
QueryBuilder() |
| Modifier and Type | Method and Description |
|---|---|
QueryBuilder |
addAdminCodes()
Convenience method to add the
FeatureCodes representing administrative
divisions to the restriction list. |
QueryBuilder |
addAncestryAdminCodes()
Convenience method to add the
FeatureCodes representing administrative
divisions that can be part of the ancestry tree to the restriction list. |
QueryBuilder |
addCityCodes()
Convenience method to add the
FeatureCodes representing cities and other
populated places to the restriction list. |
QueryBuilder |
addCountryCodes()
Convenience method to add the
FeatureCodes representing countries
and similar top-level political entities to the restriction list. |
QueryBuilder |
addFeatureCodes(Collection<FeatureCode> codes)
Add the provided
FeatureCodes to the set of query constraints. |
QueryBuilder |
addFeatureCodes(FeatureCode code)
Add the provided
FeatureCode to the set of query constraints. |
QueryBuilder |
addFeatureCodes(FeatureCode code1,
FeatureCode... codes)
Add the provided
FeatureCodes to the set of query constraints. |
QueryBuilder |
addParentIds(Collection<Integer> ids)
Add the provided parent IDs to the set of query constraints.
|
QueryBuilder |
addParentIds(Integer id)
Add the provided parent ID to the set of query constraints.
|
QueryBuilder |
addParentIds(Integer id1,
Integer... ids)
Add the provided parent IDs to the set of query constraints.
|
GazetteerQuery |
build()
Constructs a query from the current configuration of this Builder.
|
QueryBuilder |
clearFeatureCodes()
Convenience method to clear any existing
FeatureCode restrictions. |
QueryBuilder |
clearParentIds()
Convenience method to remove all current parent ID restrictions.
|
Set<FeatureCode> |
featureCodes()
Get the set of
FeatureCodes that will be used to constrain the query results. |
QueryBuilder |
featureCodes(Set<FeatureCode> codes)
Set the
FeatureCodes that will be used to constraint the query results; replacing any
previously configured IDs. |
boolean |
filterDupes()
Does this builder filter duplicate results?
|
QueryBuilder |
filterDupes(boolean filter)
Indicate whether or not this builder should filter duplicate results.
|
FuzzyMode |
fuzzyMode()
Get the current fuzzy matching mode.
|
QueryBuilder |
fuzzyMode(FuzzyMode mode)
Configure the fuzzy matching mode.
|
boolean |
includeHistorical()
Does this builder include historical locations?
|
QueryBuilder |
includeHistorical(boolean incHist)
Indicate whether or not this builder includes historical locations in the search results.
|
LocationOccurrence |
location()
Get the currently configured location to query for.
|
QueryBuilder |
location(LocationOccurrence loc)
Set the location to query for.
|
QueryBuilder |
location(String locName)
Convenience method to create a LocationOccurrence at position 0 for
the given location name.
|
int |
maxResults()
Get the current maximum number of results.
|
QueryBuilder |
maxResults(int max)
Set the maximum number of search results.
|
Set<Integer> |
parentIds()
Get the set of parent IDs that will be used to constrain the query results.
|
QueryBuilder |
parentIds(Set<Integer> ids)
Set the parent IDs that will be used to constraint the query results; replacing any
previously configured IDs.
|
QueryBuilder |
removeAdminCodes()
Convenience method to remove the
FeatureCodes representing administrative
divisions from the restriction list. |
QueryBuilder |
removeAncestryAdminCodes()
Convenience method to remove the
FeatureCodes representing administrative
divisions that can be part of the ancestry tree from the restriction list. |
QueryBuilder |
removeCityCodes()
Convenience method to remove the
FeatureCodes representing cities and other
populated places from the restriction list. |
QueryBuilder |
removeCountryCodes()
Convenience method to remove the
FeatureCodes representing countries
and similar top-level political entities from the restriction list. |
QueryBuilder |
removeFeatureCodes(Collection<FeatureCode> codes)
Remove the provided
FeatureCodes from the set of query constraints. |
QueryBuilder |
removeFeatureCodes(FeatureCode code)
Remove the provided
FeatureCode from the set of query constraints. |
QueryBuilder |
removeFeatureCodes(FeatureCode code1,
FeatureCode... codes)
Remove the provided
FeatureCode from the set of query constraints. |
QueryBuilder |
removeParentIds(Collection<Integer> ids)
Remove the provided parent IDs from the set of query constraints.
|
QueryBuilder |
removeParentIds(Integer id)
Remove the provided parent ID from the set of query constraints.
|
QueryBuilder |
removeParentIds(Integer id1,
Integer... ids)
Remove the provided parent IDs from the set of query constraints.
|
String |
toString() |
public GazetteerQuery build()
GazetteerQuery configuration objectpublic LocationOccurrence location()
public QueryBuilder location(LocationOccurrence loc)
loc - the location to query for.public QueryBuilder location(String locName)
locName - the name of the location to query forpublic int maxResults()
public QueryBuilder maxResults(int max)
max - the maximum number of resultspublic FuzzyMode fuzzyMode()
public QueryBuilder fuzzyMode(FuzzyMode mode)
mode - the fuzzy matching modepublic boolean includeHistorical()
true if this builder is configured to return historical locationspublic QueryBuilder includeHistorical(boolean incHist)
incHist - true to include historical locations in the resultspublic boolean filterDupes()
true if this builder is configured to filter duplicatespublic QueryBuilder filterDupes(boolean filter)
filter - true to filter duplicate resultspublic Set<Integer> parentIds()
public QueryBuilder parentIds(Set<Integer> ids)
ids - the new set of parent IDs used to constrain the query resultspublic QueryBuilder addParentIds(Integer id)
id - the parent ID to addpublic QueryBuilder addParentIds(Integer id1, Integer... ids)
id1 - the first parent ID to addids - the subsequent parent IDs to addpublic QueryBuilder addParentIds(Collection<Integer> ids)
ids - the parent IDs to addpublic QueryBuilder removeParentIds(Integer id)
id - the parent ID to removepublic QueryBuilder removeParentIds(Integer id1, Integer... ids)
id1 - the first parent ID to removeids - the subsequent parent IDs to removepublic QueryBuilder removeParentIds(Collection<Integer> ids)
ids - the parent IDs to removepublic QueryBuilder clearParentIds()
public Set<FeatureCode> featureCodes()
FeatureCodes that will be used to constrain the query results. This set
may not be modifiable and modifications, if allowed, will not affect the generated
queries.FeatureCodes used to constrain the query resultspublic QueryBuilder featureCodes(Set<FeatureCode> codes)
FeatureCodes that will be used to constraint the query results; replacing any
previously configured IDs. Use the addFeatureCodes() and removeFeatureCodes() methods to
modify the existing configuration.codes - the new set of FeatureCodes used to constrain the query resultspublic QueryBuilder addFeatureCodes(FeatureCode code)
FeatureCode to the set of query constraints.code - the FeatureCode to addpublic QueryBuilder addFeatureCodes(FeatureCode code1, FeatureCode... codes)
FeatureCodes to the set of query constraints.code1 - the first FeatureCode to addcodes - the subsequent FeatureCodes to addpublic QueryBuilder addFeatureCodes(Collection<FeatureCode> codes)
FeatureCodes to the set of query constraints.codes - the FeatureCodes to addpublic QueryBuilder removeFeatureCodes(FeatureCode code)
FeatureCode from the set of query constraints.code - the FeatureCode to removepublic QueryBuilder removeFeatureCodes(FeatureCode code1, FeatureCode... codes)
FeatureCode from the set of query constraints.code1 - the first FeatureCode to removecodes - the subsequent FeatureCodes to removepublic QueryBuilder removeFeatureCodes(Collection<FeatureCode> codes)
FeatureCodes from the set of query constraints.codes - the FeatureCodes to removepublic QueryBuilder clearFeatureCodes()
FeatureCode restrictions.public QueryBuilder addCountryCodes()
FeatureCodes representing countries
and similar top-level political entities to the restriction list. This
method modifies the existing set of codes.public QueryBuilder removeCountryCodes()
FeatureCodes representing countries
and similar top-level political entities from the restriction list. This
method modifies the existing set of codes.public QueryBuilder addAdminCodes()
FeatureCodes representing administrative
divisions to the restriction list. This includes all ADM* codes, territories (TERR)
and parishes (PRSH). This method modifies the existing set of codes.public QueryBuilder removeAdminCodes()
FeatureCodes representing administrative
divisions from the restriction list. This includes all ADM* codes, territories (TERR)
and parishes (PRSH). This method modifies the existing set of codes.public QueryBuilder addAncestryAdminCodes()
FeatureCodes representing administrative
divisions that can be part of the ancestry tree to the restriction list. This
only includes administrative divisions 1-4 (ADM[1-4]). This method modifies the
existing set of codes.public QueryBuilder removeAncestryAdminCodes()
FeatureCodes representing administrative
divisions that can be part of the ancestry tree from the restriction list. This
only includes administrative divisions 1-4 (ADM[1-4]). This method modifies the
existing set of codes.public QueryBuilder addCityCodes()
FeatureCodes representing cities and other
populated places to the restriction list. This method modifies the existing set
of codes.public QueryBuilder removeCityCodes()
FeatureCodes representing cities and other
populated places from the restriction list. This method modifies the existing set
of codes.Copyright © 2012–2014 Berico Technologies. All rights reserved.