<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/**
 * Mutable 2-tuple type.
 *
 * @author Nathan Sprague and Michael S. Kirkpatrick
 * @version V4, 8/2021
 */
public class Pair {
  private Object first;
  private Object second;

  /**
   * Create a Pair with the provided objects.
   *
   * @param first The first object.
   * @param second The second object.
   */
  public Pair(Object first, Object second) {
    this.first = first;
    this.second = second;
  }

  /**
   * Access the first component.
   *
   * @return The first component.
   */
  public Object getFirst() {
    return first;
  }

  /**
   * Set the first component.
   *
   * @param first The new component.
   */
  public void setFirst(Object first) {
    this.first = first;
  }

  /**
   * Access the second component.
   *
   * @return The second component.
   */
  public Object getSecond() {
    return second;
  }

  /**
   * Set the second component.
   *
   * @param second The new component.
   */
  public void setSecond(Object second) {
    this.second = second;
  }

  @Override
  public String toString() {
    return "&lt;" + first.toString() + ", " + second.toString() + "&gt;";
  }
}
</pre></body></html>