/** * Constructor for the IsotopePatternRule object. */ public IsotopePatternRule() { isotopeGe = new IsotopePatternGenerator(0.01); is = new IsotopePatternSimilarity(); is.seTolerance(toleranceMass); }
/** * A unit test suite for JUnit. * * @return The test suite */ @Test public void testSeTolerance_double() { IsotopePatternSimilarity is = new IsotopePatternSimilarity(); is.seTolerance(0.001); Assert.assertNotNull(is); }
/** * Sets the parameters attribute of the IsotopePatternRule object. * * @param params The new parameters value * @throws CDKException Description of the Exception * * @see #getParameters */ @Override public void setParameters(Object[] params) throws CDKException { if (params.length != 2) throw new CDKException("IsotopePatternRule expects two parameter"); if (!(params[0] instanceof List)) throw new CDKException("The parameter one must be of type List<Double[]>"); if (!(params[1] instanceof Double)) throw new CDKException("The parameter two must be of type Double"); pattern = new IsotopePattern(); for (double[] listISO : (List<double[]>) params[0]) { pattern.addIsotope(new IsotopeContainer(listISO[0], listISO[1])); } is.seTolerance((Double) params[1]); }
/** * A unit test suite for JUnit. * * @return The test suite */ @Test public void testGetTolerance() { IsotopePatternSimilarity is = new IsotopePatternSimilarity(); is.seTolerance(0.001); Assert.assertEquals(0.001, is.getTolerance(), 0.000001); }