Top Description Fields Constructors Methods
javax.vecmath

public abstract Class Tuple3b

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
javax.vecmath.Color3b
Imports
java.lang.Math

A three byte tuple. Note that Java defines a byte as a signed integer in the range [-128, 127]. However, colors are more typically represented by values in the range [0, 255]. Java 3D recognizes this and, in those cases where Tuple3b is used to represent color, treats the bytes as if the range were [0, 255]---in other words, as if the bytes were unsigned. Values greater than 127 can be assigned to a byte variable using a type cast. For example: If intValue is greater than 127, then byteVariable will be negative. The correct value will be extracted when it is used (by masking off the upper bits).

Field Summary

Modifier and TypeField and Description
pack-priv static final long
public byte
x

The first value.

public byte
y

The second value.

public byte
z

The third value.

Constructor Summary

AccessConstructor and Description
public
Tuple3b(byte
the first value
b1
,
byte
the second value
b2
,
byte
the third value
b3
)

Constructs and initializes a Tuple3b from the specified three values.

public
Tuple3b(byte[]
the array of length 3 containing b1 b2 b3 in order
t
)

Constructs and initializes a Tuple3b from input array of length 3.

public
Tuple3b(Tuple3b
the Tuple3b containing the initialization x y z data
t1
)

Constructs and initializes a Tuple3b from the specified Tuple3b.

public
Tuple3b()

Constructs and initializes a Tuple3b to (0,0,0).

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a clone of this instance.
clone
()

Overrides java.lang.Object.clone.

Creates a new object of the same class as this object.
public boolean

Returns:

true or false
equals
(Tuple3b
the tuple with which the comparison is made
t1
)

Returns true if all of the data members of tuple t1 are equal to the corresponding data members in this tuple.

public boolean
equals(Object
the object with which the comparison is made
t1
)

Overrides java.lang.Object.equals.

Returns true if the Object t1 is of type Tuple3b and all of the data members of t1 are equal to the corresponding data members in this Tuple3b.
public final void
get(byte[]
array of length 3 into which the component values are copied
t
)

Places the value of the x,y,z components of this Tuple3b into the array of length 3.

public final void
get(Tuple3b
the tuple into which the values are placed
t1
)

Places the value of the x,y,z components of this tuple into the tuple t1.

public final byte

Returns:

the first value.
getX
()

Get x, the first value.

public final byte

Returns:

the second value.
getY
()

Get y, the second value.

public final byte

Returns:

the third value.
getZ
()

Get z, the third value.

public int

Returns:

the integer hash code value
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value based on the data values in this object.
public final void
set(Tuple3b
the source tuple for the memberwise copy
t1
)

Sets the value of the data members of this tuple to the value of the argument tuple t1.

public final void
set(byte[]
array of length 3 which is the source for the memberwise copy
t
)

Sets the value of the x,y,z, data members of this tuple to the values in the array t of length 3.

public final void
setX(byte
the first value to set.
x
)

Set x, the first value.

public final void
setY(byte
the second value to set.
y
)

Set y, the second value.

public final void
setZ(byte
the third value to set.
z
)

Set z, the third value.

public String

Returns:

a String with the values
toString
()

Overrides java.lang.Object.toString.

Returns a string that contains the values of this Tuple3b.
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID
xback to summary
public byte x

The first value.

yback to summary
public byte y

The second value.

zback to summary
public byte z

The third value.

Constructor Detail

Tuple3bback to summary
public Tuple3b(byte b1, byte b2, byte b3)

Constructs and initializes a Tuple3b from the specified three values.

Parameters
b1:byte

the first value

b2:byte

the second value

b3:byte

the third value

Tuple3bback to summary
public Tuple3b(byte[] t)

Constructs and initializes a Tuple3b from input array of length 3.

Parameters
t:byte[]

the array of length 3 containing b1 b2 b3 in order

Tuple3bback to summary
public Tuple3b(Tuple3b t1)

Constructs and initializes a Tuple3b from the specified Tuple3b.

Parameters
t1:Tuple3b

the Tuple3b containing the initialization x y z data

Tuple3bback to summary
public Tuple3b()

Constructs and initializes a Tuple3b to (0,0,0).

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Creates a new object of the same class as this object.

Returns:Object

a clone of this instance.

Exceptions
OutOfMemoryError:
if there is not enough memory.
Since
vecmath 1.3
See Also
java.lang.Cloneable
equalsback to summary
public boolean equals(Tuple3b t1)

Returns true if all of the data members of tuple t1 are equal to the corresponding data members in this tuple.

Parameters
t1:Tuple3b

the tuple with which the comparison is made

Returns:boolean

true or false

equalsback to summary
public boolean equals(Object t1)

Overrides java.lang.Object.equals.

Returns true if the Object t1 is of type Tuple3b and all of the data members of t1 are equal to the corresponding data members in this Tuple3b.

Parameters
t1:Object

the object with which the comparison is made

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

getback to summary
public final void get(byte[] t)

Places the value of the x,y,z components of this Tuple3b into the array of length 3.

Parameters
t:byte[]

array of length 3 into which the component values are copied

getback to summary
public final void get(Tuple3b t1)

Places the value of the x,y,z components of this tuple into the tuple t1.

Parameters
t1:Tuple3b

the tuple into which the values are placed

getXback to summary
public final byte getX()

Get x, the first value.

Returns:byte

the first value.

Since
vecmath 1.5
getYback to summary
public final byte getY()

Get y, the second value.

Returns:byte

the second value.

Since
vecmath 1.5
getZback to summary
public final byte getZ()

Get z, the third value.

Returns:byte

the third value.

Since
vecmath 1.5
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value based on the data values in this object. Two different Tuple3b objects with identical data values (i.e., Tuple3b.equals returns true) will return the same hash code value. Two objects with different data members may return the same hash value, although this is not likely.

Returns:int

the integer hash code value

setback to summary
public final void set(Tuple3b t1)

Sets the value of the data members of this tuple to the value of the argument tuple t1.

Parameters
t1:Tuple3b

the source tuple for the memberwise copy

setback to summary
public final void set(byte[] t)

Sets the value of the x,y,z, data members of this tuple to the values in the array t of length 3.

Parameters
t:byte[]

array of length 3 which is the source for the memberwise copy

setXback to summary
public final void setX(byte x)

Set x, the first value.

Parameters
x:byte

the first value to set.

Since
vecmath 1.5
setYback to summary
public final void setY(byte y)

Set y, the second value.

Parameters
y:byte

the second value to set.

Since
vecmath 1.5
setZback to summary
public final void setZ(byte z)

Set z, the third value.

Parameters
z:byte

the third value to set.

Since
vecmath 1.5
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string that contains the values of this Tuple3b.

Returns:String

a String with the values