@Override
public void collect(Integer key, FrequentPatternMaxHeap value) throws IOException {
List<Pair<List<A>,Long>> perAttributePatterns = new ArrayList<Pair<List<A>,Long>>();
PriorityQueue<Pattern> t = value.getHeap();
while (!t.isEmpty()) {
Pattern itemSet = t.poll();
List<A> frequentPattern = new ArrayList<A>();
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);