[docs] Add missing JavaDocs (#6146)

This commit is contained in:
Tyler Veness
2024-01-04 08:38:06 -08:00
committed by GitHub
parent 6e58db398d
commit f29a7d2e50
145 changed files with 1106 additions and 94 deletions

View File

@@ -4,23 +4,54 @@
package edu.wpi.first.math;
/**
* Represents a pair of two objects.
*
* @param <A> The first object's type.
* @param <B> The second object's type.
*/
public class Pair<A, B> {
private final A m_first;
private final B m_second;
/**
* Constructs a pair.
*
* @param first The first object.
* @param second The second object.
*/
public Pair(A first, B second) {
m_first = first;
m_second = second;
}
/**
* Returns the first object.
*
* @return The first object.
*/
public A getFirst() {
return m_first;
}
/**
* Returns the second object.
*
* @return The second object.
*/
public B getSecond() {
return m_second;
}
/**
* Returns a pair comprised of the two given objects.
*
* @param <A> The first object's type.
* @param <B> The second object's type.
* @param a The first object.
* @param b The second object.
* @return A pair comprised of the two given objects.
*/
public static <A, B> Pair<A, B> of(A a, B b) {
return new Pair<>(a, b);
}