Class ValueRangeFactory
java.lang.Object
ai.timefold.solver.core.api.domain.valuerange.ValueRangeFactory
Factory for
CountableValueRange.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull CountableValueRange<BigDecimal>createBigDecimalValueRange(@NonNull BigDecimal from, @NonNull BigDecimal to) Build aCountableValueRangeof allBigDecimalvalues (of a specific scale) between 2 bounds.static @NonNull CountableValueRange<BigDecimal>createBigDecimalValueRange(@NonNull BigDecimal from, @NonNull BigDecimal to, @NonNull BigDecimal incrementUnit) Build aCountableValueRangeof a subset ofBigDecimalvalues (of a specific scale) between 2 bounds.static @NonNull CountableValueRange<BigInteger>createBigIntegerValueRange(@NonNull BigInteger from, @NonNull BigInteger to) Build aCountableValueRangeof allBigIntegervalues between 2 bounds.static @NonNull CountableValueRange<BigInteger>createBigIntegerValueRange(@NonNull BigInteger from, @NonNull BigInteger to, @NonNull BigInteger incrementUnit) Build aCountableValueRangeof a subset ofBigIntegervalues between 2 bounds.static @NonNull CountableValueRange<Boolean>Build aCountableValueRangeof bothbooleanvalues.static @NonNull ValueRange<Double>createDoubleValueRange(double from, double to) Deprecated, for removal: This API element is subject to removal in a future version.static @NonNull CountableValueRange<Integer>createIntValueRange(int from, int to) Build aCountableValueRangeof allintvalues between 2 bounds.static @NonNull CountableValueRange<Integer>createIntValueRange(int from, int to, int incrementUnit) Build aCountableValueRangeof a subset ofintvalues between 2 bounds.static CountableValueRange<LocalDateTime>createLocalDateTimeValueRange(@NonNull LocalDateTime from, @NonNull LocalDateTime to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofLocalDateTimevalues between 2 bounds.static @NonNull CountableValueRange<LocalDate>createLocalDateValueRange(@NonNull LocalDate from, @NonNull LocalDate to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofLocalDatevalues between 2 bounds.static CountableValueRange<LocalTime>createLocalTimeValueRange(@NonNull LocalTime from, @NonNull LocalTime to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofLocalTimevalues between 2 bounds.static @NonNull CountableValueRange<Long>createLongValueRange(long from, long to) Build aCountableValueRangeof alllongvalues between 2 bounds.static @NonNull CountableValueRange<Long>createLongValueRange(long from, long to, long incrementUnit) Build aCountableValueRangeof a subset oflongvalues between 2 bounds.static <Temporal_ extends Temporal & Comparable<? super Temporal_>>
@NonNull CountableValueRange<Temporal_>createTemporalValueRange(@NonNull Temporal_ from, @NonNull Temporal_ to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofTemporalvalues (such asLocalDateorLocalDateTime) between 2 bounds.
-
Constructor Details
-
ValueRangeFactory
public ValueRangeFactory()
-
-
Method Details
-
createBooleanValueRange
Build aCountableValueRangeof bothbooleanvalues. -
createIntValueRange
Build aCountableValueRangeof allintvalues between 2 bounds.- Parameters:
from- inclusive minimumto- exclusive maximum,>= from
-
createIntValueRange
public static @NonNull CountableValueRange<Integer> createIntValueRange(int from, int to, int incrementUnit) Build aCountableValueRangeof a subset ofintvalues between 2 bounds.- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnit-> 0
-
createLongValueRange
Build aCountableValueRangeof alllongvalues between 2 bounds.- Parameters:
from- inclusive minimumto- exclusive maximum,>= from
-
createLongValueRange
public static @NonNull CountableValueRange<Long> createLongValueRange(long from, long to, long incrementUnit) Build aCountableValueRangeof a subset oflongvalues between 2 bounds.- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnit-> 0
-
createDoubleValueRange
@Deprecated(forRemoval=true, since="1.1.0") public static @NonNull ValueRange<Double> createDoubleValueRange(double from, double to) Deprecated, for removal: This API element is subject to removal in a future version.Build an uncountableValueRangeof alldoublevalues between 2 bounds.- Parameters:
from- inclusive minimumto- exclusive maximum,>= from
-
createBigIntegerValueRange
public static @NonNull CountableValueRange<BigInteger> createBigIntegerValueRange(@NonNull BigInteger from, @NonNull BigInteger to) Build aCountableValueRangeof allBigIntegervalues between 2 bounds.- Parameters:
from- inclusive minimumto- exclusive maximum,>= from
-
createBigIntegerValueRange
public static @NonNull CountableValueRange<BigInteger> createBigIntegerValueRange(@NonNull BigInteger from, @NonNull BigInteger to, @NonNull BigInteger incrementUnit) Build aCountableValueRangeof a subset ofBigIntegervalues between 2 bounds.- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnit-> 0
-
createBigDecimalValueRange
public static @NonNull CountableValueRange<BigDecimal> createBigDecimalValueRange(@NonNull BigDecimal from, @NonNull BigDecimal to) Build aCountableValueRangeof allBigDecimalvalues (of a specific scale) between 2 bounds. All parameters must have the sameBigDecimal.scale().- Parameters:
from- inclusive minimumto- exclusive maximum,>= from
-
createBigDecimalValueRange
public static @NonNull CountableValueRange<BigDecimal> createBigDecimalValueRange(@NonNull BigDecimal from, @NonNull BigDecimal to, @NonNull BigDecimal incrementUnit) Build aCountableValueRangeof a subset ofBigDecimalvalues (of a specific scale) between 2 bounds. All parameters must have the sameBigDecimal.scale().- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnit-> 0
-
createLocalDateValueRange
public static @NonNull CountableValueRange<LocalDate> createLocalDateValueRange(@NonNull LocalDate from, @NonNull LocalDate to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofLocalDatevalues between 2 bounds.Facade for
createTemporalValueRange(Temporal, Temporal, long, TemporalUnit).- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnitAmount-> 0incrementUnitType- must besupported
-
createLocalTimeValueRange
public static CountableValueRange<LocalTime> createLocalTimeValueRange(@NonNull LocalTime from, @NonNull LocalTime to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofLocalTimevalues between 2 bounds.Facade for
createTemporalValueRange(Temporal, Temporal, long, TemporalUnit).- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnitAmount-> 0incrementUnitType- must besupported
-
createLocalDateTimeValueRange
public static CountableValueRange<LocalDateTime> createLocalDateTimeValueRange(@NonNull LocalDateTime from, @NonNull LocalDateTime to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofLocalDateTimevalues between 2 bounds.Facade for
createTemporalValueRange(Temporal, Temporal, long, TemporalUnit).- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnitAmount-> 0incrementUnitType- must besupported
-
createTemporalValueRange
public static <Temporal_ extends Temporal & Comparable<? super Temporal_>> @NonNull CountableValueRange<Temporal_> createTemporalValueRange(@NonNull Temporal_ from, @NonNull Temporal_ to, long incrementUnitAmount, @NonNull TemporalUnit incrementUnitType) Build aCountableValueRangeof a subset ofTemporalvalues (such asLocalDateorLocalDateTime) between 2 bounds. All parameters must have the sameTemporalUnit.- Parameters:
from- inclusive minimumto- exclusive maximum,>= fromincrementUnitAmount-> 0incrementUnitType- must besupportedbyfromandto
-
createBigDecimalValueRange(BigDecimal, BigDecimal).