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 | |
| 5 | package edu.wpi.first.math; |
| 6 | |
| 7 | //CHECKSTYLE.OFF: ImportOrder |
| 8 | {% for num in nums %} |
| 9 | import edu.wpi.first.math.numbers.N{{ num }}; |
| 10 | {%- endfor %} |
| 11 | //CHECKSTYLE.ON |
| 12 | |
| 13 | /** |
| 14 | * A natural number expressed as a java class. |
| 15 | * The counterpart to {@link Num} that should be used as a concrete value. |
| 16 | * |
| 17 | * @param <T> The {@link Num} this represents. |
| 18 | */ |
| 19 | @SuppressWarnings({"MethodName", "unused"}) |
| 20 | public interface Nat<T extends Num> { |
| 21 | /** |
| 22 | * The number this interface represents. |
| 23 | * |
| 24 | * @return The number backing this value. |
| 25 | */ |
| 26 | int getNum(); |
| 27 | {% for num in nums %} |
| 28 | static Nat<N{{ num }}> N{{ num }}() { |
| 29 | return N{{ num }}.instance; |
| 30 | } |
| 31 | {% endfor %} |
| 32 | } |