public void Shift() { for (int i = 0; i < lineStorage.GetLineIndexLength(); i++) { wordIndices.Add(lineStorage.GetLineIndex(i)); lineIndices.Add(i); int lastIndex = 0; if (i != lineStorage.GetLineIndexLength() - 1) { lastIndex = lineStorage.GetLineIndex(i + 1); } else { lastIndex = lineStorage.GetCharCoreLength(); } for (int j = lineStorage.GetLineIndex(i); j < lastIndex; j++) { if (lineStorage.GetChar(j) == ' ') { wordIndices.Add(j + 1); lineIndices.Add(i); } } } circularShifts = new int[2, wordIndices.Count]; for (int i = 0; i < wordIndices.Count; i++) { circularShifts[0, i] = lineIndices[i]; circularShifts[1, i] = wordIndices[i]; } }
public CircularShifter(LineStorage lineStorage) { this.lineStorage = lineStorage; LineIndexLength = lineStorage.GetLineIndexLength(); CharCoreLength = lineStorage.GetCharCoreLength(); }