private void processSpecies(CyRow row, CrossReference ref) { if (ref != null) { final String name = ref.getText(); final String speciesID = ref.getIdentifier(); row.set(TAXNOMY, speciesID); row.set(TAXNOMY_NAME, name); } }
public int compare(CrossReference cr1, CrossReference cr2) { int idx1 = texts.indexOf(cr1.getText()); int idx2 = texts.indexOf(cr2.getText()); if (idx1 != -1 || idx2 != -1) { matchedAny = true; } int compare = 0; if (idx1 == -1 && idx2 == -1) { compare = 0; } else if (idx1 == -1) { compare = 1; // first is greater } else if (idx2 == -1) { compare = -1; // first is lower } else { compare = idx1 - idx2; // relative to their position in the ordered list of text } return compare; }
public boolean matches(CrossReference cr) { return texts.indexOf(cr.getText()) != -1; }