All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.redisson.api.RGeo Maven / Gradle / Ivy

There is a newer version: 3.9.1
Show newest version
/**
 * Copyright 2018 Nikita Koksharov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson.api;

import java.util.List;
import java.util.Map;

/**
 * Geospatial items holder. 
 * 
 * @author Nikita Koksharov
 *
 * @param  type of value
 */
public interface RGeo extends RScoredSortedSet, RGeoAsync {

    /**
     * Adds geospatial member.
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param member - object itself
     * @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);
    
    /**
     * Adds geospatial members.
     * 
     * @param entries - objects
     * @return number of elements added to the sorted set, 
     * not including elements already existing for which 
     * the score was updated
     */
    long add(GeoEntry... entries);
    
    /**
     * Returns distance between members in GeoUnit units.
     * 
     * @param firstMember - first object
     * @param secondMember - second object
     * @param geoUnit - geo unit
     * @return distance
     */
    Double dist(V firstMember, V secondMember, GeoUnit geoUnit);

    /**
     * Returns 11 characters Geohash string mapped by defined member.
     * 
     * @param members - objects
     * @return hash mapped by object
     */
    Map hash(V... members);

    /**
     * Returns geo-position mapped by defined member.
     * 
     * @param members - objects
     * @return geo position mapped by object
     */
    Map 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 GeoUnit units.
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return list of objects
     */
    List radius(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 center location 
     * and the maximum distance from the center (the radius) 
     * in GeoUnit units and limited by count
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return list of objects
     */
    List radius(double longitude, double latitude, double radius, GeoUnit geoUnit, int count);

    /**
     * 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 GeoUnit units with GeoOrder
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - order of result
     * @return list of objects
     */
    List radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder);

    /**
     * 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 GeoUnit units with GeoOrder
     * and limited by count
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - order of result
     * @param count - result limit
     * @return list of objects
     */
    List radius(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);
    
    /**
     * 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 GeoUnit units.
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return distance mapped by object
     */
    Map radiusWithDistance(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 GeoUnit units and limited by count.
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return distance mapped by object
     */
    Map radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, int count);

    /**
     * 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 GeoUnit units with GeoOrder
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - order of result
     * @return distance mapped by object
     */
    Map radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder);

    /**
     * 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 GeoUnit units with GeoOrder
     * and limited by count
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - order of result
     * @param count - result limit
     * @return distance mapped by object
     */
    Map radiusWithDistance(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);
    
    /**
     * 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 GeoUnit units.
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return geo position mapped by object
     */
    Map radiusWithPosition(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 GeoUnit units and limited by count
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return geo position mapped by object
     */
    Map radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, int count);

    /**
     * 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 GeoUnit units with GeoOrder
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @return geo position mapped by object
     */
    Map radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder);

    /**
     * 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 GeoUnit units with GeoOrder
     * and limited by count
     * 
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @param count - result limit
     * @return geo position mapped by object
     */
    Map radiusWithPosition(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);

    /**
     * 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 GeoUnit units.
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return list of objects
     */
    List radius(V member, 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 GeoUnit units and limited by count
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return list of objects
     */
    List radius(V member, double radius, GeoUnit geoUnit, int count);

    /**
     * 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 GeoUnit units with GeoOrder
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @return list of objects
     */
    List radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder);

    /**
     * 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 GeoUnit units with GeoOrder
     * and limited by count
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @param count - result limit
     * @return list of objects
     */
    List radius(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);

    /**
     * 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 GeoUnit units.
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return distance mapped by object
     */
    Map radiusWithDistance(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 GeoUnit units and limited by count
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return distance mapped by object
     */
    Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, int count);

    /**
     * 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 GeoUnit units with GeoOrder
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @return distance mapped by object
     */
    Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder);

    /**
     * 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 GeoUnit units with GeoOrder
     * and limited by count
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @param count - result limit
     * @return distance mapped by object
     */
    Map radiusWithDistance(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);
    
    /**
     * 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 GeoUnit units.
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return geo position mapped by object
     */
    Map radiusWithPosition(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 GeoUnit units and limited by count
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return geo position mapped by object
     */
    Map radiusWithPosition(V member, double radius, GeoUnit geoUnit, int count);

    /**
     * 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 GeoUnit units with GeoOrder
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @return geo position mapped by object
     */
    Map radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder);

    /**
     * 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 GeoUnit units with GeoOrder
     * and limited by count
     * 
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @param count - result limit
     * @return geo position mapped by object
     */
    Map radiusWithPosition(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);

    /**
     * Finds 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 GeoUnit units. 
     * Store result to destName.
     * 
     * @param destName - Geo object destination
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return length of result
     */
    long radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit);

    /**
     * Finds 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 GeoUnit units and limited by count 
     * Store result to destName.
     * 
     * @param destName - Geo object destination
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return length of result
     */
    long radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count);

    /**
     * Finds 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 GeoUnit units with GeoOrder 
     * and limited by count 
     * Store result to destName.
     * 
     * @param destName - Geo object destination
     * @param longitude - longitude of object
     * @param latitude - latitude of object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - order of result
     * @param count - result limit
     * @return length of result
     */
    long radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);

    /**
     * Finds 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 GeoUnit units. 
     * Store result to destName.
     * 
     * @param destName - Geo object destination
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @return length of result
     */
    long radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit);

    /**
     * Finds 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 GeoUnit units and limited by count
     * Store result to destName.
     * 
     * @param destName - Geo object destination
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param count - result limit
     * @return length of result
     */
    long radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, int count);

    /**
     * Finds 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 GeoUnit units with GeoOrder 
     * Store result to destName.
     * 
     * @param destName - Geo object destination
     * @param member - object
     * @param radius - radius in geo units
     * @param geoUnit - geo unit
     * @param geoOrder - geo order
     * @param count - result limit
     * @return length of result
     */
    long radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy