}
// Iterate over FSs, filter and create output.
FSIterator iterator = cas.getAnnotationIndex(type).iterator();
for (; iterator.isValid(); iterator.moveToNext()) {
AnnotationFS annotation = (AnnotationFS) iterator.get();
Filter filter = tspec.getFilter();
// Check that there either is no filter, or the FS passes the filter.
if ((filter == null) || filter.match(annotation)) {
// Create a new result entry, fill with attributes and add result set.
ResultEntryImpl resultEntry = new ResultEntryImpl(tspec.getOutputTag(), annotation
.getBegin(), annotation.getEnd());
makeOutputs(resultEntry, annotation, tspec);
resultEntries.add(resultEntry);