// Path: src/main/java/redis/clients/collections/Ranking.java
// public interface Ranking<T extends Number> {
// 
// 	T getPoints();
// 	
// 	String getName();
// }
// 
// Path: src/main/java/redis/clients/collections/ScoresPoint.java
// public interface ScoresPoint<T extends Number> {
// 
// 	void initialPoint(String name, T value);
// 	
// 	T increment(String field, T value);
// 	
// 	T decrement(String field, T value);
// 	
// 	void remove(String field);
// 
// 	int size();
// 	
// 	List<Ranking<T>> range(long initial, long end);
// 	
// 	List<Ranking<T>> top(int top);
// 	
// 	List<Ranking<T>> last(int top);
// 	
// 	List<Ranking<T>> getRanking();
// }


import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import redis.clients.collections.Ranking;
import redis.clients.collections.ScoresPoint;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Tuple;
package redis.clients.collections.builder;



class ScorePointLong extends AbstractScoresPoint<Long> implements ScoresPoint<Long> {


	ScorePointLong(Jedis jedis,String keyWithNameSpace) {
		super(jedis, keyWithNameSpace);
	}

	@Override
	public void initialPoint(String field, Long value) {
		jedis.zadd(keyWithNameSpace,value.doubleValue(), field);

	}

	@Override
	public Long increment(String field, Long value) {
		return jedis.zincrby(keyWithNameSpace, value.doubleValue(), field).longValue();
	}
	
	@Override
	public Long decrement(String field, Long value) {
		return increment(field, -value);
	}

	@Override
	public List<Ranking<Long>> range(long start, long end) {
		List<Ranking<Long>> topRanking = new ArrayList<>();
		Set<Tuple> scores = jedis.zrevrangeWithScores(keyWithNameSpace, start, end);
		for (Tuple tuple: scores) {
// Path: src/main/java/redis/clients/collections/Ranking.java
// public interface Ranking<T extends Number> {
// 
// 	T getPoints();
// 	
// 	String getName();
// }
// 
// Path: src/main/java/redis/clients/collections/ScoresPoint.java
// public interface ScoresPoint<T extends Number> {
// 
// 	void initialPoint(String name, T value);
// 	
// 	T increment(String field, T value);
// 	
// 	T decrement(String field, T value);
// 	
// 	void remove(String field);
// 
// 	int size();
// 	
// 	List<Ranking<T>> range(long initial, long end);
// 	
// 	List<Ranking<T>> top(int top);
// 	
// 	List<Ranking<T>> last(int top);
// 	
// 	List<Ranking<T>> getRanking();
// }


// Path: src/main/java/redis/clients/collections/builder/ScorePointLong.java
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import redis.clients.collections.Ranking;
import redis.clients.collections.ScoresPoint;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Tuple;

package redis.clients.collections.builder;



class ScorePointLong extends AbstractScoresPoint<Long> implements ScoresPoint<Long> {


	ScorePointLong(Jedis jedis,String keyWithNameSpace) {
		super(jedis, keyWithNameSpace);
	}

	@Override
	public void initialPoint(String field, Long value) {
		jedis.zadd(keyWithNameSpace,value.doubleValue(), field);

	}

	@Override
	public Long increment(String field, Long value) {
		return jedis.zincrby(keyWithNameSpace, value.doubleValue(), field).longValue();
	}
	
	@Override
	public Long decrement(String field, Long value) {
		return increment(field, -value);
	}

	@Override
	public List<Ranking<Long>> range(long start, long end) {
		List<Ranking<Long>> topRanking = new ArrayList<>();
		Set<Tuple> scores = jedis.zrevrangeWithScores(keyWithNameSpace, start, end);
		for (Tuple tuple: scores) {
			topRanking.add(new RankingLong(tuple.getElement(),(long)tuple.getScore()));