Package mccombe.mapping
Class XYZ
- java.lang.Object
-
- mccombe.mapping.XYZ
-
public class XYZ extends java.lang.ObjectA simple immutable class for 3D cartesian coordinates
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Compare this XYZ with another ObjectinthashCode()Provide a hashcode for this XYZ based on the values contained.doublex()Get the X componentdoubley()Get the Y componentdoublez()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:
hashCodein classjava.lang.Object- Returns:
- hashcode
-
equals
public boolean equals(java.lang.Object obj)
Compare this XYZ with another Object- Overrides:
equalsin 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.
-
-