// Path: uk/ac/bbsrc/babraham/FastQC/Modules/QCModule.java
// public interface QCModule {
// 
// 	public void processSequence(Sequence sequence);
// 
// 	public JPanel getResultsPanel();
// 	
// 	public String name ();
// 	
// 	public String description ();
// 	
// 	public void reset ();
// 	
// 	public boolean raisesError();
// 	
// 	public boolean raisesWarning();
// 	
// 	public boolean ignoreFilteredSequences();
// 
// 	public void makeReport(HTMLReportArchive report) throws IOException;
// 	
// 	
// }
// 
// Path: uk/ac/bbsrc/babraham/FastQC/Sequence/Sequence.java
// public class Sequence {
// 
// 	private String sequence;
// 	private String quality;
// 	private String id;
// 	private SequenceFile file;
// 	private String colorspace;
// 	private boolean isFiltered;
// 	
// 	public Sequence (SequenceFile file,String sequence, String quality, String id) {
// 		this.id = id;
// 		this.file = file;
// 		this.sequence = sequence.toUpperCase();
// 		this.quality = quality;
// 		this.colorspace = null;
// 		this.isFiltered = false;
// 	}
// 	
// 	public Sequence (SequenceFile file,String sequence, String colorspace, String quality, String id) {
// 		this.id = id;
// 		this.file = file;
// 		this.sequence = sequence;
// 		this.quality = quality;
// 		this.colorspace = colorspace;
// 	}
// 	
// 	public void setIsFiltered (boolean isFiltered) {
// 		this.isFiltered = isFiltered;
// 	}
// 	
// 	public boolean isFiltered () {
// 		return isFiltered;
// 	}
// 	
// 	public SequenceFile file () {
// 		return file;
// 	}
// 	
// 	public String getSequence () {
// 		return sequence;
// 	}
// 	
// 	public String getColorspace () {
// 		return colorspace;
// 	}
// 	
// 	public String getQualityString () {
// 		return quality;
// 	}
// 	
// 	public String getID () {
// 		return id;
// 	}
// 	
// }
// 
// Path: uk/ac/bbsrc/babraham/FastQC/Sequence/SequenceFile.java
// public interface SequenceFile {
// 
// 	public boolean hasNext();
// 	public Sequence next() throws SequenceFormatException;
// 	public boolean isColorspace();
// 	public String name();
// 	public int getPercentComplete();
// 	public File getFile();
// 	
// }
// 
// Path: uk/ac/bbsrc/babraham/FastQC/Sequence/SequenceFormatException.java
// public class SequenceFormatException extends Exception {
// 	
// 	public SequenceFormatException (String message) {
// 		super(message);
// 	}
// 
// }


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import uk.ac.bbsrc.babraham.FastQC.Modules.QCModule;
import uk.ac.bbsrc.babraham.FastQC.Sequence.Sequence;
import uk.ac.bbsrc.babraham.FastQC.Sequence.SequenceFile;
import uk.ac.bbsrc.babraham.FastQC.Sequence.SequenceFormatException;

			listeners.add(l);
		}
	}

	public void removeAnalysisListener (AnalysisListener l) {
		if (l != null && listeners.contains(l)) {
			listeners.remove(l);
		}
	}

	
	public void startAnalysis (QCModule [] modules) {
		this.modules = modules;
		for (int i=0;i<modules.length;i++) {
			modules[i].reset();
		}
		AnalysisQueue.getInstance().addToQueue(this);
	}

	public void run() {

		Iterator<AnalysisListener> i = listeners.iterator();
		while (i.hasNext()) {
			i.next().analysisStarted(file);
		}

		
		int seqCount = 0;
		while (file.hasNext()) {
			++seqCount;

// Path: uk/ac/bbsrc/babraham/FastQC/Modules/QCModule.java
// public interface QCModule {
// 
// 	public void processSequence(Sequence sequence);
// 
// 	public JPanel getResultsPanel();
// 	
// 	public String name ();
// 	
// 	public String description ();
// 	
// 	public void reset ();
// 	
// 	public boolean raisesError();
// 	
// 	public boolean raisesWarning();
// 	
// 	public boolean ignoreFilteredSequences();
// 
// 	public void makeReport(HTMLReportArchive report) throws IOException;
// 	
// 	
// }
// 
// Path: uk/ac/bbsrc/babraham/FastQC/Sequence/Sequence.java
// public class Sequence {
// 
// 	private String sequence;
// 	private String quality;
// 	private String id;
// 	private SequenceFile file;
// 	private String colorspace;
// 	private boolean isFiltered;
// 	
// 	public Sequence (SequenceFile file,String sequence, String quality, String id) {
// 		this.id = id;
// 		this.file = file;
// 		this.sequence = sequence.toUpperCase();
// 		this.quality = quality;
// 		this.colorspace = null;
// 		this.isFiltered = false;
// 	}
// 	
// 	public Sequence (SequenceFile file,String sequence, String colorspace, String quality, String id) {
// 		this.id = id;
// 		this.file = file;
// 		this.sequence = sequence;
// 		this.quality = quality;
// 		this.colorspace = colorspace;
// 	}
// 	
// 	public void setIsFiltered (boolean isFiltered) {
// 		this.isFiltered = isFiltered;
// 	}
// 	
// 	public boolean isFiltered () {
// 		return isFiltered;
// 	}
// 	
// 	public SequenceFile file () {
// 		return file;
// 	}
// 	
// 	public String getSequence () {
// 		return sequence;
// 	}
// 	
// 	public String getColorspace () {
// 		return colorspace;
// 	}
// 	
// 	public String getQualityString () {
// 		return quality;
// 	}
// 	
// 	public String getID () {
// 		return id;
// 	}
// 	
// }
// 
// Path: uk/ac/bbsrc/babraham/FastQC/Sequence/SequenceFile.java
// public interface SequenceFile {
// 
// 	public boolean hasNext();
// 	public Sequence next() throws SequenceFormatException;
// 	public boolean isColorspace();
// 	public String name();
// 	public int getPercentComplete();
// 	public File getFile();
// 	
// }
// 
// Path: uk/ac/bbsrc/babraham/FastQC/Sequence/SequenceFormatException.java
// public class SequenceFormatException extends Exception {
// 	
// 	public SequenceFormatException (String message) {
// 		super(message);
// 	}
// 
// }


// Path: uk/ac/bbsrc/babraham/FastQC/Analysis/AnalysisRunner.java
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import uk.ac.bbsrc.babraham.FastQC.Modules.QCModule;
import uk.ac.bbsrc.babraham.FastQC.Sequence.Sequence;
import uk.ac.bbsrc.babraham.FastQC.Sequence.SequenceFile;
import uk.ac.bbsrc.babraham.FastQC.Sequence.SequenceFormatException;

			listeners.add(l);
		}
	}

	public void removeAnalysisListener (AnalysisListener l) {
		if (l != null && listeners.contains(l)) {
			listeners.remove(l);
		}
	}

	
	public void startAnalysis (QCModule [] modules) {
		this.modules = modules;
		for (int i=0;i<modules.length;i++) {
			modules[i].reset();
		}
		AnalysisQueue.getInstance().addToQueue(this);
	}

	public void run() {

		Iterator<AnalysisListener> i = listeners.iterator();
		while (i.hasNext()) {
			i.next().analysisStarted(file);
		}

		
		int seqCount = 0;
		while (file.hasNext()) {
			++seqCount;

			Sequence seq;
