diff options
author | blafoo <github@blafoo.de> | 2012-02-24 21:44:20 +0100 |
---|---|---|
committer | blafoo <github@blafoo.de> | 2012-02-24 22:17:32 +0100 |
commit | 0b2cb4da12d3263a4a264a0e2eb5b8d0a449ee0f (patch) | |
tree | ad3acc3ce228c170784db34f651d84f01ff52a6a /main/src/cgeo/geocaching/connector/ConnectorFactory.java | |
parent | b5be674f2344140f89b8d49f5111ff86c519281c (diff) | |
download | cgeo-0b2cb4da12d3263a4a264a0e2eb5b8d0a449ee0f.zip cgeo-0b2cb4da12d3263a4a264a0e2eb5b8d0a449ee0f.tar.gz cgeo-0b2cb4da12d3263a4a264a0e2eb5b8d0a449ee0f.tar.bz2 |
New connector functionality
Diffstat (limited to 'main/src/cgeo/geocaching/connector/ConnectorFactory.java')
-rw-r--r-- | main/src/cgeo/geocaching/connector/ConnectorFactory.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/connector/ConnectorFactory.java b/main/src/cgeo/geocaching/connector/ConnectorFactory.java index 39e6dee..471d43b 100644 --- a/main/src/cgeo/geocaching/connector/ConnectorFactory.java +++ b/main/src/cgeo/geocaching/connector/ConnectorFactory.java @@ -1,8 +1,11 @@ package cgeo.geocaching.connector; import cgeo.geocaching.ICache; +import cgeo.geocaching.SearchResult; import cgeo.geocaching.connector.opencaching.ApiOpenCachingConnector; import cgeo.geocaching.connector.opencaching.OpenCachingConnector; +import cgeo.geocaching.geopoint.Geopoint; +import cgeo.geocaching.geopoint.Viewport; import org.apache.commons.lang3.StringUtils; @@ -62,4 +65,19 @@ public final class ConnectorFactory { private static boolean isInvalidGeocode(final String geocode) { return StringUtils.isBlank(geocode) || !Character.isLetterOrDigit(geocode.charAt(0)); } + + /** @see IConnector#searchByCoordinate */ + public static SearchResult searchByCoordinate(final Geopoint center) { + // We have only connector capable of doing a 'searchByCoordinate()' + // If there is a second connector the information has to be collected from all collectors + return GCConnector.getInstance().searchByCoordinate(center); + } + + /** @see IConnector#searchByViewport */ + public static SearchResult searchByViewport(final Viewport viewport, final String[] tokens) { + // We have only connector capable of doing a 'searchByViewport()' + // If there is a second connector the information has to be collected from all collectors + return GCConnector.getInstance().searchByViewport(viewport, tokens); + } + } |