Interface CountableValueRange<T>

All Superinterfaces:
ValueRange<T>
All Known Implementing Classes:
AbstractCountableValueRange, BigDecimalValueRange, BigIntegerValueRange, BooleanValueRange, CompositeCountableValueRange, EmptyValueRange, IntValueRange, ListValueRange, LongValueRange, NullAllowingCountableValueRange, TemporalValueRange

public interface CountableValueRange<T> extends ValueRange<T>
A ValueRange that is ending. Therefore, it has a discrete (as in non-continuous) range.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Iterator<T>
    Select the elements in original (natural) order.
    @Nullable T
    get(long index)
    Used by uniform random selection in a composite CountableValueRange, or one which includes nulls.
    long
    Used by uniform random selection in a composite CountableValueRange, or one which includes nulls.

    Methods inherited from interface ai.timefold.solver.core.api.domain.valuerange.ValueRange

    contains, createRandomIterator, isEmpty
  • Method Details

    • getSize

      long getSize()
      Used by uniform random selection in a composite CountableValueRange, or one which includes nulls.
      Returns:
      the exact number of elements generated by this CountableValueRange, always >= 0
    • get

      @Nullable T get(long index)
      Used by uniform random selection in a composite CountableValueRange, or one which includes nulls.
      Parameters:
      index - always < getSize()
      Returns:
      sometimes null (if PlanningVariable.allowsUnassigned() is true)
    • createOriginalIterator

      @NonNull Iterator<T> createOriginalIterator()
      Select the elements in original (natural) order.