// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/Splash.java
// public interface Splash {
// 
//     /**
//      * generates a new spectra hash based on the given spectrum
//      * @return
//      */
//     String splashIt(Spectrum spectrum);
// 
//     /**
//      * adds an optional listener to the
//      * @param listener
//      */
//     void addListener(SplashListener listener);
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/SplashFactory.java
// public class SplashFactory {
// 
//     public static Splash create() {
//         return createVersion1Splash();
//     }
// 
//     /**
//      * the first official splash release
//      *
//      * @return
//      */
//     public static Splash createVersion1Splash() {
//         return new SplashVersion1();
//     }
// 
// }
// 
// 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/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;
//     }
// }


import edu.ucdavis.fiehnlab.spectra.hash.core.Splash;
import edu.ucdavis.fiehnlab.spectra.hash.core.SplashFactory;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashListener;
import edu.ucdavis.fiehnlab.spectra.hash.core.types.SpectraType;
package edu.ucdavis.fiehnlab.spectra.hash.core.util;



/**
 * a simple splash util, to ease the splashing of data
 */
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
     */
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/Splash.java
// public interface Splash {
// 
//     /**
//      * generates a new spectra hash based on the given spectrum
//      * @return
//      */
//     String splashIt(Spectrum spectrum);
// 
//     /**
//      * adds an optional listener to the
//      * @param listener
//      */
//     void addListener(SplashListener listener);
// }
// 
// Path: core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/SplashFactory.java
// public class SplashFactory {
// 
//     public static Splash create() {
//         return createVersion1Splash();
//     }
// 
//     /**
//      * the first official splash release
//      *
//      * @return
//      */
//     public static Splash createVersion1Splash() {
//         return new SplashVersion1();
//     }
// 
// }
// 
// 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/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
import edu.ucdavis.fiehnlab.spectra.hash.core.Splash;
import edu.ucdavis.fiehnlab.spectra.hash.core.SplashFactory;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashListener;
import edu.ucdavis.fiehnlab.spectra.hash.core.types.SpectraType;

package edu.ucdavis.fiehnlab.spectra.hash.core.util;



/**
 * a simple splash util, to ease the splashing of data
 */
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) {