public boolean alterBlockOfCharacters(CharacterData data, int icStart, int icEnd) { if (data == null) return false; if (data instanceof MolecularData) { MolecularData mData = (MolecularData) data; mData.reverse(icStart, icEnd, true); } else { for (int it = 0; it < data.getNumTaxa(); it++) for (int i = 0; i <= (icEnd - icStart) / 2 && icStart + i < icEnd - i; i++) { data.tradeStatesBetweenCharacters(icStart + i, icEnd - i, it, true); } } return true; }
public boolean alterBlockInTaxon(CharacterData data, int icStart, int icEnd, int it) { if (data == null) return false; if (data instanceof MolecularData) { MolecularData mData = (MolecularData) data; mData.reverse(icStart, icEnd, it, false, true); } else for (int i = 0; i <= (icEnd - icStart) / 2 && icStart + i < icEnd - i; i++) { data.tradeStatesBetweenCharacters(icStart + i, icEnd - i, it, true); } return true; }