//create new feature collections
List<FeatureCollectionType> members = new ArrayList(features.size());
for (Iterator<FeatureCollection> it = features.iterator(); it.hasNext(); ) {
FeatureCollection featureCollection = it.next();
FeatureCollectionType member = Wfs20Factory.eINSTANCE.createFeatureCollectionType();
member.setTimeStamp((Calendar) EMFUtils.get(fc, "timeStamp"));
member.getMember().add(featureCollection);
members.add(member);
if (numberMatched == -1) {
continue;
}
//TODO: calling size() here is bad because it requires a nother trip to the
//underlying datastore... perhaps try to keep count of the size of each feature
// collection at a higher level
int size = featureCollection.size();
member.setNumberReturned(BigInteger.valueOf(size));
if (it.hasNext()) {
numberMatched -= size;
member.setNumberMatched(BigInteger.valueOf(size));
}
else {
member.setNumberMatched(BigInteger.valueOf(numberMatched));
}
}
return members;
}