diff --git a/.github/workflows/pregenerate.yml b/.github/workflows/pregenerate.yml index 7f715eafee..c10b0bbe42 100644 --- a/.github/workflows/pregenerate.yml +++ b/.github/workflows/pregenerate.yml @@ -29,6 +29,8 @@ jobs: run: python -m pip install jinja2 - name: Run ntcore run: ./ntcore/generate_topics.py + - name: Run wpimath + run: ./wpimath/generate_numbers.py - name: Add untracked files to index so they count as changes run: git add -A - name: Check output diff --git a/docs/build.gradle b/docs/build.gradle index 4a6dbd2686..657198d7c2 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -228,7 +228,6 @@ task generateJavaDocs(type: Javadoc) { options.linkSource(true) dependsOn project(':hal').generateUsageReporting dependsOn project(':wpilibj').generateJavaVersion - dependsOn project(':wpimath').generateNat source project(':apriltag').sourceSets.main.java source project(':cameraserver').sourceSets.main.java source project(':cscore').sourceSets.main.java diff --git a/wpimath/CMakeLists.txt b/wpimath/CMakeLists.txt index afe79befd8..dbae16e65e 100644 --- a/wpimath/CMakeLists.txt +++ b/wpimath/CMakeLists.txt @@ -80,7 +80,7 @@ if(WITH_JAVA) include(UseJava) set(CMAKE_JAVA_COMPILE_FLAGS "-encoding" "UTF8" "-Xlint:unchecked") - quickbuf_generate(WPIMATH_QUICKBUF_SRCS "edu/wpi/first/math/proto" ${wpimath_proto_src}) + quickbuf_generate(WPIMATH_QUICKBUF_SRCS "edu/wpi/first/math/proto" ${wpimath_proto_src}) if(NOT EXISTS "${WPILIB_BINARY_DIR}/wpimath/thirdparty/ejml/ejml-simple-0.43.1.jar") set(BASE_URL "https://search.maven.org/remotecontent?filepath=") @@ -119,29 +119,9 @@ if(WITH_JAVA) set(CMAKE_JAVA_INCLUDE_PATH wpimath.jar ${EJML_JARS} ${JACKSON_JARS} ${QUICKBUF_JAR}) - execute_process( - COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/generate_numbers.py ${WPILIB_BINARY_DIR}/wpimath - RESULT_VARIABLE generateResult - ) - if(NOT (generateResult EQUAL "0")) - # Try python - execute_process( - COMMAND - python ${CMAKE_CURRENT_SOURCE_DIR}/generate_numbers.py ${WPILIB_BINARY_DIR}/wpimath - RESULT_VARIABLE generateResult - ) - if(NOT (generateResult EQUAL "0")) - message(FATAL_ERROR "python and python3 generate_numbers.py failed") - endif() - endif() - set(CMAKE_JNI_TARGET true) - file( - GLOB_RECURSE JAVA_SOURCES - src/main/java/*.java - ${WPILIB_BINARY_DIR}/wpimath/generated/*.java - ) + file(GLOB_RECURSE JAVA_SOURCES src/main/java/*.java src/generated/main/java/*.java) add_jar( wpimath_jar @@ -175,7 +155,7 @@ if(WITH_JAVA_SOURCE) file( GLOB WPIMATH_SOURCES src/main/java/edu/wpi/first/math/*.java - ${WPILIB_BINARY_DIR}/wpimath/generated/main/java/edu/wpi/first/math/Nat.java + src/generated/main/java/edu/wpi/first/math/Nat.java ) file(GLOB WPIMATH_CONTROLLER_SOURCES src/main/java/edu/wpi/first/math/controller/*.java) file(GLOB WPIMATH_ESTIMATOR_SOURCES src/main/java/edu/wpi/first/math/estimator/*.java) @@ -183,10 +163,7 @@ if(WITH_JAVA_SOURCE) file(GLOB WPIMATH_GEOMETRY_SOURCES src/main/java/edu/wpi/first/math/geometry/*.java) file(GLOB WPIMATH_INTERPOLATION_SOURCES src/main/java/edu/wpi/first/math/interpolation/*.java) file(GLOB WPIMATH_KINEMATICS_SOURCES src/main/java/edu/wpi/first/math/kinematics/*.java) - file( - GLOB WPIMATH_NUMBERS_SOURCES - ${WPILIB_BINARY_DIR}/wpimath/generated/main/java/edu/wpi/first/math/numbers/*.java - ) + file(GLOB WPIMATH_NUMBERS_SOURCES src/generated/main/java/edu/wpi/first/math/numbers/*.java) file(GLOB WPIMATH_SPLINE_SOURCES src/main/java/edu/wpi/first/math/spline/*.java) file(GLOB WPIMATH_SYSTEM_SOURCES src/main/java/edu/wpi/first/math/system/*.java) file(GLOB WPIMATH_SYSTEM_PLANT_SOURCES src/main/java/edu/wpi/first/math/system/plant/*.java) diff --git a/wpimath/build.gradle b/wpimath/build.gradle index 39794db125..064b8e5bdc 100644 --- a/wpimath/build.gradle +++ b/wpimath/build.gradle @@ -72,68 +72,7 @@ dependencies { api "us.hebi.quickbuf:quickbuf-runtime:1.3.2" } -def wpilibNumberFileInput = file("src/generate/GenericNumber.java.jinja") -def natFileInput = file("src/generate/Nat.java.jinja") -def wpilibNumberFileOutputDir = file("$buildDir/generated/java/edu/wpi/first/math/numbers") -def wpilibNatFileOutput = file("$buildDir/generated/java/edu/wpi/first/math/Nat.java") -def maxNum = 20 - -task generateNumbers() { - description = "Generates generic number classes from template" - group = "WPILib" - - inputs.file wpilibNumberFileInput - outputs.dir wpilibNumberFileOutputDir - - doLast { - if(wpilibNumberFileOutputDir.exists()) { - wpilibNumberFileOutputDir.delete() - } - wpilibNumberFileOutputDir.mkdirs() - - def config = new JinjavaConfig() - def jinjava = new Jinjava(config) - - def template = wpilibNumberFileInput.text - - for(i in 0..maxNum) { - def outputFile = new File(wpilibNumberFileOutputDir, "N${i}.java") - def replacements = new HashMap() - replacements.put("num", i) - def output = jinjava.render(template, replacements) - outputFile.write(output) - } - } -} - -task generateNat() { - description = "Generates Nat.java" - group = "WPILib" - inputs.file natFileInput - outputs.file wpilibNatFileOutput - dependsOn generateNumbers - - doLast { - if(wpilibNatFileOutput.exists()) { - wpilibNatFileOutput.delete() - } - - def config = new JinjavaConfig() - def jinjava = new Jinjava(config) - - def template = natFileInput.text - - def replacements = new HashMap() - replacements.put("nums", 0..maxNum) - - def output = jinjava.render(template, replacements) - wpilibNatFileOutput.write(output) - } -} - -sourceSets.main.java.srcDir "${buildDir}/generated/java" -compileJava.dependsOn generateNumbers -compileJava.dependsOn generateNat +sourceSets.main.java.srcDir "${projectDir}/src/generated/main/java" task unitsHeaders(type: Zip) { destinationDirectory = file("$buildDir/outputs") diff --git a/wpimath/generate_numbers.py b/wpimath/generate_numbers.py old mode 100644 new mode 100755 index c9da1a4cd8..2aeb45a56d --- a/wpimath/generate_numbers.py +++ b/wpimath/generate_numbers.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + # 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. @@ -19,7 +21,7 @@ def output(outPath, outfn, contents): return # File either doesn't exist or has different contents - with open(outpathname, "w") as f: + with open(outpathname, "w", newline="\n") as f: f.write(contents) @@ -27,23 +29,22 @@ def main(): MAX_NUM = 20 dirname, _ = os.path.split(os.path.abspath(__file__)) - cmake_binary_dir = sys.argv[1] env = Environment( - loader=FileSystemLoader(f"{dirname}/src/generate"), + loader=FileSystemLoader(f"{dirname}/src/generate/main/java"), autoescape=False, keep_trailing_newline=True, ) template = env.get_template("GenericNumber.java.jinja") - rootPath = f"{cmake_binary_dir}/generated/main/java/edu/wpi/first/math/numbers" + rootPath = f"{dirname}/src/generated/main/java/edu/wpi/first/math/numbers" for i in range(MAX_NUM + 1): contents = template.render(num=i) output(rootPath, f"N{i}.java", contents) template = env.get_template("Nat.java.jinja") - rootPath = f"{cmake_binary_dir}/generated/main/java/edu/wpi/first/math" + rootPath = f"{dirname}/src/generated/main/java/edu/wpi/first/math" contents = template.render(nums=range(MAX_NUM + 1)) output(rootPath, "Nat.java", contents) diff --git a/wpimath/src/generate/GenericNumber.java.jinja b/wpimath/src/generate/main/java/GenericNumber.java.jinja similarity index 73% rename from wpimath/src/generate/GenericNumber.java.jinja rename to wpimath/src/generate/main/java/GenericNumber.java.jinja index 5e4be85aeb..2bd940b628 100644 --- a/wpimath/src/generate/GenericNumber.java.jinja +++ b/wpimath/src/generate/main/java/GenericNumber.java.jinja @@ -2,30 +2,27 @@ // 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 }}. -*/ +/** A class representing the number {{ num }}. */ public final class N{{ num }} extends Num implements Nat { - private 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. - */ + /** The singleton instance of this class. */ public static final N{{ num }} instance = new N{{ num }}(); } diff --git a/wpimath/src/generate/Nat.java.jinja b/wpimath/src/generate/main/java/Nat.java.jinja similarity index 83% rename from wpimath/src/generate/Nat.java.jinja rename to wpimath/src/generate/main/java/Nat.java.jinja index cbc0ddb24e..7a3fc5ad64 100644 --- a/wpimath/src/generate/Nat.java.jinja +++ b/wpimath/src/generate/main/java/Nat.java.jinja @@ -2,13 +2,15 @@ // 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 +// CHECKSTYLE.OFF: ImportOrder {% for num in nums %} import edu.wpi.first.math.numbers.N{{ num }}; {%- endfor %} -//CHECKSTYLE.ON +// CHECKSTYLE.ON /** * A natural number expressed as a java class. @@ -27,5 +29,5 @@ public interface Nat { static Nat N{{ num }}() { return N{{ num }}.instance; } -{% endfor %} +{% endfor -%} } diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/Nat.java b/wpimath/src/generated/main/java/edu/wpi/first/math/Nat.java new file mode 100644 index 0000000000..dc8d0add6f --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/Nat.java @@ -0,0 +1,131 @@ +// 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 + +import edu.wpi.first.math.numbers.N0; +import edu.wpi.first.math.numbers.N1; +import edu.wpi.first.math.numbers.N2; +import edu.wpi.first.math.numbers.N3; +import edu.wpi.first.math.numbers.N4; +import edu.wpi.first.math.numbers.N5; +import edu.wpi.first.math.numbers.N6; +import edu.wpi.first.math.numbers.N7; +import edu.wpi.first.math.numbers.N8; +import edu.wpi.first.math.numbers.N9; +import edu.wpi.first.math.numbers.N10; +import edu.wpi.first.math.numbers.N11; +import edu.wpi.first.math.numbers.N12; +import edu.wpi.first.math.numbers.N13; +import edu.wpi.first.math.numbers.N14; +import edu.wpi.first.math.numbers.N15; +import edu.wpi.first.math.numbers.N16; +import edu.wpi.first.math.numbers.N17; +import edu.wpi.first.math.numbers.N18; +import edu.wpi.first.math.numbers.N19; +import edu.wpi.first.math.numbers.N20; +// CHECKSTYLE.ON + +/** + * A natural number expressed as a java class. + * The counterpart to {@link Num} that should be used as a concrete value. + * + * @param The {@link Num} this represents. + */ +public interface Nat { + /** + * The number this interface represents. + * + * @return The number backing this value. + */ + int getNum(); + + static Nat N0() { + return N0.instance; + } + + static Nat N1() { + return N1.instance; + } + + static Nat N2() { + return N2.instance; + } + + static Nat N3() { + return N3.instance; + } + + static Nat N4() { + return N4.instance; + } + + static Nat N5() { + return N5.instance; + } + + static Nat N6() { + return N6.instance; + } + + static Nat N7() { + return N7.instance; + } + + static Nat N8() { + return N8.instance; + } + + static Nat N9() { + return N9.instance; + } + + static Nat N10() { + return N10.instance; + } + + static Nat N11() { + return N11.instance; + } + + static Nat N12() { + return N12.instance; + } + + static Nat N13() { + return N13.instance; + } + + static Nat N14() { + return N14.instance; + } + + static Nat N15() { + return N15.instance; + } + + static Nat N16() { + return N16.instance; + } + + static Nat N17() { + return N17.instance; + } + + static Nat N18() { + return N18.instance; + } + + static Nat N19() { + return N19.instance; + } + + static Nat N20() { + return N20.instance; + } +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N0.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N0.java new file mode 100644 index 0000000000..85065f75f2 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N0.java @@ -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 0. */ +public final class N0 extends Num implements Nat { + private N0() {} + + /** + * The integer this class represents. + * + * @return The literal number 0. + */ + @Override + public int getNum() { + return 0; + } + + /** The singleton instance of this class. */ + public static final N0 instance = new N0(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N1.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N1.java new file mode 100644 index 0000000000..8977a7ae80 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N1.java @@ -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 1. */ +public final class N1 extends Num implements Nat { + private N1() {} + + /** + * The integer this class represents. + * + * @return The literal number 1. + */ + @Override + public int getNum() { + return 1; + } + + /** The singleton instance of this class. */ + public static final N1 instance = new N1(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N10.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N10.java new file mode 100644 index 0000000000..540f1d3653 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N10.java @@ -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 10. */ +public final class N10 extends Num implements Nat { + private N10() {} + + /** + * The integer this class represents. + * + * @return The literal number 10. + */ + @Override + public int getNum() { + return 10; + } + + /** The singleton instance of this class. */ + public static final N10 instance = new N10(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N11.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N11.java new file mode 100644 index 0000000000..45113c9b4f --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N11.java @@ -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 11. */ +public final class N11 extends Num implements Nat { + private N11() {} + + /** + * The integer this class represents. + * + * @return The literal number 11. + */ + @Override + public int getNum() { + return 11; + } + + /** The singleton instance of this class. */ + public static final N11 instance = new N11(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N12.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N12.java new file mode 100644 index 0000000000..6a86c80ac6 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N12.java @@ -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 12. */ +public final class N12 extends Num implements Nat { + private N12() {} + + /** + * The integer this class represents. + * + * @return The literal number 12. + */ + @Override + public int getNum() { + return 12; + } + + /** The singleton instance of this class. */ + public static final N12 instance = new N12(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N13.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N13.java new file mode 100644 index 0000000000..7ae2ca1490 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N13.java @@ -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 13. */ +public final class N13 extends Num implements Nat { + private N13() {} + + /** + * The integer this class represents. + * + * @return The literal number 13. + */ + @Override + public int getNum() { + return 13; + } + + /** The singleton instance of this class. */ + public static final N13 instance = new N13(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N14.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N14.java new file mode 100644 index 0000000000..58a4192679 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N14.java @@ -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 14. */ +public final class N14 extends Num implements Nat { + private N14() {} + + /** + * The integer this class represents. + * + * @return The literal number 14. + */ + @Override + public int getNum() { + return 14; + } + + /** The singleton instance of this class. */ + public static final N14 instance = new N14(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N15.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N15.java new file mode 100644 index 0000000000..5794daca03 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N15.java @@ -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 15. */ +public final class N15 extends Num implements Nat { + private N15() {} + + /** + * The integer this class represents. + * + * @return The literal number 15. + */ + @Override + public int getNum() { + return 15; + } + + /** The singleton instance of this class. */ + public static final N15 instance = new N15(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N16.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N16.java new file mode 100644 index 0000000000..3727463868 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N16.java @@ -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 16. */ +public final class N16 extends Num implements Nat { + private N16() {} + + /** + * The integer this class represents. + * + * @return The literal number 16. + */ + @Override + public int getNum() { + return 16; + } + + /** The singleton instance of this class. */ + public static final N16 instance = new N16(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N17.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N17.java new file mode 100644 index 0000000000..e2968d7672 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N17.java @@ -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 17. */ +public final class N17 extends Num implements Nat { + private N17() {} + + /** + * The integer this class represents. + * + * @return The literal number 17. + */ + @Override + public int getNum() { + return 17; + } + + /** The singleton instance of this class. */ + public static final N17 instance = new N17(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N18.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N18.java new file mode 100644 index 0000000000..031089395e --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N18.java @@ -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 18. */ +public final class N18 extends Num implements Nat { + private N18() {} + + /** + * The integer this class represents. + * + * @return The literal number 18. + */ + @Override + public int getNum() { + return 18; + } + + /** The singleton instance of this class. */ + public static final N18 instance = new N18(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N19.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N19.java new file mode 100644 index 0000000000..8c5d48d026 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N19.java @@ -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 19. */ +public final class N19 extends Num implements Nat { + private N19() {} + + /** + * The integer this class represents. + * + * @return The literal number 19. + */ + @Override + public int getNum() { + return 19; + } + + /** The singleton instance of this class. */ + public static final N19 instance = new N19(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N2.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N2.java new file mode 100644 index 0000000000..27f3257135 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N2.java @@ -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 2. */ +public final class N2 extends Num implements Nat { + private N2() {} + + /** + * The integer this class represents. + * + * @return The literal number 2. + */ + @Override + public int getNum() { + return 2; + } + + /** The singleton instance of this class. */ + public static final N2 instance = new N2(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N20.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N20.java new file mode 100644 index 0000000000..fefbfe6810 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N20.java @@ -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 20. */ +public final class N20 extends Num implements Nat { + private N20() {} + + /** + * The integer this class represents. + * + * @return The literal number 20. + */ + @Override + public int getNum() { + return 20; + } + + /** The singleton instance of this class. */ + public static final N20 instance = new N20(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N3.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N3.java new file mode 100644 index 0000000000..1e10c907b7 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N3.java @@ -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 3. */ +public final class N3 extends Num implements Nat { + private N3() {} + + /** + * The integer this class represents. + * + * @return The literal number 3. + */ + @Override + public int getNum() { + return 3; + } + + /** The singleton instance of this class. */ + public static final N3 instance = new N3(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N4.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N4.java new file mode 100644 index 0000000000..f7fe57e275 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N4.java @@ -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 4. */ +public final class N4 extends Num implements Nat { + private N4() {} + + /** + * The integer this class represents. + * + * @return The literal number 4. + */ + @Override + public int getNum() { + return 4; + } + + /** The singleton instance of this class. */ + public static final N4 instance = new N4(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N5.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N5.java new file mode 100644 index 0000000000..ec5deb504b --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N5.java @@ -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 5. */ +public final class N5 extends Num implements Nat { + private N5() {} + + /** + * The integer this class represents. + * + * @return The literal number 5. + */ + @Override + public int getNum() { + return 5; + } + + /** The singleton instance of this class. */ + public static final N5 instance = new N5(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N6.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N6.java new file mode 100644 index 0000000000..fe94f08c60 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N6.java @@ -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 6. */ +public final class N6 extends Num implements Nat { + private N6() {} + + /** + * The integer this class represents. + * + * @return The literal number 6. + */ + @Override + public int getNum() { + return 6; + } + + /** The singleton instance of this class. */ + public static final N6 instance = new N6(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N7.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N7.java new file mode 100644 index 0000000000..241c992548 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N7.java @@ -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 7. */ +public final class N7 extends Num implements Nat { + private N7() {} + + /** + * The integer this class represents. + * + * @return The literal number 7. + */ + @Override + public int getNum() { + return 7; + } + + /** The singleton instance of this class. */ + public static final N7 instance = new N7(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N8.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N8.java new file mode 100644 index 0000000000..4930b00975 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N8.java @@ -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 8. */ +public final class N8 extends Num implements Nat { + private N8() {} + + /** + * The integer this class represents. + * + * @return The literal number 8. + */ + @Override + public int getNum() { + return 8; + } + + /** The singleton instance of this class. */ + public static final N8 instance = new N8(); +} diff --git a/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N9.java b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N9.java new file mode 100644 index 0000000000..2c6e4eed95 --- /dev/null +++ b/wpimath/src/generated/main/java/edu/wpi/first/math/numbers/N9.java @@ -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 9. */ +public final class N9 extends Num implements Nat { + private N9() {} + + /** + * The integer this class represents. + * + * @return The literal number 9. + */ + @Override + public int getNum() { + return 9; + } + + /** The singleton instance of this class. */ + public static final N9 instance = new N9(); +}