/** * Returns a placeholder with the descriptor size and type. */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerArrayResult(NAMES.length); }
/** * Returns a placeholder with the descriptor size and type. */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerArrayResult(NAMES.length); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerArrayResult(20); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerArrayResult(20); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerArrayResult(SMARTS.length); }
/** * Returns the specific type of the DescriptorResult object. * * The return value from this method really indicates what type of result will * be obtained from the {@link org.openscience.cdk.qsar.DescriptorValue} object. Note that the same result * can be achieved by interrogating the {@link org.openscience.cdk.qsar.DescriptorValue} object; this method * allows you to do the same thing, without actually calculating the descriptor. * * @return an object that implements the {@link org.openscience.cdk.qsar.result.IDescriptorResult} interface indicating * the actual type of values returned by the descriptor in the {@link org.openscience.cdk.qsar.DescriptorValue} object */ @Override public IDescriptorResult getDescriptorResultType() { return new IntegerArrayResult(SMARTS.length); }
private IDescriptorResult newDescriptorResultArray(String descriptorValue) { IDescriptorResult result = null; if ("xsd:double".equals(currentDescriptorDataType)) { result = new DoubleArrayResult(); StringTokenizer tokenizer = new StringTokenizer(descriptorValue); while (tokenizer.hasMoreElements()) { ((DoubleArrayResult) result).add(Double.parseDouble(tokenizer.nextToken())); } } else if ("xsd:integer".equals(currentDescriptorDataType)) { result = new IntegerArrayResult(); StringTokenizer tokenizer = new StringTokenizer(descriptorValue); while (tokenizer.hasMoreElements()) { ((IntegerArrayResult) result).add(Integer.parseInt(tokenizer.nextToken())); } } return result; } }
private IDescriptorResult newDescriptorResultArray(String descriptorValue) { IDescriptorResult result = null; if ("xsd:double".equals(currentDescriptorDataType)) { result = new DoubleArrayResult(); StringTokenizer tokenizer = new StringTokenizer(descriptorValue); while (tokenizer.hasMoreElements()) { ((DoubleArrayResult) result).add(Double.parseDouble(tokenizer.nextToken())); } } else if ("xsd:integer".equals(currentDescriptorDataType)) { result = new IntegerArrayResult(); StringTokenizer tokenizer = new StringTokenizer(descriptorValue); while (tokenizer.hasMoreElements()) { ((IntegerArrayResult) result).add(Integer.parseInt(tokenizer.nextToken())); } } return result; } }
private DescriptorValue getDummyDescriptorValue(Exception e) { IntegerArrayResult result = new IntegerArrayResult(); for (int i = 0; i < SMARTS.length; i++) result.add((int) Double.NaN); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result, getDescriptorNames(), e); }
private DescriptorValue getDummyDescriptorValue(Exception e) { IntegerArrayResult result = new IntegerArrayResult(); for (int i = 0; i < SMARTS.length; i++) result.add((int) Double.NaN); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result, getDescriptorNames(), e); }
@Test public void testIntegerArrayResult() { IntegerArrayResult result = new IntegerArrayResult(); Assert.assertNotNull(result); Assert.assertEquals(0, result.length()); }
@Test public void IntegerArrayResult_int() { IntegerArrayResult result = new IntegerArrayResult(5); Assert.assertNotNull(result); Assert.assertEquals(5, result.length()); }
@Test public void testSize() { IntegerArrayResult result = new IntegerArrayResult(); Assert.assertNotNull(result); Assert.assertEquals(0, result.length()); result.add(5); Assert.assertEquals(1, result.length()); }
@Test public void testAdd_int() { IntegerArrayResult result = new IntegerArrayResult(); Assert.assertNotNull(result); result.add(5); result.add(5); result.add(5); result.add(5); result.add(5); Assert.assertEquals(5, result.length()); }
IntegerArrayResult results = new IntegerArrayResult(resultLength);
IntegerArrayResult results = new IntegerArrayResult(resultLength);
@Test public void testToString() { IntegerArrayResult result = new IntegerArrayResult(); Assert.assertNotNull(result); Assert.assertEquals("", result.toString()); result.add(5); Assert.assertEquals("5", result.toString()); result.add(2); Assert.assertEquals("5,2", result.toString()); result.add(-3); Assert.assertEquals("5,2,-3", result.toString()); }
IntegerArrayResult result = new IntegerArrayResult(); for (Integer i : counts) result.add(i);
IntegerArrayResult result = new IntegerArrayResult(); for (Integer i : counts) result.add(i);
@Test public void testGet_int() { IntegerArrayResult result = new IntegerArrayResult(); Assert.assertNotNull(result); Assert.assertEquals("", result.toString()); result.add(5); Assert.assertEquals(5, result.get(0)); result.add(2); Assert.assertEquals(5, result.get(0)); Assert.assertEquals(2, result.get(1)); result.add(-1); Assert.assertEquals(5, result.get(0)); Assert.assertEquals(2, result.get(1)); Assert.assertEquals(-1, result.get(2)); }