Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 1 | // Copyright (c) FIRST and other WPILib contributors. |
| 2 | // Open Source Software; you can modify and/or share it under the terms of |
| 3 | // the WPILib BSD license file in the root directory of this project. |
| 4 | |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 5 | // THIS FILE WAS AUTO-GENERATED BY ./wpimath/generate_numbers.py. DO NOT MODIFY |
| 6 | |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 7 | package edu.wpi.first.math; |
| 8 | |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 9 | // CHECKSTYLE.OFF: ImportOrder |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 10 | {% for num in nums %} |
| 11 | import edu.wpi.first.math.numbers.N{{ num }}; |
| 12 | {%- endfor %} |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 13 | // CHECKSTYLE.ON |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 14 | |
| 15 | /** |
| 16 | * A natural number expressed as a java class. |
| 17 | * The counterpart to {@link Num} that should be used as a concrete value. |
| 18 | * |
| 19 | * @param <T> The {@link Num} this represents. |
| 20 | */ |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 21 | public interface Nat<T extends Num> { |
| 22 | /** |
| 23 | * The number this interface represents. |
| 24 | * |
| 25 | * @return The number backing this value. |
| 26 | */ |
| 27 | int getNum(); |
| 28 | {% for num in nums %} |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 29 | /** |
| 30 | * Returns the Nat instance for {{ num }}. |
| 31 | * |
| 32 | * @return The Nat instance for {{ num }}. |
| 33 | */ |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 34 | static Nat<N{{ num }}> N{{ num }}() { |
| 35 | return N{{ num }}.instance; |
| 36 | } |
Maxwell Henderson | 80bec32 | 2024-01-09 15:48:44 -0800 | [diff] [blame^] | 37 | {% endfor -%} |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 38 | } |