Package javajs.util
Class T3i
java.lang.Object
javajs.util.T3i
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
P3i
A 3-element tuple represented by signed integer x,y,z coordinates.
- Since:
- Java 3D 1.2
- Version:
- specification 1.2, implementation $Revision: 1.9 $, $Date: 2006/07/28 17:01:32 $
- Author:
- Kenji hiranabe additions by Bob Hanson hansonr@stolaf.edu 9/30/2012 for unique constructor and method names for the optimization of compiled JavaScript using Java2Script
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Sets the value of this tuple to the sum of itself and t1.asString()
boolean
Returns true if the Object o is of type Tuple3i and all of the data members of t are equal to the corresponding data members in this Tuple3i.int
hashCode()
Returns a hash number based on the data values in this object.final void
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).final void
set
(int x, int y, int z) Sets the value of this tuple to to the specified x, y, and z coordinates.final void
Sets the value of this tuple to the value of tuple t1.toString()
Returns a string that contains the values of this Tuple3i.
-
Field Details
-
x
public int xThe x coordinate. -
y
public int yThe y coordinate. -
z
public int zThe z coordinate.
-
-
Constructor Details
-
T3i
public T3i()Constructs and initializes a Tuple3i to (0,0,0).
-
-
Method Details
-
set
public final void set(int x, int y, int z) Sets the value of this tuple to to the specified x, y, and z coordinates.- Parameters:
x
- the x coordinate.y
- the y coordinate.z
- the z coordinate.
-
setT
Sets the value of this tuple to the value of tuple t1.- Parameters:
t1
- the tuple to be copied.
-
add
Sets the value of this tuple to the sum of itself and t1.- Parameters:
t
- is the other tuple
-
scaleAdd
Sets the value of this tuple to the scalar multiplication of tuple t1 plus tuple t2 (this = s*t1 + t2).- Parameters:
s
- the scalar valuet1
- the tuple to be multipledt2
- the tuple to be added
-
hashCode
public int hashCode()Returns a hash number based on the data values in this object. Two different Tuple3i objects with identical data values (ie, returns true for equals(Tuple3i) ) will return the same hash number. Two vectors with different data members may return the same hash value, although this is not likely. -
equals
Returns true if the Object o is of type Tuple3i and all of the data members of t are equal to the corresponding data members in this Tuple3i. -
asString
-
toString
Returns a string that contains the values of this Tuple3i. The form is (x,y,z).
-