public void set(int index, float value) {
        switch (index) {
            case 0:
                x = value;
                return;
            case 1:
                y = value;
                return;
            case 2:
                z = value;
                return;
            case 3:
                w = value;
                return;
        }
        throw new IllegalArgumentException("index must be either 0, 1, 2 or 3");
    }
@param index
           which field index in this vector to set.
@param value
           to set to one of x, y, z or w.
@throws IllegalArgumentException
            if index is not one of 0, 1, 2, 3.
jme3-core/src/main/java/com/jme3/math/Vector4f.java