Class PointXy

java.lang.Object
edu.cmu.tetrad.util.PointXy
All Implemented Interfaces:
TetradSerializable, Serializable

public class PointXy extends Object implements TetradSerializable
Stores a (x, y) point without having to use awt classes. Immutable.
Author:
josephramsey
See Also:
  • Constructor Details

    • PointXy

      public PointXy(int x, int y)
      Constructs a new point with the given coordinates.
      Parameters:
      x - The x coordinate for the point.
      y - The y coordinate for the point.
    • PointXy

      public PointXy(PointXy point)
      Copy constructor.
      Parameters:
      point - The point to be copied.
  • Method Details

    • serializableInstance

      public static PointXy serializableInstance()
      Generates a simple exemplar of this class to test serialization.
      Returns:
      the examplar.
    • getX

      public int getX()
      Returns:
      Ibid.
    • getY

      public int getY()
      Returns:
      Ibid.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Returns:
      true just in case o is a Point with the same x and y coordinates.
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      a string representation of a point.