2021-09-17 00:10:29 -07:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
|
|
2023-12-01 23:52:38 -05:00
|
|
|
// THIS FILE WAS AUTO-GENERATED BY ./wpimath/generate_numbers.py. DO NOT MODIFY
|
|
|
|
|
|
2021-09-17 00:10:29 -07:00
|
|
|
package edu.wpi.first.math;
|
|
|
|
|
|
2023-12-01 23:52:38 -05:00
|
|
|
// CHECKSTYLE.OFF: ImportOrder
|
2021-09-17 00:10:29 -07:00
|
|
|
{% for num in nums %}
|
|
|
|
|
import edu.wpi.first.math.numbers.N{{ num }};
|
|
|
|
|
{%- endfor %}
|
2023-12-01 23:52:38 -05:00
|
|
|
// CHECKSTYLE.ON
|
2021-09-17 00:10:29 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A natural number expressed as a java class.
|
|
|
|
|
* The counterpart to {@link Num} that should be used as a concrete value.
|
|
|
|
|
*
|
|
|
|
|
* @param <T> The {@link Num} this represents.
|
|
|
|
|
*/
|
2025-08-08 23:04:02 -07:00
|
|
|
@SuppressWarnings("PMD.ImplicitFunctionalInterface")
|
2021-09-17 00:10:29 -07:00
|
|
|
public interface Nat<T extends Num> {
|
|
|
|
|
/**
|
|
|
|
|
* The number this interface represents.
|
|
|
|
|
*
|
|
|
|
|
* @return The number backing this value.
|
|
|
|
|
*/
|
|
|
|
|
int getNum();
|
|
|
|
|
{% for num in nums %}
|
2024-01-04 08:38:06 -08:00
|
|
|
/**
|
|
|
|
|
* Returns the Nat instance for {{ num }}.
|
|
|
|
|
*
|
|
|
|
|
* @return The Nat instance for {{ num }}.
|
|
|
|
|
*/
|
2021-09-17 00:10:29 -07:00
|
|
|
static Nat<N{{ num }}> N{{ num }}() {
|
|
|
|
|
return N{{ num }}.instance;
|
|
|
|
|
}
|
2023-12-01 23:52:38 -05:00
|
|
|
{% endfor -%}
|
2021-09-17 00:10:29 -07:00
|
|
|
}
|