/**
   * Sets Interactor Organism.
   *
   * @param interactor Data Services Interactor Object.
   * @param jaxbInteractor JAXB Protein Interactor Object.
   */
  private void setOrganism(Interactor interactor, InteractorElementType jaxbInteractor) {
    InteractorElementType.Organism organism = new InteractorElementType.Organism();
    String taxonomyID = (String) interactor.getAttribute(InteractorVocab.ORGANISM_NCBI_TAXONOMY_ID);

    if (taxonomyID != null) {
      int taxId = Integer.parseInt(taxonomyID);
      organism.setNcbiTaxId(taxId);
    }

    NamesType orgNames = new NamesType();
    String commonName = (String) interactor.getAttribute(InteractorVocab.ORGANISM_COMMON_NAME);

    if (commonName != null) {
      orgNames.setShortLabel(commonName);
    }

    String speciesName = (String) interactor.getAttribute(InteractorVocab.ORGANISM_SPECIES_NAME);

    if (speciesName != null) {
      orgNames.setFullName(speciesName);
    }

    organism.setNames(orgNames);
    jaxbInteractor.setOrganism(organism);
  }
  /**
   * Sets Interactor Name and ID.
   *
   * @param interactor Data Services Interactor object.
   * @param jaxbInteractor JAXB Protein Interactor Object.
   */
  private void setNameId(Interactor interactor, InteractorElementType jaxbInteractor) {
    NamesType names = new NamesType();
    names.setShortLabel(interactor.getName());

    String fullName = (String) interactor.getAttribute(InteractorVocab.FULL_NAME);

    if (fullName != null) {
      names.setFullName(fullName);
    }

    jaxbInteractor.setNames(names);
    jaxbInteractor.setId(interactorId);
    interactorMap.put(interactor.getName(), interactorId);
    interactorId++;
  }
  /**
   * Gets the Interaction Participant List.
   *
   * @param interaction Interaction object.
   * @return Castor Participant List.
   */
  private InteractionElementType.ParticipantList getParticipantList(
      org.cytoscape.coreplugin.psi_mi.model.Interaction interaction) {
    InteractionElementType.ParticipantList participantList =
        new InteractionElementType.ParticipantList();

    List interactors = interaction.getInteractors();

    for (int i = 0; i < interactors.size(); i++) {
      Interactor interactor = (Interactor) interactors.get(i);
      String name = interactor.getName();
      ParticipantType participant1 = createParticipant(name);
      participantList.getParticipant().add(participant1);
    }

    return participantList;
  }
  /**
   * Conditionally adds Protein to HashMap.
   *
   * @param interactor Interactor Object.
   * @param interactorMap HashMap of NonRedundant Interactors.
   */
  private void addToHashMap(Interactor interactor, HashMap interactorMap) {
    String orfName = interactor.getName();

    if (!interactorMap.containsKey(orfName)) {
      interactorMap.put(orfName, interactor);
    }
  }
  /** Sets Sequence Data. */
  private void setSequence(Interactor interactor, InteractorElementType jaxbInteractor) {
    String seqData = (String) interactor.getAttribute(InteractorVocab.SEQUENCE_DATA);

    if (seqData != null) {
      jaxbInteractor.setSequence(seqData);
    }
  }