Class NumberValueSource<K,N extends Number>

java.lang.Object
io.github.projectunified.valuevenue.number.DynamicNumberValueSource<K,N>
io.github.projectunified.valuevenue.number.NumberValueSource<K,N>
Type Parameters:
K - type of the key
N - type of the number
All Implemented Interfaces:
ValueSource<K,N>, Function<K,List<N>>

public class NumberValueSource<K,N extends Number> extends DynamicNumberValueSource<K,N>
A ValueSource whose values are a fixed range of numbers, stepped from the start to the end.

The variable is DynamicNumberValueSource.DEFAULT_KEY unless another key is given to the constructor, and resolves to the plain text of the number.

  • Constructor Details

    • NumberValueSource

      public NumberValueSource(NumberType<N> type, Number start, Number end, Number step)
      Creates the source with DynamicNumberValueSource.DEFAULT_KEY, including the end.
      Parameters:
      type - the number type of the values
      start - the first value
      end - the last value, or the bound when it is not included
      step - the distance between two values, positive
    • NumberValueSource

      public NumberValueSource(NumberType<N> type, Number start, Number end, Number step, boolean maxInclusive)
      Creates the source with DynamicNumberValueSource.DEFAULT_KEY.
      Parameters:
      type - the number type of the values
      start - the first value
      end - the last value, or the bound when it is not included
      step - the distance between two values, positive
      maxInclusive - whether the end is a value of the range
    • NumberValueSource

      public NumberValueSource(NumberType<N> type, Number start, Number end, Number step, boolean maxInclusive, Direction direction)
      Creates the source with DynamicNumberValueSource.DEFAULT_KEY.
      Parameters:
      type - the number type of the values
      start - the first value
      end - the last value, or the bound when it is not included
      step - the distance between two values, positive
      maxInclusive - whether the end is a value of the range
      direction - the direction the values step in
    • NumberValueSource

      public NumberValueSource(NumberType<N> type, String key, Number start, Number end, Number step, boolean maxInclusive, Direction direction)
      Creates the source.
      Parameters:
      type - the number type of the values
      key - name of the variable holding the number itself
      start - the first value
      end - the last value, or the bound when it is not included
      step - the distance between two values, positive
      maxInclusive - whether the end is a value of the range
      direction - the direction the values step in
  • Method Details