Class MarkPair<T extends Mark>

Object
MarkPair<T>
Type Parameters:
T - The type of mark in the pair, extending Mark

public class MarkPair<T extends Mark> extends Object
Represents a pair of marks, with a source and destination.

The marks are ordered such that the source always has a lower identifier than the destination.

  • Constructor Details

    • MarkPair

      public MarkPair(T source, T destination)
      Constructs a new MarkPair.

      The marks are automatically ordered so that the source has a lower identifier than the destination.

      Parameters:
      source - One of the marks in the pair
      destination - The other mark in the pair
  • Method Details

    • equals

      public boolean equals(Object othero)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getSource

      public T getSource()
      Gets the source mark of the pair (the one with the lower identifier).
      Returns:
      The source mark
    • getDestination

      public T getDestination()
      Gets the destination mark of the pair (the one with the higher identifier).
      Returns:
      The destination mark
    • toString

      public String toString()
      Overrides:
      toString in class Object