Class CycleRange

  • All Implemented Interfaces:
    java.util.function.IntUnaryOperator

    public class CycleRange
    extends java.lang.Object
    implements java.util.function.IntUnaryOperator
    Yields a value within a specified range, which rolls over continuously.
    • Constructor Summary

      Constructors 
      Constructor Description
      CycleRange​(int maxValue)
      Sets the maximum value of the cycle range.
      CycleRange​(int minValue, int maxValue)
      Sets the minimum and maximum value of the cycle range.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int applyAsInt​(int operand)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.IntUnaryOperator

        andThen, compose
    • Constructor Detail

      • CycleRange

        public CycleRange​(int maxValue)
        Sets the maximum value of the cycle range. The minimum is default to 0.
        Parameters:
        maxValue - The maximum value in the cycle to be added.
      • CycleRange

        public CycleRange​(int minValue,
                          int maxValue)
        Sets the minimum and maximum value of the cycle range.
        Parameters:
        minValue - minimum value of the cycle to be added.
        maxValue - maximum value of the cycle to be added.
    • Method Detail

      • applyAsInt

        public int applyAsInt​(int operand)
        Specified by:
        applyAsInt in interface java.util.function.IntUnaryOperator