Keywords: DeveloppersGuide

## New sodium equivalence formula

1) Create a new class (in the melting.ionCorrection.sodiumEquivalence package) which implements the SodiumEquivalenceMethod interface or, if it is adapted, which extends the SodiumEquivalent class in the melting.ionCorrection.sodiumEquivalence package.
If you just implement the SodiumEquivalenceMethod interface, you have to implement the public methods double computeSodiumEquivalent(double Na, double Mg, double K, double Tris, double dNTP) and boolean isApplicable(HashMap<String, String> options).
The first is important to compute a sodium equivalence depending on the ions entered by the user. The second method is important to define the conditions of application of the sodium equivalent formula.

The SodiumEquivalent is a base implementation for sodium equivalence computation If you extend SodiumEquivalent, you have to override the public method boolean isApplicable(HashMap<String, String> options) to define the conditions of application of the sodium equivalence. The public method double computeSodiumEquivalent(double Na, double Mg, double K, double Tris, double dNTP) has to be implemented to compute the sodium equivalence.

2) Register the sodium equivalence name and the class which represents it in the RegisterMethods class (melting.configuration package). You have to add into the function private void initialiseNaEqMethods() of RegisterMethods this following line :

    private void initialiseNaEqMethods(){
    		[...]

    		NaEqMethod.put("sodiumEquivalence-Name", Class-Name.class);
    	}

3) Don't forget to add a private static String instance variable in your class. This String represents the correction formula you used to compute the sodium equivalent concentration and must be printed if the verbose mode is required by the user.

    // Create a private static String which represents the
    // sodium equivalence formula.
    private static String equivalenceFormula = "formula";

    [...]

    // To print the article reference of the sodium equivalence
    // formula if the verbose mode is required.
    OptionManagement.meltingLogger.log(Level.FINE, "article
                                    reference of the formula");

    // To print the correction formula (the private static String)
    OptionManagement.meltingLogger.log(Level.FINE,
                                          equivalenceFormula);

    [...]
    }