vrml.field
Class ConstMFColor

java.lang.Object
  extended by vrml.Field
      extended by vrml.ConstField
          extended by vrml.ConstMField
              extended by vrml.field.ConstMFColor
All Implemented Interfaces:
java.lang.Cloneable

public class ConstMFColor
extends ConstMField

Represents a read-only VRML MFColor field in Java.


Constructor Summary
ConstMFColor(float[] colors)
          Construct a read-only MFColor field.
ConstMFColor(float[][] colors)
          Construct a read-only MFColor field.
ConstMFColor(int size, float[] colors)
          Construct a read-only MFColor field.
 
Method Summary
 void get1Value(int index, float[] colors)
          Retrieves a specific SFColor element in an MFColor and returns it as a float array.
 void get1Value(int index, SFColor color)
          Retrieves a specific SFColor element in an MFColor and returns it as an SFColor object.
 int getSize()
          Number of elements contained in the MField.
 void getValue(float[] colors)
          Retrieves the value of an MFColor field.
 void getValue(float[][] colors)
          Retrieves the value of an MFColor field.
 
Methods inherited from class vrml.ConstField
clone
 
Methods inherited from class vrml.Field
dispose, finalize, getPeer, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstMFColor

public ConstMFColor(float[][] colors)
Construct a read-only MFColor field.

Parameters:
colors - An array of sets of three-float values (RGB)

ConstMFColor

public ConstMFColor(float[] colors)
Construct a read-only MFColor field.

Parameters:
colors - An array of RGB values.

ConstMFColor

public ConstMFColor(int size,
                    float[] colors)
Construct a read-only MFColor field.

Parameters:
size - Number of RGB value passed in array.
colors - Array of RGB values.
Method Detail

getSize

public int getSize()
Description copied from class: ConstMField
Number of elements contained in the MField.

Specified by:
getSize in class ConstMField
Returns:
the number of elements.

getValue

public void getValue(float[][] colors)
Retrieves the value of an MFColor field.

Parameters:
colors - 2D array of sets of RGB values to be returned.

getValue

public void getValue(float[] colors)
Retrieves the value of an MFColor field.

Parameters:
colors - Array of sets of RGB values to be returned.

get1Value

public void get1Value(int index,
                      float[] colors)
Retrieves a specific SFColor element in an MFColor and returns it as a float array.

Parameters:
index - Position of desired SFColor
colors - RGB value of specified SFColor.

get1Value

public void get1Value(int index,
                      SFColor color)
Retrieves a specific SFColor element in an MFColor and returns it as an SFColor object.

Parameters:
index - Position of desired SFColor
color - SFColor that will be set to desired value.