@Override
public void collect(Integer key, FrequentPatternMaxHeap value) throws IOException {
List<Pair<List<A>,Long>> perAttributePatterns = Lists.newArrayList();
PriorityQueue<Pattern> t = value.getHeap();
while (!t.isEmpty()) {
Pattern itemSet = t.poll();
List<A> frequentPattern = Lists.newArrayList();
for (int j = 0; j < itemSet.length(); j++) {
frequentPattern.add(reverseMapping.get(itemSet.getPattern()[j]));
}
Collections.sort(frequentPattern);
Pair<List<A>,Long> returnItemSet = new Pair<List<A>,Long>(frequentPattern, itemSet.support());
perAttributePatterns.add(returnItemSet);
}
Collections.reverse(perAttributePatterns);
collector.collect(reverseMapping.get(key), perAttributePatterns);