public boolean retainAll(Collection<?> objects) { boolean retain = candidates.retainAll(objects); if (retain){ Collection<Interactor> interactors = new ArrayList<Interactor>(objects.size()); for (Object o : objects){ interactors.add(((Participant)o).getInteractor()); } getInteractor().retainAll(interactors); } return retain; }
public void writeInteractorOrganism(P participant) throws IOException { if (participant != null){ Interactor interactor = participant.getInteractor(); writeOrganism(interactor.getOrganism()); } else{ writer.write(MitabUtils.EMPTY_COLUMN); } }
public void writeUniqueIdentifier(P participant) throws IOException { if (participant == null){ writer.write(MitabUtils.EMPTY_COLUMN); } else { Interactor interactor = participant.getInteractor(); // write first identifier if (!interactor.getIdentifiers().isEmpty()){ writeIdentifier(interactor.getPreferredIdentifier()); } else{ writer.write(MitabUtils.EMPTY_COLUMN); } } }
public void writeParticipantChecksums(P participant) throws IOException { if (participant != null){ if (!participant.getInteractor().getChecksums().isEmpty()){ Iterator<Checksum> checksumIterator = participant.getInteractor().getChecksums().iterator(); while(checksumIterator.hasNext()){ writeChecksum(checksumIterator.next()); if (checksumIterator.hasNext()){ getWriter().write(MitabUtils.FIELD_SEPARATOR); } } } else{ getWriter().write(MitabUtils.EMPTY_COLUMN); } } else { getWriter().write(MitabUtils.EMPTY_COLUMN); } }
public void writeInteractorType(P participant) throws IOException { if (participant != null){ writeCvTerm(participant.getInteractor().getInteractorType()); } else { getWriter().write(MitabUtils.EMPTY_COLUMN); } }
protected void buildInteractionkey(I interaction) { this.stringBuilder.setLength(0); this.interactorAcs.clear(); // read ordered set of interactor acs for (Object obj : interaction.getParticipants()) { Participant component = (Participant)obj; interactorAcs.add(component.getInteractor() instanceof IntactInteractor ? ((IntactInteractor) component.getInteractor()).getAc() : component.getInteractor().getShortName()); } for (String prL : interactorAcs) { stringBuilder.append(" "); stringBuilder.append(prL); } // interaction type stringBuilder.append(interaction.getInteractionType().getMIIdentifier()); // experiment CvTerm method = extractInteractionDetectionMethodFrom(interaction); if (method != null) { stringBuilder.append(" "); stringBuilder.append(method.getMIIdentifier()); } }
String firstName = firstShortNameAlphabeticalOrder.getInteractor().getShortName().trim().toLowerCase(); String secondName = p.getInteractor().getShortName().trim().toLowerCase();
public boolean removeAll(Collection<?> objects) { boolean remove = candidates.removeAll(objects); if (remove){ Collection<Interactor> interactors = new ArrayList<Interactor>(objects.size()); for (Object o : objects){ Participant entity = (Participant)o; entity.setChangeListener(null); interactors.add(entity.getInteractor()); entity.setInteraction(null); } // check if an interactor is not in another entity that is kept. // remove any interactors that are kept with other entities for (P entity : this){ interactors.remove(entity.getInteractor()); } getInteractor().removeAll(interactors); } return remove; }
Interactor interactor = participant.getInteractor();
Interactor interactor = participant.getInteractor();
public void writeParticipantAnnotations(P participant) throws IOException { if (participant != null){ if (!participant.getInteractor().getAnnotations().isEmpty()){ Iterator<Annotation> interactorAnnotationIterator = participant.getInteractor().getAnnotations().iterator();
protected void registerAndWriteInteractor(Participant participant) throws IOException { if (participant != null){ Interactor interactor = participant.getInteractor(); if (interactor instanceof Complex){ Complex complex = (Complex)interactor; // write as an interaction if (!complex.getParticipants().isEmpty()){ writeComplex(complex); } // write as an interactor else{ getInteractorWriter().write(interactor); } } else{ getInteractorWriter().write(interactor); } } }
if (!participant.getInteractor().getXrefs().isEmpty()){ Iterator<Xref> interactorXrefIterator = participant.getInteractor().getXrefs().iterator(); if (participant.getInteractor() instanceof InteractorPool){ InteractorPool interactorPool = (InteractorPool)participant.getInteractor(); Iterator<Interactor> interactorIterator = interactorPool.iterator(); while (interactorIterator.hasNext()){ if (participant.getInteractor() instanceof InteractorPool){ InteractorPool interactorPool = (InteractorPool)participant.getInteractor(); Iterator<Interactor> interactorIterator = interactorPool.iterator(); while (interactorIterator.hasNext()){ else if (participant.getInteractor() instanceof InteractorPool){ InteractorPool interactorPool = (InteractorPool)participant.getInteractor(); Iterator<Interactor> interactorIterator = interactorPool.iterator(); boolean first = true;
target.setParticipantA(first); if (self){ Participant clone = new DefaultParticipant(first.getInteractor()); ParticipantCloner.copyAndOverrideBasicParticipantProperties(first, clone, true); Participant clone = new DefaultParticipant(first.getInteractor()); ParticipantCloner.copyAndOverrideBasicParticipantProperties(first, clone, true); target.setParticipantA(clone); Participant clone2 = new DefaultParticipant(first.getInteractor()); ParticipantCloner.copyAndOverrideBasicParticipantProperties(first, clone2, true); Participant clone2 = new DefaultParticipant(second.getInteractor()); ParticipantCloner.copyAndOverrideBasicParticipantProperties(second, clone2, true); target.setParticipantB(clone2);
if (object.getInteractor() instanceof Complex){ Interactor interactor = object.getInteractor(); Interactor interactor = object.getInteractor();
for (Object o : source.getParticipants()){ Participant p = (Participant)o; Participant clone = new DefaultParticipant(p.getInteractor()); ParticipantCloner.copyAndOverrideBasicParticipantProperties(p, clone, true); target.getParticipants().add(clone);
target.setInteractor(source.getInteractor());
Interactor interactor = component.getInteractor(); if (interactor == null){ throw new IllegalArgumentException("The component must have a non null interactor.");