Record Class VCoord

java.lang.Object
java.lang.Record
ffx.numerics.clustering.visualization.VCoord

public record VCoord(double x, double y) extends Record
Immutable Virtual coordinate.
Since:
1.0
Author:
Lars Behnke, 2013, Michael J. Schnieders
  • Constructor Summary

    Constructors
    Constructor
    Description
    VCoord(double x, double y)
    Constructs an immutable virtual coordinate with the given X and Y values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares this coordinate to another object for equality.
    final int
    Returns a hash code value for this object.
    Returns a string representation of this coordinate in the form "Coord(x,y)" with values formatted to three decimal places.
    double
    x()
    Returns the X coordinate value in model space.
    double
    y()
    Returns the Y coordinate value in model space.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VCoord

      public VCoord(double x, double y)
      Constructs an immutable virtual coordinate with the given X and Y values.
      Parameters:
      x - the X value in model space
      y - the Y value in model space
  • Method Details

    • x

      public double x()
      Returns the X coordinate value in model space.
      Returns:
      the X value
    • y

      public double y()
      Returns the Y coordinate value in model space.
      Returns:
      the Y value
    • equals

      public boolean equals(Object obj)
      Compares this coordinate to another object for equality. Two VCoord instances are considered equal if both their X and Y values are exactly equal.
      Specified by:
      equals in class Record
      Parameters:
      obj - the object to compare against
      Returns:
      true if obj is a VCoord with identical X and Y; false otherwise
    • toString

      public String toString()
      Returns a string representation of this coordinate in the form "Coord(x,y)" with values formatted to three decimal places.
      Specified by:
      toString in class Record
      Returns:
      a human-readable string of this coordinate
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object