public void set(int index, float value) {
        switch (index) {
            case 0:
                x = value;
                return;
            case 1:
                y = value;
                return;
            case 2:
                z = value;
                return;
        }
        throw new IllegalArgumentException("index must be either 0, 1 or 2");
    }
Sets the indexed component.

@param index which component to set: 0 &rarr; the X component, 1 &rarr;
    the Y component, 2 &rarr; the Z component
@param value the desired component value
@throws IllegalArgumentException if index is not 0, 1, or 2
jme3-core/src/main/java/com/jme3/math/Vector3f.java