Class Weights
java.lang.Object
org.springframework.data.redis.connection.zset.Weights
Value object encapsulating a multiplication factor for each input sorted set. This means that the score of every
element in every input sorted set is multiplied by this factor before being passed to the aggregation function.
- Since:
- 2.1
- Author:
- Mark Paluch, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic WeightsfromSetCount(int count) Creates equalWeightsfor a number of input setscountwith a weight of one.doublegetWeight(int index) Retrieve the weight atindex.inthashCode()multiply(double multiplier) Creates a newWeightsobject that contains all weights multiplied bymultipliermultiply(int multiplier) Creates a newWeightsobject that contains all weights multiplied bymultiplierstatic Weightsof(double... weights) static Weightsof(int... weights) intsize()double[]toArray()toList()
-
Method Details
-
of
-
of
-
fromSetCount
-
multiply
-
multiply
-
apply
-
getWeight
public double getWeight(int index) Retrieve the weight atindex.- Parameters:
index- the weight index.- Returns:
- the weight at
index. - Throws:
IndexOutOfBoundsException- if the index is out of range
-
size
public int size()- Returns:
- number of weights.
-
toArray
public double[] toArray()- Returns:
- an array containing all of the weights in this list in proper sequence (from first to last element).
-
toList
-
equals
-
hashCode
-