Top Description Fields Constructors Methods
javax.vecmath

public abstract Class Tuple4b

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

A four 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 Tuple4b 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
w

The fourth value.

public byte
x

The first value.

public byte
y

The second value.

public byte
z

The third value.

Constructor Summary

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

Constructs and initializes a Tuple4b from the specified four values.

public
Tuple4b(byte[]
the array of length 4 containing b1 b2 b3 b4 in order
t
)

Constructs and initializes a Tuple4b from the array of length 4.

public
Tuple4b(Tuple4b
the Tuple4b containing the initialization x y z w data
t1
)

Constructs and initializes a Tuple4b from the specified Tuple4b.

public
Tuple4b()

Constructs and initializes a Tuple4b to (0,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
equals(Tuple4b
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 Tuple4b and all of the data members of t1 are equal to the corresponding data members in this Tuple4b.
public final void
get(byte[]
array of length 4 into which the values are placed
b
)

Places the value of the x,y,z,w components of this Tuple4b into the array of length 4.

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

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

public final byte

Returns:

Returns w - the fourth value.
getW
()

Get w, the fourth value.

public final byte

Returns:

Returns x, the first value.
getX
()

Get x, the first value.

public final byte

Returns:

Returns y, the second value.
getY
()

Get y, the second value.

public final byte

Returns:

Returns z, 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(Tuple4b
the source tuple
t1
)

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

public final void
set(byte[]
the source array of length 4
b
)

Sets the value of the data members of this tuple to the value of the array b of length 4.

public final void
setW(byte
the fourth value.
w
)

Set w, the fourth value.

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

Set x, the first value.

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

Set y, the second value.

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

Set z, the third value.

public String

Returns:

the String representation
toString
()

Overrides java.lang.Object.toString.

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

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID
wback to summary
public byte w

The fourth value.

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

Tuple4bback to summary
public Tuple4b(byte b1, byte b2, byte b3, byte b4)

Constructs and initializes a Tuple4b from the specified four values.

Parameters
b1:byte

the first value

b2:byte

the second value

b3:byte

the third value

b4:byte

the fourth value

Tuple4bback to summary
public Tuple4b(byte[] t)

Constructs and initializes a Tuple4b from the array of length 4.

Parameters
t:byte[]

the array of length 4 containing b1 b2 b3 b4 in order

Tuple4bback to summary
public Tuple4b(Tuple4b t1)

Constructs and initializes a Tuple4b from the specified Tuple4b.

Parameters
t1:Tuple4b

the Tuple4b containing the initialization x y z w data

Tuple4bback to summary
public Tuple4b()

Constructs and initializes a Tuple4b to (0,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(Tuple4b t1)

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

Parameters
t1:Tuple4b

the tuple with which the comparison is made

equalsback to summary
public boolean equals(Object t1)

Overrides java.lang.Object.equals.

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

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[] b)

Places the value of the x,y,z,w components of this Tuple4b into the array of length 4.

Parameters
b:byte[]

array of length 4 into which the values are placed

getback to summary
public final void get(Tuple4b t1)

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

Parameters
t1:Tuple4b

tuple into which the values are placed

getWback to summary
public final byte getW()

Get w, the fourth value.

Returns:byte

Returns w - the fourth value.

Since
vecmath 1.5
getXback to summary
public final byte getX()

Get x, the first value.

Returns:byte

Returns x, the first value.

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

Get y, the second value.

Returns:byte

Returns y, the second value.

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

Get z, the third value.

Returns:byte

Returns z, 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 Tuple4b objects with identical data values (i.e., Tuple4b.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(Tuple4b t1)

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

Parameters
t1:Tuple4b

the source tuple

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

Sets the value of the data members of this tuple to the value of the array b of length 4.

Parameters
b:byte[]

the source array of length 4

setWback to summary
public final void setW(byte w)

Set w, the fourth value.

Parameters
w:byte

the fourth value.

Since
vecmath 1.5
setXback to summary
public final void setX(byte x)

Set x, the first value.

Parameters
x:byte

the first value.

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

Set y, the second value.

Parameters
y:byte

the second value.

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

Set z, the third value.

Parameters
z:byte

the third value.

Since
vecmath 1.5
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string that contains the values of this Tuple4b.

Returns:String

the String representation