private static boolean isCuratedComplex(Experiment experiment) { for (Annotation annotation : experiment.getAnnotations()) { final CvTopic cvTopic = annotation.getCvTopic(); if (cvTopic == null) { continue; } if (CvTopic.CURATED_COMPLEX.equals(cvTopic.getShortLabel())) { return true; } } return false; }
/** * Checks if the given Experiment has an annotation with CvTopic( accepted ). * * @param experiment the experiment to check on * @return true is at least one of such annotation is found. */ public static boolean isAccepted(Experiment experiment) { if (experiment == null) { throw new NullPointerException("You must give a non null experiment"); } for (Annotation a : experiment.getAnnotations()) { if (a.getCvTopic() != null && CvTopic.ACCEPTED.equals(a.getCvTopic().getShortLabel())) { return true; } } return false; }
/** * Checks if the given Experiment has an annotation with CvTopic( accepted ). * * @param experiment the experiment to check on * @return true is at least one of such annotation is found. */ public static boolean isAccepted( Experiment experiment ) { if ( experiment == null ) { throw new NullPointerException( "You must give a non null experiment" ); } for ( Annotation a : experiment.getAnnotations() ) { if ( a.getCvTopic() != null && CvTopic.ACCEPTED.equals( a.getCvTopic().getShortLabel() ) ) { return true; } } return false; }
/** * Checks if the given Experiment has an annotation with CvTopic( accepted ). * * @param experiment the experiment to check on * @return true is at least one of such annotation is found. */ public static boolean isAccepted(Experiment experiment) { if (experiment == null) { throw new NullPointerException("You must give a non null experiment"); } for (Annotation a : experiment.getAnnotations()) { if (a.getCvTopic() != null && CvTopic.ACCEPTED.equals(a.getCvTopic().getShortLabel())) { return true; } } return false; }
/** * Checks if an experiment contains the annotation with topic "To be reviewed" * * @param experiment The experiment to check * @return true if it contains the annotation */ public static boolean isToBeReviewed(Experiment experiment) { for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.TO_BE_REVIEWED.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; }
/** * Checks if an experiment contains the annotation with topic "To be reviewed" * * @param experiment The experiment to check * @return true if it contains the annotation */ public static boolean isToBeReviewed(Experiment experiment) { for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.TO_BE_REVIEWED.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; }
private static String getAnnotationValue(Experiment experiment, CvTopic topic) { for (Annotation annotation : experiment.getAnnotations()) { if (topic.equals(annotation.getCvTopic())) { return annotation.getAnnotationText(); } } return null; }
annotations = experiment.getAnnotations(); for ( Iterator iterator2 = annotations.iterator(); iterator2.hasNext() && false == isNegative; ) { Annotation annotation = (Annotation) iterator2.next();
annotations = experiment.getAnnotations(); for ( Iterator iterator2 = annotations.iterator(); iterator2.hasNext() && false == isNegative; ) { Annotation annotation = (Annotation) iterator2.next();
annotations = experiment.getAnnotations(); for ( Iterator iterator2 = annotations.iterator(); iterator2.hasNext() && false == isNegative; ) { Annotation annotation = (Annotation) iterator2.next();
/** * Checks if any of the experiments for a publication is On Hold * * @param publication The publication to check * @return true if any of the experiments has the cv topic on hold in its annotations */ public static boolean isPublicationOnHold(Publication publication) { for (Experiment experiment : publication.getExperiments()) { for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.ON_HOLD.equals(annotation.getCvTopic().getShortLabel())) { return true; } } } return false; }
/** * Checks if any of the experiments for a publication is On Hold * * @param publication The publication to check * @return true if any of the experiments has the cv topic on hold in its annotations */ public static boolean isPublicationOnHold(Publication publication) { for (Experiment experiment : publication.getExperiments()) { for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.ON_HOLD.equals(annotation.getCvTopic().getShortLabel())) { return true; } } } return false; }
Collection<Annotation> annotations = experiment.getAnnotations(); boolean yesFound = false; boolean noFound = false;
/** * Checks if an experiment or the experiments for the same publication are on hold. * If the Experiment object contains a Publication, all the experiments from the publication * are checked. If any of them is on hold, the method will return true. * * @param experiment The experiment to check * @return true if the experiment is on hold, or any of the experiments for the same publication object */ public static boolean isOnHold(Experiment experiment) { if (experiment.getPublication() != null) { return isPublicationOnHold(experiment.getPublication()); } for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.ON_HOLD.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; }
/** * Checks if an experiment or the experiments for the same publication are on hold. * If the Experiment object contains a Publication, all the experiments from the publication * are checked. If any of them is on hold, the method will return true. * * @param experiment The experiment to check * @return true if the experiment is on hold, or any of the experiments for the same publication object */ public static boolean isOnHold(Experiment experiment) { if (experiment.getPublication() != null) { return isPublicationOnHold(experiment.getPublication()); } for (Annotation annotation : experiment.getAnnotations()) { if (annotation.getCvTopic() != null && CvTopic.ON_HOLD.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; }
experiment.getAnnotations().clear(); experiment.getAnnotations().addAll(annotations);
experiment.getAnnotations().clear(); experiment.getAnnotations().addAll(annotations);
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }