[wpimath] Commit generated files (#5986)

This commit is contained in:
PJ Reiniger
2023-12-01 23:52:38 -05:00
committed by GitHub
parent 54ab65a63a
commit 5dad46cd45
29 changed files with 743 additions and 107 deletions

View File

@@ -0,0 +1,28 @@
// 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.
// THIS FILE WAS AUTO-GENERATED BY ./wpimath/generate_numbers.py. DO NOT MODIFY
package edu.wpi.first.math.numbers;
import edu.wpi.first.math.Nat;
import edu.wpi.first.math.Num;
/** A class representing the number {{ num }}. */
public final class N{{ num }} extends Num implements Nat<N{{ num }}> {
private N{{ num }}() {}
/**
* The integer this class represents.
*
* @return The literal number {{ num }}.
*/
@Override
public int getNum() {
return {{ num }};
}
/** The singleton instance of this class. */
public static final N{{ num }} instance = new N{{ num }}();
}

View File

@@ -0,0 +1,33 @@
// 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.
// THIS FILE WAS AUTO-GENERATED BY ./wpimath/generate_numbers.py. DO NOT MODIFY
package edu.wpi.first.math;
// CHECKSTYLE.OFF: ImportOrder
{% for num in nums %}
import edu.wpi.first.math.numbers.N{{ num }};
{%- endfor %}
// CHECKSTYLE.ON
/**
* 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.
*/
public interface Nat<T extends Num> {
/**
* The number this interface represents.
*
* @return The number backing this value.
*/
int getNum();
{% for num in nums %}
static Nat<N{{ num }}> N{{ num }}() {
return N{{ num }}.instance;
}
{% endfor -%}
}