2021-09-07 19:32:37 +02:00
|
|
|
package it.cavallium.dbengine.database.memory;
|
|
|
|
|
2023-02-09 23:34:25 +01:00
|
|
|
import it.cavallium.dbengine.buffers.Buf;
|
2021-09-07 19:32:37 +02:00
|
|
|
|
|
|
|
public class BLRange {
|
|
|
|
|
2023-02-09 23:34:25 +01:00
|
|
|
private final Buf min;
|
|
|
|
private final Buf max;
|
|
|
|
private final Buf single;
|
2021-09-07 19:32:37 +02:00
|
|
|
|
2023-02-09 23:34:25 +01:00
|
|
|
public BLRange(Buf min, Buf max, Buf single) {
|
2021-09-07 19:32:37 +02:00
|
|
|
if (single != null && (min != null || max != null)) {
|
|
|
|
throw new IllegalArgumentException();
|
|
|
|
}
|
|
|
|
this.min = min;
|
|
|
|
this.max = max;
|
|
|
|
this.single = single;
|
|
|
|
}
|
|
|
|
|
2023-02-09 23:34:25 +01:00
|
|
|
public Buf getMin() {
|
2021-09-07 19:32:37 +02:00
|
|
|
return min;
|
|
|
|
}
|
|
|
|
|
2023-02-09 23:34:25 +01:00
|
|
|
public Buf getMax() {
|
2021-09-07 19:32:37 +02:00
|
|
|
return max;
|
|
|
|
}
|
|
|
|
|
2023-02-09 23:34:25 +01:00
|
|
|
public Buf getSingle() {
|
2021-09-07 19:32:37 +02:00
|
|
|
return single;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isSingle() {
|
|
|
|
return single != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isAll() {
|
|
|
|
return single == null && min == null && max == null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hasMin() {
|
|
|
|
return min != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hasMax() {
|
|
|
|
return max != null;
|
|
|
|
}
|
|
|
|
}
|