setComponent method
Implementation
Vector4 setComponent(int index, num value) {
switch (index) {
case 0:
x = value;
break;
case 1:
y = value;
break;
case 2:
z = value;
break;
case 3:
w = value;
break;
default:
throw ('index is out of range: $index');
}
return this;
}