public double getJointAngle(HandJointName jointName) { double[] source; switch (jointName.getFinger(robotSide)) { case INDEX : source = indexJoints; break; case MIDDLE : source = middleJoints; break; default : source = thumbJoints; } int index = jointName.getHandJointAngleIndex(); if (index == -1) { return 0; } return source[index]; }