// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/Spectrum.java
// public interface Spectrum {
// 
//     /**
//      * ion of a spectra
//      * @return
//      */
//     public List<Ion> getIons();
// 
//     /**
//      * convmerts the spectrum to a relative spectra
//      * @return
//      * @param scale
//      */
//     Spectrum toRelative(int scale);
// 
//     /**
//      *
//      * @return
//      */
//     String getOrigin();
// 
//     /**
//      * what kind of a spectra do we have
//      * @return
//      */
//     public SpectraType getType();
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/listener/SplashListener.java
// public interface SplashListener {
// 
//     /**
//      * let's listener know that a new hash was created
//      * @param e
//      */
//     void eventReceived(SplashingEvent e);
// 
//     /**
//      * notificaton that the hashing is finished
//      * @param spectrum
//      * @param splash
//      */
//     void complete(Spectrum spectrum, String splash);
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/listener/SplashingEvent.java
// public class SplashingEvent {
// 
//     private final Spectrum spectrum;
//     private final String processedValue;
// 
//     public SplashingEvent(String processedValue, String rawValue, SplashBlock block, Spectrum spectrum) {
//         this.processedValue = processedValue;
//         this.rawValue = rawValue;
//         this.block = block;
//         this.spectrum = spectrum;
//     }
// 
//     private final String rawValue;
// 
//     public SplashBlock getBlock() {
//         return block;
//     }
// 
// 
//     public String getRawValue() {
//         return rawValue;
//     }
// 
//     public String getProcessedValue() {
//         return processedValue;
//     }
// 
//     private final SplashBlock block;
// 
// 
//     public Spectrum getSpectrum() {
//         return spectrum;
//     }
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/types/SpectraType.java
// public enum SpectraType {
//     MS('1'),
//     NMR('2'),
//     UV('3'),
//     IR('4'),
//     RAMAN('5');
// 
//     /**
//      * identifier has to be a single character
//      */
//     private final char identifier;
// 
//     /**
//      * creates a new spectra type with the assoicated reference number
//      *
//      * @param referenceNumber
//      */
//     SpectraType(char referenceNumber) {
//         this.identifier = referenceNumber;
//     }
// 
//     /**
//      * access to it's identifier
//      *
//      * @return
//      */
//     public char getIdentifier() {
//         return this.identifier;
//     }
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/util/SplashUtil.java
// public class SplashUtil {
// 
//     /**
//      * quick splashing of the latest splash implementation
//      *
//      * @param spectra
//      * @param type
//      * @return
//      */
//     public static String splash(String spectra, SpectraType type) {
// 
//         Splash s = SplashFactory.create();
// 
//         return s.splashIt(SpectraUtil.convertStringToSpectrum(spectra, type));
//     }
// 
//     /**
//      * allows you to add a listener to see what is happening
//      * @param spectra
//      * @param type
//      * @param listener
//      * @return
//      */
//     public static String splash(String spectra, SpectraType type,SplashListener listener) {
// 
//         Splash s = SplashFactory.create();
//         s.addListener(listener);
// 
//         return s.splashIt(SpectraUtil.convertStringToSpectrum(spectra, type));
//     }
// 
// }


import edu.ucdavis.fiehnlab.spectra.hash.core.Spectrum;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashListener;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashingEvent;
import edu.ucdavis.fiehnlab.spectra.hash.core.types.SpectraType;
import edu.ucdavis.fiehnlab.spectra.hash.core.util.SplashUtil;
import edu.ucdavis.fiehnlab.spectra.hash.core.validation.serialize.*;
import org.apache.commons.cli.*;
import org.apache.log4j.Logger;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Controller;
import java.io.*;
import java.util.Scanner;
        options.addOption("o", "origin", true, "which column contains the origin information");

        options.addOption("D", "duplicates", false, "only output discovered duplicates, careful it can be slow!");
        options.addOption("S", "sort", false, "sorts the output by given column. Columns can be 'splash' or 'origin' or 'spectra', careful it can be slow!");
        options.addOption("SD", "sortDirectory", true, "specify which directory should be used for temporary data, during sorting or duplicate searches");

        options.addOption("X", "debug", false, "displays additional debug information, cut to 50 char for strings");
        options.addOption("XX", "debugExact", false, "displays additional debug information, complete printout");
        options.addOption("XXX", "debugExtraFine", false, "displays even more debug information");

        options.addOption("c", "create", false, "computes a validation file with the default splash implementation, instead of validation the file");
        options.addOption("v", "validate", false, "validates a provided validation file, if not specified this is the default option");

        options.addOption("t", "type", true, "what kind of spectra type is it, options is MS | IR | UV | NMR | RAMAN");


        options.addOption("T", "separator", true, "what is the separator between columns");
        options.addOption("O", "output", false, "output will be system out, instead of a file");
        options.addOption("I", "ignoreErrors", false, "errors in spectra, will be ignored, but displayed");
        options.addOption("IS", "ignoreErrorsSuppressed", false, "errors in spectra, will be ignored and not shown");
        options.addOption("L", "longFormat", false, "utilizes the long serialization format");


        return options;
    }


    /**
     * a simple listener for debug purposes
     */
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/Spectrum.java
// public interface Spectrum {
// 
//     /**
//      * ion of a spectra
//      * @return
//      */
//     public List<Ion> getIons();
// 
//     /**
//      * convmerts the spectrum to a relative spectra
//      * @return
//      * @param scale
//      */
//     Spectrum toRelative(int scale);
// 
//     /**
//      *
//      * @return
//      */
//     String getOrigin();
// 
//     /**
//      * what kind of a spectra do we have
//      * @return
//      */
//     public SpectraType getType();
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/listener/SplashListener.java
// public interface SplashListener {
// 
//     /**
//      * let's listener know that a new hash was created
//      * @param e
//      */
//     void eventReceived(SplashingEvent e);
// 
//     /**
//      * notificaton that the hashing is finished
//      * @param spectrum
//      * @param splash
//      */
//     void complete(Spectrum spectrum, String splash);
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/listener/SplashingEvent.java
// public class SplashingEvent {
// 
//     private final Spectrum spectrum;
//     private final String processedValue;
// 
//     public SplashingEvent(String processedValue, String rawValue, SplashBlock block, Spectrum spectrum) {
//         this.processedValue = processedValue;
//         this.rawValue = rawValue;
//         this.block = block;
//         this.spectrum = spectrum;
//     }
// 
//     private final String rawValue;
// 
//     public SplashBlock getBlock() {
//         return block;
//     }
// 
// 
//     public String getRawValue() {
//         return rawValue;
//     }
// 
//     public String getProcessedValue() {
//         return processedValue;
//     }
// 
//     private final SplashBlock block;
// 
// 
//     public Spectrum getSpectrum() {
//         return spectrum;
//     }
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/types/SpectraType.java
// public enum SpectraType {
//     MS('1'),
//     NMR('2'),
//     UV('3'),
//     IR('4'),
//     RAMAN('5');
// 
//     /**
//      * identifier has to be a single character
//      */
//     private final char identifier;
// 
//     /**
//      * creates a new spectra type with the assoicated reference number
//      *
//      * @param referenceNumber
//      */
//     SpectraType(char referenceNumber) {
//         this.identifier = referenceNumber;
//     }
// 
//     /**
//      * access to it's identifier
//      *
//      * @return
//      */
//     public char getIdentifier() {
//         return this.identifier;
//     }
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/util/SplashUtil.java
// public class SplashUtil {
// 
//     /**
//      * quick splashing of the latest splash implementation
//      *
//      * @param spectra
//      * @param type
//      * @return
//      */
//     public static String splash(String spectra, SpectraType type) {
// 
//         Splash s = SplashFactory.create();
// 
//         return s.splashIt(SpectraUtil.convertStringToSpectrum(spectra, type));
//     }
// 
//     /**
//      * allows you to add a listener to see what is happening
//      * @param spectra
//      * @param type
//      * @param listener
//      * @return
//      */
//     public static String splash(String spectra, SpectraType type,SplashListener listener) {
// 
//         Splash s = SplashFactory.create();
//         s.addListener(listener);
// 
//         return s.splashIt(SpectraUtil.convertStringToSpectrum(spectra, type));
//     }
// 
// }


// Path: validation/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/validation/controller/ValidationController.java
import edu.ucdavis.fiehnlab.spectra.hash.core.Spectrum;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashListener;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashingEvent;
import edu.ucdavis.fiehnlab.spectra.hash.core.types.SpectraType;
import edu.ucdavis.fiehnlab.spectra.hash.core.util.SplashUtil;
import edu.ucdavis.fiehnlab.spectra.hash.core.validation.serialize.*;
import org.apache.commons.cli.*;
import org.apache.log4j.Logger;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Controller;
import java.io.*;
import java.util.Scanner;

        options.addOption("o", "origin", true, "which column contains the origin information");

        options.addOption("D", "duplicates", false, "only output discovered duplicates, careful it can be slow!");
        options.addOption("S", "sort", false, "sorts the output by given column. Columns can be 'splash' or 'origin' or 'spectra', careful it can be slow!");
        options.addOption("SD", "sortDirectory", true, "specify which directory should be used for temporary data, during sorting or duplicate searches");

        options.addOption("X", "debug", false, "displays additional debug information, cut to 50 char for strings");
        options.addOption("XX", "debugExact", false, "displays additional debug information, complete printout");
        options.addOption("XXX", "debugExtraFine", false, "displays even more debug information");

        options.addOption("c", "create", false, "computes a validation file with the default splash implementation, instead of validation the file");
        options.addOption("v", "validate", false, "validates a provided validation file, if not specified this is the default option");

        options.addOption("t", "type", true, "what kind of spectra type is it, options is MS | IR | UV | NMR | RAMAN");


        options.addOption("T", "separator", true, "what is the separator between columns");
        options.addOption("O", "output", false, "output will be system out, instead of a file");
        options.addOption("I", "ignoreErrors", false, "errors in spectra, will be ignored, but displayed");
        options.addOption("IS", "ignoreErrorsSuppressed", false, "errors in spectra, will be ignored and not shown");
        options.addOption("L", "longFormat", false, "utilizes the long serialization format");


        return options;
    }


    /**
     * a simple listener for debug purposes
     */
    class Listener implements SplashListener {