public final class ZRange extends Object
byIndex(long, long) selects members by position and supports REV.byScore(Range) selects members by score (BYSCORE) and supports REV and LIMIT.byLex(Range) selects members by lexicographical order (BYLEX) and supports REV and
LIMIT. Lexicographical ranges cannot be combined with WITHSCORES.Range they are created from, so later modifications of that Range do not
affect the selector. Selectors are mutable objects and instances should be used only once to avoid shared mutable state.| Modifier and Type | Class and Description |
|---|---|
static class |
ZRange.ByIndex
Selector for members by index.
|
static class |
ZRange.ByLex<V>
Selector for members by lexicographical order (
BYLEX). |
static class |
ZRange.ByScore
Selector for members by score (
BYSCORE). |
| Modifier and Type | Method and Description |
|---|---|
static ZRange.ByIndex |
byIndex(long start,
long stop)
Create a selector for members by index.
|
static <V> ZRange.ByLex<V> |
byLex(Range<V> range)
Create a selector for members by lexicographical order.
|
static ZRange.ByScore |
byScore(double min,
double max)
Create a selector for members by score.
|
static ZRange.ByScore |
byScore(Range<? extends Number> range)
Create a selector for members by score.
|
public static ZRange.ByIndex byIndex(long start, long stop)
start - the start index.stop - the stop index, inclusive.ZRange.ByIndex selector for members between start and stop.public static ZRange.ByScore byScore(Range<? extends Number> range)
range - the score range, must not be null and must not contain NaN boundaries.ZRange.ByScore selector for members with a score within range.public static ZRange.ByScore byScore(double min, double max)
min - the lower score boundary, inclusive.max - the upper score boundary, inclusive.ZRange.ByScore selector for members with a score between min and max.public static <V> ZRange.ByLex<V> byLex(Range<V> range)
V - value type of the range boundaries.range - the lexicographical range, must not be null.ZRange.ByLex selector for members within range.Copyright © 2026 lettuce.io. All rights reserved.