/** * Sets the type of this {@link CVTerm} to 'type', the value of the {@link Qualifier} is reset to * {@link Qualifier#BQB_UNKNOWN} or {@link Qualifier#BQM_UNKNOWN}. * * @param type * @see #setQualifier(Qualifier) */ public void setQualifierType(Type type) { if ((type == Type.MODEL_QUALIFIER) || (type == Type.BIOLOGICAL_QUALIFIER) || (type == Type.UNKNOWN_QUALIFIER)) { Qualifier oldQualifier = qualifier; Type oldType = this.type; this.type = type; qualifier = type == Type.MODEL_QUALIFIER ? Qualifier.BQM_UNKNOWN : Qualifier.BQB_UNKNOWN; firePropertyChange(TreeNodeChangeEvent.type, oldType, this.type); firePropertyChange(TreeNodeChangeEvent.qualifier, oldQualifier, qualifier); } else { throw new IllegalArgumentException(MessageFormat.format( resourceBundle.getString("CVTerm.setQualifierType"), type.toString())); } }
/** * Writes all the MIRIAM annotations of the {@link CVTerm} in 'buffer' * * @param indent * @param buffer */ public void toXML(String indent, StringBuffer buffer) { StringTools.append(buffer, "<", type.getElementNameEquivalent(), ":", getQualifier().getElementNameEquivalent(), ">\n", indent, "<rdf:Bag>\n"); if (resourceURIs != null) { for (int i = 0; i < getResourceCount(); i++) { StringTools.append(buffer, indent, indent, "<rdf:li rdf:resource=\"", getResourceURI(i), "\"/>\n"); } } StringTools.append(buffer, indent, "</rdf:Bag>\n", "</", type.getElementNameEquivalent(), ":", getQualifier().getElementNameEquivalent(), ">\n"); }
/** * Returns {@code true} if this qualifier is a model qualifier. * * @return {@code true} if this qualifier is a model qualifier, * {@code false} otherwise. */ public boolean isModelQualifier() { return isSetType() && type.equals(Type.MODEL_QUALIFIER); }
/** * Returns {@code true} if this qualifier is a biological qualifier. * * @return {@code true} if this qualifier is a biological qualifier, * {@code false} otherwise. */ public boolean isBiologicalQualifier() { return isSetType() && type.equals(Type.BIOLOGICAL_QUALIFIER); }
/** * Sets the type of this {@link CVTerm} to the {@link Type} represented by * 'qualifierType'. * * @param qualifierType * the Type to set as an integer. * @libsbml.deprecated use {@link #setQualifier(Qualifier)}. */ public void setQualifierType(int qualifierType) { setQualifierType(Type.values()[qualifierType]); }
/** * Returns {@code true} if the {@link Type} of this CVTerm is set and is different from {@link Type#UNKNOWN_QUALIFIER}. * * @return {@code true} if the {@link Type} of this CVTerm is set and is different from {@link Type#UNKNOWN_QUALIFIER}. */ public boolean isSetType() { return (type != null) && !type.equals(Type.UNKNOWN_QUALIFIER); }