java.lang.Object
ai.timefold.solver.core.impl.domain.valuerange.AbstractCountableValueRange<Long>
ai.timefold.solver.core.impl.domain.valuerange.buildin.primlong.LongValueRange
All Implemented Interfaces:
CountableValueRange<Long>, ValueRange<Long>

public final class LongValueRange extends AbstractCountableValueRange<Long>
  • Constructor Details

    • LongValueRange

      public LongValueRange(long from, long to)
      Parameters:
      from - inclusive minimum
      to - exclusive maximum, >= from
    • LongValueRange

      public LongValueRange(long from, long to, long incrementUnit)
      Parameters:
      from - inclusive minimum
      to - exclusive maximum, >= from
      incrementUnit - > 0
  • Method Details

    • getSize

      public long getSize()
      Description copied from interface: CountableValueRange
      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
    • contains

      public boolean contains(Long value)
      Parameters:
      value - sometimes null
      Returns:
      true if the ValueRange contains that value
    • get

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

      public @NonNull Iterator<Long> createOriginalIterator()
      Description copied from interface: CountableValueRange
      Select the elements in original (natural) order.
    • createRandomIterator

      public @NonNull Iterator<Long> createRandomIterator(@NonNull Random workingRandom)
      Description copied from interface: ValueRange
      Select in random order, but without shuffling the elements. Each element might be selected multiple times. Scales well because it does not require caching.
      Parameters:
      workingRandom - the Random to use when any random number is needed, so runs are reproducible.
    • toString

      public String toString()
      Overrides:
      toString in class Object