Input input = node.getInput();
int channel = input.getChannel();
if (context instanceof BlockCursor[]) {
BlockCursor[] inputs = (BlockCursor[]) context;
BlockCursor cursor = inputs[channel];
if (cursor.isNull()) {
return null;
}
Class<?> javaType = cursor.getType().getJavaType();
if (javaType == boolean.class) {
return cursor.getBoolean();
}
else if (javaType == long.class) {
return cursor.getLong();
}
else if (javaType == double.class) {
return cursor.getDouble();
}
else if (javaType == Slice.class) {
return cursor.getSlice();
}
else {
throw new UnsupportedOperationException("not yet implemented");
}
}
else if (context instanceof RecordCursor) {
RecordCursor cursor = (RecordCursor) context;
if (cursor.isNull(channel)) {
return null;
}
Class<?> javaType = cursor.getType(input.getChannel()).getJavaType();
if (javaType == boolean.class) {
return cursor.getBoolean(channel);
}
else if (javaType == long.class) {
return cursor.getLong(channel);
}
else if (javaType == double.class) {
return cursor.getDouble(channel);
}
else if (javaType == Slice.class) {
return cursor.getSlice(channel);
}
else {
throw new UnsupportedOperationException("not yet implemented");
}
}