@Override public int getCVTermCount() { return isSetAnnotation() ? annotation.getListOfCVTerms().size() : 0; }
@Override public List<CVTerm> getCVTerms() { return getAnnotation().getListOfCVTerms(); }
/** * Checks if the RDF part of the Annotation is initialized. * * <p>An Annotation is initialized if * at least one of the following is true: * <ul> * <li> one or more CVTerm are defined * <li> there is an history defined. * </ul> * <p> * * @return {@code true} if the RDF part of the Annotation is initialized */ public boolean isSetRDFannotation() { if (getListOfCVTerms().isEmpty() && (!isSetHistory())) { return false; } else if ((!isSetHistory()) && !getListOfCVTerms().isEmpty()) { for (int i = 0; i < getListOfCVTerms().size(); i++) { if (getCVTerm(i) != null) { return true; } } } return true; }
private Map<Qualifier, Set<String>> extractRDFAnnotation(SBase element) { EnumMap<Qualifier, Set<String>> rdfMap = new EnumMap<Qualifier, Set<String>>(Qualifier.class); if (element.isSetAnnotation()) { Annotation ann = element.getAnnotation(); for (CVTerm cvterm : ann.getListOfCVTerms()) { rdfMap.put(cvterm.getBiologicalQualifierType(), new HashSet<String>(cvterm.getResources())); } } return rdfMap; }
private Map<Qualifier, Set<String>> extractRDFAnnotation(SBase element) { EnumMap<Qualifier, Set<String>> rdfMap = new EnumMap<Qualifier, Set<String>>(Qualifier.class); if (element.isSetAnnotation()) { Annotation ann = element.getAnnotation(); for (CVTerm cvterm : ann.getListOfCVTerms()) { rdfMap.put(cvterm.getBiologicalQualifierType(), new HashSet<String>(cvterm.getResources())); } } return rdfMap; }
/** * Checks if the {@link Annotation} is initialized. * * <p>An {@link Annotation} is initialized if * at least one of the following is true: * <ul> * <li> there is some non RDF annotation * <li> one or more {@link CVTerm} are defined * <li> there is an history defined. * </ul> * * @return {@code true} if the Annotation is initialized */ public boolean isSetAnnotation() { if ((getNonRDFannotation() == null) && getListOfCVTerms().isEmpty() && !isSetHistory()) { return false; } else if ((getNonRDFannotation() == null) && !isSetHistory() && !getListOfCVTerms().isEmpty()) { for (int i = 0; i < getListOfCVTerms().size(); i++) { if ((getCVTerm(i) != null) && getCVTerm(i).getResourceCount() > 0) { return true; } } } return true; }
return new TreeNodeAdapter(getListOfCVTerms(), this);
/** * Creates a new Annotation instance by cloning the given Annotation. * * @param annotation the annotation to be cloned. */ public Annotation(Annotation annotation) { super(annotation); if (annotation.nonRDFannotation != null) { nonRDFannotation = annotation.nonRDFannotation.clone(); } for (CVTerm term : annotation.getListOfCVTerms()) { getListOfCVTerms().add(term.clone()); } if (annotation.isSetHistory()) { setHistory(annotation.getHistory().clone()); } }
/** * Returns a list of CVTerm having the given qualifier. * * @param qualifier the qualifier * @return a list of CVTerm having the given qualifier, an empty * list is returned if no CVTerm are found. */ public List<CVTerm> filterCVTerms(Qualifier qualifier) { ArrayList<CVTerm> l = new ArrayList<CVTerm>(); CVTermFilter filter = new CVTermFilter(qualifier); for (CVTerm term : getListOfCVTerms()) { if (filter.accepts(term)) { l.add(term); } if (term.getNestedCVTermCount() > 0) { l.addAll(filterCVTerms(qualifier, term.getListOfNestedCVTerms())); } } return l; }
int i = contextObject.getAnnotation().getListOfCVTerms().size() - 1; for (; i >= 0; i--)