public float get(int index) {
        switch (index) {
            case 0:
                return x;
            case 1:
                return y;
            case 2:
                return z;
        }
        throw new IllegalArgumentException("index must be either 0, 1 or 2");
    }
Returns the indexed component. The vector is unaffected.

@param index 0, 1, or 2
@return the X component if index=0, the Y component if index=1, or the Z
    component if index=2
@throws IllegalArgumentException if index is not 0, 1, or 2
jme3-core/src/main/java/com/jme3/math/Vector3f.java