Class Coordinate
- java.lang.Object
-
- ptolemy.domains.csp.demo.DiningPhilosophers.Coordinate
-
public class Coordinate extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Coordinate()
Constructs a new Coordinate initialized as the origin (0, 0).Coordinate(int x, int y)
Constructs a new Coordinate with the specified values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Tests another object for equality with this instance.int
hashCode()
Return a hash code value for this Coordinate.java.lang.String
toString()
Returns a string representation of the Coordinate in the form "(X, Y)".
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
Tests another object for equality with this instance.- Overrides:
equals
in classjava.lang.Object
- Returns:
- whether it is equal or not.
-
hashCode
public int hashCode()
Return a hash code value for this Coordinate. This method returns the bitwise and of the X and Y integer values.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A hash code value for this Coordinate
-
toString
public java.lang.String toString()
Returns a string representation of the Coordinate in the form "(X, Y)".- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of the Coordinates.
-
-