// Path: src/main/java/de/mpii/gsm/writer/GsmWriter.java
// public interface GsmWriter {
// 	void write(int[] sequence, long count) throws IOException, InterruptedException;
// }
// 
// Path: src/main/java/de/mpii/gsm/utils/IntArrayStrategy.java
// public final class IntArrayStrategy implements Strategy<int[]> {  
// 
// 	
// 	 @Override
//      public boolean equals(int[] o1, int[] o2) {
//              return Arrays.equals(o1,  o2);
//      }
// 
//      @Override
//      public int hashCode(int[] o) {
//              return Arrays.hashCode(o);
//      }
// 
// 	
// }


import de.mpii.gsm.taxonomy.*;
import de.mpii.gsm.writer.GsmWriter;
import de.mpii.gsm.utils.IntArrayStrategy;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.bytes.ByteArrayList;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
				// uncomment next line to save some space during 1st phase (but:
				// increased runtime)
				// postingList.trimToSize();
				id++; // next id
			} else {
				// delete the current sequence (by moving the last sequence to the
				// current position)
				int size1 = kPostingLists.size() - 1;
				if (id < size1) {
					kSequences.set(id, kSequences.remove(size1));
					kPostingLists.set(id, kPostingLists.remove(size1));
					kTotalSupports.set(id, kTotalSupports.get(size1));
          kTotalSupports.remove(size1);
				} else {
					kSequences.remove(size1);
					kPostingLists.remove(size1);
					kTotalSupports.remove(size1);
				}
				// same id again (now holding a different kSequence)
			}
		}
	}

	public int noOfPatterns() {
		return noOfPatterns_;
	}

	// -- mining phase
	// ------------------------------------------------------------------------------

// Path: src/main/java/de/mpii/gsm/writer/GsmWriter.java
// public interface GsmWriter {
// 	void write(int[] sequence, long count) throws IOException, InterruptedException;
// }
// 
// Path: src/main/java/de/mpii/gsm/utils/IntArrayStrategy.java
// public final class IntArrayStrategy implements Strategy<int[]> {  
// 
// 	
// 	 @Override
//      public boolean equals(int[] o1, int[] o2) {
//              return Arrays.equals(o1,  o2);
//      }
// 
//      @Override
//      public int hashCode(int[] o) {
//              return Arrays.hashCode(o);
//      }
// 
// 	
// }


// Path: src/main/java/de/mpii/gsm/localmining/Bfs.java
import de.mpii.gsm.taxonomy.*;
import de.mpii.gsm.writer.GsmWriter;
import de.mpii.gsm.utils.IntArrayStrategy;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.bytes.ByteArrayList;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;

				// uncomment next line to save some space during 1st phase (but:
				// increased runtime)
				// postingList.trimToSize();
				id++; // next id
			} else {
				// delete the current sequence (by moving the last sequence to the
				// current position)
				int size1 = kPostingLists.size() - 1;
				if (id < size1) {
					kSequences.set(id, kSequences.remove(size1));
					kPostingLists.set(id, kPostingLists.remove(size1));
					kTotalSupports.set(id, kTotalSupports.get(size1));
          kTotalSupports.remove(size1);
				} else {
					kSequences.remove(size1);
					kPostingLists.remove(size1);
					kTotalSupports.remove(size1);
				}
				// same id again (now holding a different kSequence)
			}
		}
	}

	public int noOfPatterns() {
		return noOfPatterns_;
	}

	// -- mining phase
	// ------------------------------------------------------------------------------

	public void mineAndClear(GsmWriter writer) throws IOException, InterruptedException {