private List<Field> createCollectionFields(HollowEffigy effigy) { List<Field> fields = new ArrayList<Field>(); HollowCollectionTypeDataAccess typeDataAccess = (HollowCollectionTypeDataAccess) effigy.dataAccess; HollowCollectionSchema schema = typeDataAccess.getSchema(); HollowOrdinalIterator iter = typeDataAccess.ordinalIterator(effigy.ordinal); int elementOrdinal = iter.next(); while(elementOrdinal != NO_MORE_ORDINALS) { HollowEffigy elementEffigy = effigy(typeDataAccess.getDataAccess(), schema.getElementType(), elementOrdinal); fields.add(new Field("element", elementEffigy)); elementOrdinal = iter.next(); } return fields; }
} else if(typeDataAccess instanceof HollowCollectionTypeDataAccess) { HollowCollectionTypeDataAccess collectionAccess = (HollowCollectionTypeDataAccess)typeDataAccess; childDataAccess = typeDataAccess.getDataAccess().getTypeDataAccess(collectionAccess.getSchema().getElementType()); for(int i=0;i<ordinals.size();i++) { HollowOrdinalIterator iter = collectionAccess.ordinalIterator(ordinals.get(i)); int childOrdinal = iter.next(); while(childOrdinal != HollowOrdinalIterator.NO_MORE_ORDINALS) {
@Override public int doTraversal(int ordinal) { if(child == null) return 1; HollowOrdinalIterator iter = dataAccess().ordinalIterator(ordinal); int numMatches = 0; int elementOrdinal = iter.next(); while(elementOrdinal != HollowOrdinalIterator.NO_MORE_ORDINALS) { prepareMultiply(); child.traverse(elementOrdinal); numMatches += doMultiply(); elementOrdinal = iter.next(); } return numMatches; }
String elementType = collectionSchema.getElementType(); HollowOrdinalIterator it = collectionTypeDataAccess.ordinalIterator(ordinal); List<Object> valueList = new ArrayList<>(); int refOrdinal = it.next();
String elementType = collectionSchema.getElementType(); HollowOrdinalIterator it = collectionTypeDataAccess.ordinalIterator(ordinal); int refOrdinal = it.next(); if (refOrdinal != HollowOrdinalIterator.NO_MORE_ORDINALS) {