RGeo interface covered by comments.

pull/469/head
Nikita 9 years ago
parent ed9dcfa0ac
commit 43bde3e0c0

@ -19,6 +19,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* Geospatial items holder
* *
* @author Nikita Koksharov * @author Nikita Koksharov
* *
@ -26,26 +27,140 @@ import java.util.Map;
*/ */
public interface RGeo<V> extends RExpirable, RGeoAsync<V> { public interface RGeo<V> extends RExpirable, RGeoAsync<V> {
/**
* Adds geospatial member.
*
* @param entries
* @return number of elements added to the sorted set,
* not including elements already existing for which
* the score was updated
*/
long add(double longitude, double latitude, V member); long add(double longitude, double latitude, V member);
/**
* Adds geospatial members.
*
* @param entries
* @return number of elements added to the sorted set,
* not including elements already existing for which
* the score was updated
*/
long add(GeoEntry... entries); long add(GeoEntry... entries);
/**
* Returns distance between members in <code>GeoUnit</code> units.
*
* @see {@link GeoUnit}
*
* @param firstMember
* @param secondMember
* @param geoUnit
* @return
*/
Double dist(V firstMember, V secondMember, GeoUnit geoUnit); Double dist(V firstMember, V secondMember, GeoUnit geoUnit);
/**
* Returns 11 characters Geohash string mapped by defined member.
*
* @param members
* @return
*/
Map<V, String> hash(V... members); Map<V, String> hash(V... members);
/**
* Returns geo-position mapped by defined member.
*
* @param members
* @return
*/
Map<V, GeoPosition> pos(V... members); Map<V, GeoPosition> pos(V... members);
/**
* Returns the members of a sorted set, which are within the
* borders of the area specified with the center location
* and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
List<V> radius(double longitude, double latitude, double radius, GeoUnit geoUnit); List<V> radius(double longitude, double latitude, double radius, GeoUnit geoUnit);
/**
* Returns the distance mapped by member, distance between member and the location.
* Members of a sorted set, which are within the
* borders of the area specified with the center location
* and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Map<V, Double> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit); Map<V, Double> radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit);
/**
* Returns the geo-position mapped by member.
* Members of a sorted set, which are within the
* borders of the area specified with the center location
* and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Map<V, GeoPosition> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit); Map<V, GeoPosition> radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit);
/**
* Returns the members of a sorted set, which are within the
* borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
List<V> radius(V member, double radius, GeoUnit geoUnit); List<V> radius(V member, double radius, GeoUnit geoUnit);
/**
* Returns the distance mapped by member, distance between member and the defined member location.
* Members of a sorted set, which are within the
* borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Map<V, Double> radiusWithDistance(V member, double radius, GeoUnit geoUnit); Map<V, Double> radiusWithDistance(V member, double radius, GeoUnit geoUnit);
/**
* Returns the geo-position mapped by member.
* Members of a sorted set, which are within the
* borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Map<V, GeoPosition> radiusWithPosition(V member, double radius, GeoUnit geoUnit); Map<V, GeoPosition> radiusWithPosition(V member, double radius, GeoUnit geoUnit);
} }

@ -28,26 +28,140 @@ import io.netty.util.concurrent.Future;
*/ */
public interface RGeoAsync<V> extends RExpirableAsync { public interface RGeoAsync<V> extends RExpirableAsync {
/**
* Adds geospatial member.
*
* @param entries
* @return number of elements added to the sorted set,
* not including elements already existing for which
* the score was updated
*/
Future<Long> addAsync(double longitude, double latitude, V member); Future<Long> addAsync(double longitude, double latitude, V member);
/**
* Adds geospatial members.
*
* @param entries
* @return number of elements added to the sorted set,
* not including elements already existing for which
* the score was updated
*/
Future<Long> addAsync(GeoEntry... entries); Future<Long> addAsync(GeoEntry... entries);
/**
* Returns distance between members in <code>GeoUnit</code> units.
*
* @see {@link GeoUnit}
*
* @param firstMember
* @param secondMember
* @param geoUnit
* @return
*/
Future<Double> distAsync(V firstMember, V secondMember, GeoUnit geoUnit); Future<Double> distAsync(V firstMember, V secondMember, GeoUnit geoUnit);
/**
* Returns 11 characters Geohash string mapped by defined member.
*
* @param members
* @return
*/
Future<Map<V, String>> hashAsync(V... members); Future<Map<V, String>> hashAsync(V... members);
/**
* Returns geo-position mapped by defined member.
*
* @param members
* @return
*/
Future<Map<V, GeoPosition>> posAsync(V... members); Future<Map<V, GeoPosition>> posAsync(V... members);
/**
* Returns the members of a sorted set, which are within the
* borders of the area specified with the center location
* and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Future<List<V>> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit); Future<List<V>> radiusAsync(double longitude, double latitude, double radius, GeoUnit geoUnit);
/**
* Returns the distance mapped by member, distance between member and the location.
* Members of a sorted set, which are within the
* borders of the area specified with the center location
* and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Future<Map<V, Double>> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit); Future<Map<V, Double>> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit);
/**
* Returns the geo-position mapped by member.
* Members of a sorted set, which are within the
* borders of the area specified with the center location
* and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Future<Map<V, GeoPosition>> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit); Future<Map<V, GeoPosition>> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit);
/**
* Returns the members of a sorted set, which are within the
* borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Future<List<V>> radiusAsync(V member, double radius, GeoUnit geoUnit); Future<List<V>> radiusAsync(V member, double radius, GeoUnit geoUnit);
/**
* Returns the distance mapped by member, distance between member and the defined member location.
* Members of a sorted set, which are within the
* borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Future<Map<V, Double>> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit); Future<Map<V, Double>> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit);
/**
* Returns the geo-position mapped by member.
* Members of a sorted set, which are within the
* borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units.
*
* @param longitude
* @param latitude
* @param radius
* @param geoUnit
* @return
*/
Future<Map<V, GeoPosition>> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit); Future<Map<V, GeoPosition>> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit);
} }

Loading…
Cancel
Save