Interface Cyclical<Value extends Number>

Type Parameters:
Value - the type of number this uses, to help with type coercion
All Known Implementing Classes:
Time

public interface Cyclical<Value extends Number>
This is for a special type of numerical value that is compared in a cyclical (rather than a linear) way.

The current example of this in Skript is Time, since 23:59 can be both before XOR after 00:01 depending on the context.

In practice, cyclical types have to be compared in a special way (particularly for "is between") when we can use the order of operations to determine the context.

The minimum/maximum values are intended to help with unusual equality checks, (e.g. 11pm = 1am - 2h).

  • Method Summary

    Modifier and Type
    Method
    Description
    The potential 'top' of the cycle, e.g.
    The potential 'bottom' of the cycle, e.g.
  • Method Details

    • getMaximum

      Value getMaximum()
      The potential 'top' of the cycle, e.g. the highest value after which this should restart. In practice, nothing forces this, so you can write 24:00 or 361° instead of 00:00 and 1° respectively.
      Returns:
      the highest legal value
    • getMinimum

      Value getMinimum()
      The potential 'bottom' of the cycle, e.g. the lowest value. In practice, nothing forces this, so 24:00 is synonymous with 00:00.
      Returns:
      the lowest legal value