|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fi.utu.cs.physics.Tuple2
A two-element tuple of double-precision floating point values.
Constructor Summary | |
protected |
Tuple2(double v1,
double v2)
Creates a new two-element tuple with the given values. |
Method Summary | |
protected void |
add(double v1,
double v2)
Adds values to the elements. |
protected void |
add(Tuple2 other)
Adds the values of other to the elements. |
java.lang.Object |
clone()
Creates and returns a copy of this tuple. |
boolean |
equals(java.lang.Object o)
Returns true if o is of the type Tuple2 and
the elements of o are equal to the
corresponding elements in this tuple. |
protected int |
firstElementSign()
Returns the sign of the first element. |
protected double |
getFirstElement()
Returns the first element. |
protected double |
getSecondElement()
Returns the second element. |
int |
hashCode()
Returns a hash code value based on the elements of this tuple. |
protected double |
max()
Returns the maximum of the elements. |
protected double |
min()
Returns the minimum of the elements. |
protected void |
multiply(double value)
Multiplies both elements with value . |
protected void |
negate()
Negates the elements. |
protected void |
negateFirstElement()
Negates the first element. |
protected void |
negateSecondElement()
Negates the second element. |
protected int |
secondElementSign()
Returns the sign of the second element. |
protected void |
set(double v1,
double v2)
Sets the elements. |
protected void |
set(Tuple2 other)
Sets the elements to the same values as in other . |
protected void |
setFirstElement(double v)
Sets the first element to the value v . |
protected void |
setSecondElement(double v)
Sets the second element to the value v . |
protected void |
swap()
Swaps the elements. |
java.lang.String |
toString()
Returns a string that contains the values of the elements. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Tuple2(double v1, double v2)
Method Detail |
protected double getFirstElement()
protected double getSecondElement()
protected void setFirstElement(double v)
v
.
protected void setSecondElement(double v)
v
.
protected void set(double v1, double v2)
v1
- The value of the first element.v2
- The value of the second element.set(Tuple2)
protected void set(Tuple2 other)
other
.
protected void add(double v1, double v2)
v1
- The value added to the first element.v2
- The value added to the second element.add(Tuple2)
protected void add(Tuple2 other)
other
to the elements.
protected void negate()
protected void negateFirstElement()
protected void negateSecondElement()
protected void multiply(double value)
value
.
protected void swap()
protected double min()
protected double max()
protected int firstElementSign()
protected int secondElementSign()
public boolean equals(java.lang.Object o)
o
is of the type Tuple2
and
the elements of o
are equal to the
corresponding elements in this tuple.
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |