Package mccombe.mapping
Class XYZ
- java.lang.Object
-
- mccombe.mapping.XYZ
-
public class XYZ extends java.lang.Object
A simple immutable class for 3D cartesian coordinates
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Compare this XYZ with another Objectint
hashCode()
Provide a hashcode for this XYZ based on the values contained.double
x()
Get the X componentdouble
y()
Get the Y componentdouble
z()
Get the Z component
-
-
-
Method Detail
-
x
public double x()
Get the X component- Returns:
- The X component
-
y
public double y()
Get the Y component- Returns:
- The Y component
-
z
public double z()
Get the Z component- Returns:
- The Z component
-
hashCode
public int hashCode()
Provide a hashcode for this XYZ based on the values contained. This is necessary to meet the contract for the Object.hashcode() method which requires that if object1.equals(object2) their hashcodes must also be equal.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashcode
-
equals
public boolean equals(java.lang.Object obj)
Compare this XYZ with another Object- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- - the Objecty to compare to.- Returns:
- true if obj is another XYZ containing the same values. They are not necessarily the same object.
-
-