Package org.openbel.framework.common.model

Examples of org.openbel.framework.common.model.Evidence


    /**
     * Tests {@link Evidence#copy()}.
     */
    @Test
    public void testCopy() {
        Evidence e1 = CommonModelFactory.getInstance().createEvidence(
                valueOf(currentTimeMillis()));
        Evidence e2 = e1.clone();
        assertEquals(e1, e2);
        assertFalse(e1 == e2);

        Set<Object> set = new HashSet<Object>();
        set.add(e1);
View Full Code Here


    public XBELAnnotationGroup convert(AnnotationGroup source) {
        if (source == null) return null;

        List<Annotation> annotations = source.getAnnotations();
        Citation citation = source.getCitation();
        Evidence evidence = source.getEvidence();

        XBELAnnotationGroup xag = new XBELAnnotationGroup();
        List<Object> list = xag.getAnnotationOrEvidenceOrCitation();

        if (hasItems(annotations)) {
            // Defer to AnnotationConverter
            AnnotationConverter aConverter = new AnnotationConverter();
            for (final Annotation a : annotations) {
                XBELAnnotation xa = aConverter.convert(a);
                list.add(xa);
            }
        }

        if (citation != null) {
            // Defer to CitationConverter
            CitationConverter cConverter = new CitationConverter();
            XBELCitation xc = cConverter.convert(citation);
            list.add(xc);
        }

        if (evidence != null) {
            list.add(evidence.getValue());
        }

        return xag;
    }
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.Evidence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.