@Override public CVTerm getCVTerm(int index) { if (isSetAnnotation()) { return annotation.getCVTerm(index); } throw new IndexOutOfBoundsException(format( resourceBundle.getString("AbstractSBase.getCVTerm"), index)); }
/** * 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; }
/** * 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; }