@Override public BinaryInteraction merge(BinaryInteraction bi1, BinaryInteraction bi2) { BinaryInteraction bi = super.merge(bi1, bi2); bi.setInteractorB(newInteractor(Collections.EMPTY_LIST)); return bi; }
/** * Alters the order of interactorA and interactorB of a binary interaction, according to a comparator. * @param binaryInteraction the binary interaction * @param comparator the comparator to use */ public static void reorderInteractors(BinaryInteraction binaryInteraction, Comparator<Interactor> comparator) { if (binaryInteraction == null) throw new NullPointerException("binaryInteraction is null"); if (comparator == null) throw new NullPointerException("comparator is null"); Interactor interactorA = binaryInteraction.getInteractorA(); Interactor interactorB = binaryInteraction.getInteractorB(); if (comparator.compare(interactorA, interactorB) < 0) { binaryInteraction.setInteractorA(interactorB); binaryInteraction.setInteractorB(interactorA); } } }
private void invertInteractors(BinaryInteraction binaryInteraction) { Interactor a = binaryInteraction.getInteractorA(); Interactor b = binaryInteraction.getInteractorB(); binaryInteraction.setInteractorA(b); binaryInteraction.setInteractorB(a); }
bi.setInteractorB(interactorB);
public T merge(T bi1, T bi2) { T merged = cloneBinaryInteraction(bi1); merged.setInteractorA(mergeInteractorA(bi1.getInteractorA(), bi2.getInteractorA())); merged.setInteractorB(mergeInteractorB(bi1.getInteractorB(), bi2.getInteractorB())); populateBinaryInteraction(bi2, merged); return merged; }
interaction.setInteractorB(null);