use of ceylon.language.serialization.Member in project ceylon by eclipse.
the class Array method $set$.
@Ignore
@Override
public void $set$(ReachableReference reference, java.lang.Object instance) {
if (reference instanceof Member && getArraySize().equals(((Member) reference).getAttribute())) {
int size = toSize(((ceylon.language.Integer) instance).value);
try {
Lookup lookup = MethodHandles.lookup();
Util.setter(lookup, "size").invokeExact(this, size);
java.lang.Object array = createArrayWithElement($reifiedElement, size, null);
Util.setter(lookup, "array").invokeExact(this, array);
if (elementType.fieldName != null) {
MethodHandle fieldSetter = Util.setter(lookup, elementType.fieldName);
switch(elementType) {
case CeylonInteger:
fieldSetter.invokeExact(this, (long[]) array);
break;
case CeylonFloat:
fieldSetter.invokeExact(this, (double[]) array);
break;
case CeylonCharacter:
fieldSetter.invokeExact(this, (int[]) array);
break;
case CeylonByte:
fieldSetter.invokeExact(this, (byte[]) array);
break;
case CeylonBoolean:
fieldSetter.invokeExact(this, (boolean[]) array);
break;
case CeylonString:
fieldSetter.invokeExact(this, (java.lang.String[]) array);
break;
case Other:
fieldSetter.invokeExact(this, (java.lang.Object[]) array);
break;
default:
fieldSetter.invoke(this, array);
break;
}
}
} catch (java.lang.Throwable t) {
rethrow_.rethrow(t);
}
} else {
ceylon.language.serialization.Element index = (ceylon.language.serialization.Element) reference;
set(index.getIndex(), (Element) instance);
}
}
Aggregations