public void writeAnnotation(Annotation annotation) throws IOException { if (annotation != null){ // write topic first writeCvTermName(annotation.getTopic()); // write text after if (annotation.getValue() != null){ getWriter().write(MitabUtils.XREF_SEPARATOR); escapeAndWriteString(annotation.getValue()); } } }
public String getPostalAddress() { return this.postalAddress != null ? this.postalAddress.getValue() : null; }
/** * To know if the annotation does have a specific topic * @param annotation : the annotation * @param topicId : the topic MI identifier * @param topicName : the topic name * @return true if the annotation has the topic with given name/identifier */ public static boolean doesAnnotationHaveTopic(Annotation annotation, String topicId, String topicName){ if (annotation == null || (topicName == null && topicId == null)){ return false; } CvTerm topic = annotation.getTopic(); // we can compare identifiers if (topicId != null && topic.getMIIdentifier() != null){ // we have the same topic id return topic.getMIIdentifier().equals(topicId); } // we need to compare topic names else if (topicName != null) { return topicName.equalsIgnoreCase(topic.getShortName()); } return false; }
public String getPhysicalProperties() { return this.physicalProperties != null ? this.physicalProperties.getValue() : null; }
/** * * @param interaction : the interaction to wrap */ public AbstractBinaryInteractionWrapper(I interaction){ if (interaction == null){ throw new IllegalArgumentException("The wrappedInteraction of a AbstractBinaryInteractionWrapper cannot be null"); } if (interaction.getParticipants().size() > 2){ throw new IllegalArgumentException("The wrappedInteraction of a AbstractBinaryInteractionWrapper cannot have more than two participants"); } this.wrappedInteraction = interaction; Annotation annot = InteractionUtils.collectComplexExpansionMethodFromAnnotations(interaction.getAnnotations()); this.annotations = new AnnotationList(); ((AnnotationList)this.annotations).addAllOnly(interaction.getAnnotations()); if (annot != null){ this.complexExpansion = annot.getTopic(); ((AnnotationList)this.annotations).removeOnly(complexExpansion); } }
public String getUrl() { return this.url != null ? this.url.getValue() : null; }
CvTerm topic = annotation.getTopic();
CvTerm topic = annotation.getTopic(); if (annotation.getValue() != null && value != null){ return annotation.getValue().equalsIgnoreCase(value); else if (annotation.getValue() == null && value == null){ return true; if (annotation.getValue() != null && value != null){ return annotation.getValue().equalsIgnoreCase(value); else if (annotation.getValue() == null && value == null){ return true;
getDatabase().getAnnotations(), Annotation.SEARCH_URL_MI, Annotation.SEARCH_URL); if (searchUrlAnnot != null){ searchUrl = searchUrlAnnot.getValue();
/** * * @param annot * @return the hashcode consistent with the equals method for this comparator */ public static int hashCode(Annotation annot){ if (unambiguousAnnotationComparator == null){ unambiguousAnnotationComparator = new UnambiguousAnnotationComparator(); } if (annot == null){ return 0; } int hashcode = 31; CvTerm topic = annot.getTopic(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(topic); String text = annot.getValue(); hashcode = 31*hashcode + (text != null ? text.toLowerCase().trim().hashCode() : 0); return hashcode; } }
int emptyEmailCount = 0; for ( Annotation email : emails ) { final String address = email.getValue(); if ( address == null || address.trim().length() == 0 ) { emptyEmailCount++;