use of org.apache.asterix.om.base.AOrderedList in project asterixdb by apache.
the class AOrderedListSerializerDeserializer method deserialize.
@Override
public AOrderedList deserialize(DataInput in) throws HyracksDataException {
try {
ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(in.readByte());
IAType currentItemType = itemType;
@SuppressWarnings("rawtypes") ISerializerDeserializer currentDeserializer = deserializer;
if (itemType.getTypeTag() == ATypeTag.ANY && typeTag != ATypeTag.ANY) {
currentItemType = TypeTagUtil.getBuiltinTypeByTag(typeTag);
currentDeserializer = SerializerDeserializerProvider.INSTANCE.getNonTaggedSerializerDeserializer(currentItemType);
}
List<IAObject> items = new ArrayList<IAObject>();
// list size
in.readInt();
int numberOfitems;
numberOfitems = in.readInt();
if (numberOfitems > 0) {
if (!NonTaggedFormatUtil.isFixedSizedCollection(currentItemType)) {
for (int i = 0; i < numberOfitems; i++) in.readInt();
}
for (int i = 0; i < numberOfitems; i++) {
IAObject v = (IAObject) currentDeserializer.deserialize(in);
items.add(v);
}
}
AOrderedListType type = new AOrderedListType(currentItemType, "orderedlist");
return new AOrderedList(type, items);
} catch (Exception e) {
throw new HyracksDataException(e);
}
}
Aggregations