}
someValues = false;
int lastWritten = -1;
ColumnRange range = null;
for (int ic = 0; ic < pNumChar; ic++) {
//for noncoding ranges, the interval is 3, need add 2:
if (continuing > 0 && iw > 0 && ic < pNumChar -2) {
ic = ic +2;
}
if (codonPossSet.equals(ic, posIndex)
|| (codonPossSet.getInt(ic) == MesquiteInteger.unassigned && (iw == unassignedPosition))) {
if (continuing == 0) {
lastWritten = ic;
range = new ColumnRange();
range.setStartColIndex(ic);
if (interval > 1) {
range.setRepeatInterval(interval);
}
aHelper.getColRanges().add(range);
continuing = 1;
someValues = true;
} else if (continuing == 1) {
continuing = 2;
someValues = true;
}
} else if (continuing > 0) {
if (lastWritten != ic - 1) {
range.setEndColIndex(ic - 1);
lastWritten = ic - 1;
someValues = true;
} else {
// start index and end index should be the same:
range.setEndColIndex(ic - 1);
lastWritten = -1;
}
continuing = 0;
}
}
if (continuing > 0) {
range.setEndColIndex(pNumChar - 1);
someValues = true;
}
// the column ranges are not null: