|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.geometry.Tuple3D<T>
T - the subclass for hacky type-safety thingspublic abstract class Tuple3D<T extends Tuple3D<T>>
Base coordinate triplet type
| Field Summary | |
|---|---|
private static long |
serialVersionUID
Java serialisation unique ID |
protected double |
x
X |
protected double |
y
Y |
protected double |
z
Z |
| Constructor Summary | |
|---|---|
Tuple3D(double x0,
double y0,
double z0)
Create a new coördinate triplet |
|
Tuple3D(org.json.JSONObject o)
Instantiate from JSON data |
|
Tuple3D(T t)
Create a new coordinate triplet from an existing coordinate triplet |
|
| Method Summary | |
|---|---|
T |
add(double x0,
double y0,
double z0)
Adds the coördinate triplet to the tuple together |
T |
add(T p)
Adds two tuples together |
protected Object |
clone()
|
T |
divide(double dividend)
Divides the tuple by the value |
boolean |
equals(Object obj)
|
double |
getX()
Gets the X ordinate |
double |
getY()
Gets the Y abscissa |
double |
getZ()
Gets the Z ordinate |
int |
hashCode()
|
T |
multiply(double factor)
Multiplies the tuple by the value |
protected abstract T |
newInstance(double x0,
double y0,
double z0)
Method used to create a new object of the child's type while getting around down-casting problems in Java |
T |
subtract(double x2,
double y2,
double z2)
Subtracts the coordinate triplet from this tuple |
T |
subtract(T p)
Subtracts a tuple from this tuple |
org.json.JSONObject |
toJSON()
This returns a copy of the object's data cast into a JSON form. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
protected final double x
protected final double y
protected final double z
| Constructor Detail |
|---|
public Tuple3D(double x0,
double y0,
double z0)
x0 - x ordinatey0 - y abscissaz0 - z ordinate
public Tuple3D(org.json.JSONObject o)
throws org.json.JSONException
o - JSON coordinate object
org.json.JSONException - if the data is malformedpublic Tuple3D(T t)
t - tuple| Method Detail |
|---|
public T add(double x0,
double y0,
double z0)
x0 - x ordinatey0 - y abscissaz0 - z ordinate
public T add(T p)
p - tuple
protected Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionObject.clone()public T divide(double dividend)
Divides the tuple by the value
Note: Will happily try to divide by zero if assertions are disabled!
dividend - Amount by which to divide the tuple
public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public double getX()
public double getY()
public double getZ()
public int hashCode()
hashCode in class ObjectObject.hashCode()public T multiply(double factor)
factor - Amount by which to multiply the tuple
protected abstract T newInstance(double x0,
double y0,
double z0)
x0 - x ordinatey0 - y abscissaz0 - z ordinate
public T subtract(double x2,
double y2,
double z2)
x2 - Coordinate triplet to subtract from this tupley2 - Coordinate triplet to subtract from this tuplez2 - Coordinate triplet to subtract from this tuple
public T subtract(T p)
p - Tuple to subtract from this tuple
public org.json.JSONObject toJSON()
CastsToJSON
toJSON in interface CastsToJSONCastsToJSON.toJSON()public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||