@Test public void testRepair() throws Exception { VirtualCharSequence vcs = new VirtualCharSequence(new ArrayList<ITextToken>()); permuteRepair(vcs, new int[10], 0); permuteRepair(vcs, new int[2], 0); permuteRepair(vcs, new int[1], 0); }
protected void repair() { if (this._firstDeletedTokenIndex < 0) return; int offset = 0; int ix = _firstDeletedTokenIndex; while (ix < count) { if (indexes[ix] == -1) { offset++; count--; } if (offset > 0 && ix < count) { indexes[ix] = indexes[ix + offset]; nodes[ix] = nodes[ix + offset]; } if (ix >= count || indexes[ix] != -1) ix++; } this._firstDeletedTokenIndex = -1; }
VirtualCharSequence implements CharSequence { protected void repair() { if (this._firstDeletedTokenIndex < 0) return; int offset = 0; int ix = _firstDeletedTokenIndex; while (ix < count) { if (indexes[ix] == -1) { offset++; count--; } if (offset > 0 && ix < count) { indexes[ix] = indexes[ix + offset]; nodes[ix] = nodes[ix + offset]; } if (ix >= count || indexes[ix] != -1) ix++; } this._firstDeletedTokenIndex = -1; } }
VirtualCharSequence implements CharSequence { protected void repair() { if (this._firstDeletedTokenIndex < 0) return; int offset = 0; int ix = _firstDeletedTokenIndex; while (ix < count) { if (indexes[ix] == -1) { offset++; count--; } if (offset > 0 && ix < count) { indexes[ix] = indexes[ix + offset]; nodes[ix] = nodes[ix + offset]; } if (ix >= count || indexes[ix] != -1) ix++; } this._firstDeletedTokenIndex = -1; } VirtualCharSequence(List<ITextToken> textTokens);  VirtualCharSequence(List<ITextToken> textTokens, boolean decodeEntities); }
VirtualCharSequence implements CharSequence { protected void repair() { if (this._firstDeletedTokenIndex < 0) return; int offset = 0; int ix = _firstDeletedTokenIndex; while (ix < count) { if (indexes[ix] == -1) { offset++; count--; } if (offset > 0 && ix < count) { indexes[ix] = indexes[ix + offset]; nodes[ix] = nodes[ix + offset]; } if (ix >= count || indexes[ix] != -1) ix++; } this._firstDeletedTokenIndex = -1; } VirtualCharSequence(List<ITextToken> textTokens);  VirtualCharSequence(List<ITextToken> textTokens, boolean decodeEntities); List<String> getComponentStrings(); ITextToken getTokenAt(int index); char charAt(int index); VirtualCharSequence setCharAt(int index, char c); int length(); CharSequence subSequence(int start, int end); int indexOf(String s, int fromIndex); String toString(); void insert(int start, String newText); void delete(int start, int length); VirtualCharSequence replace(int start, int length, String newText); VirtualCharSequence replace(int start, int length, String newText, boolean snapNext); void replaceSmart(int start, int length, String newText); void replaceSmart(int start, int length, String newText, int secondsTimeout, boolean enableLineOptimization); void flattenArea(int start, int length); static String quoteReplacement(String s); VirtualCharSequence replaceAll(Pattern p, String replacement, boolean smartMerging); VirtualCharSequence replaceAll(String regex, String replacement, boolean smartMerging); int replaceMatch(Matcher m, String replacement, boolean smartMerging); VirtualCharSequence trimStart(); VirtualCharSequence trimEnd(); VirtualCharSequence trim(); VirtualCharSequence append(String newText); }
VirtualCharSequence implements CharSequence { protected void repair() { if (this._firstDeletedTokenIndex < 0) return; int offset = 0; int ix = _firstDeletedTokenIndex; while (ix < count) { if (indexes[ix] == -1) { offset++; count--; } if (offset > 0 && ix < count) { indexes[ix] = indexes[ix + offset]; nodes[ix] = nodes[ix + offset]; } if (ix >= count || indexes[ix] != -1) ix++; } this._firstDeletedTokenIndex = -1; } VirtualCharSequence(List<ITextToken> textTokens);  VirtualCharSequence(List<ITextToken> textTokens, boolean decodeEntities); List<String> getComponentStrings(); ITextToken getTokenAt(int index); char charAt(int index); VirtualCharSequence setCharAt(int index, char c); int length(); CharSequence subSequence(int start, int end); int indexOf(String s, int fromIndex); String toString(); void insert(int start, String newText); void delete(int start, int length); VirtualCharSequence replace(int start, int length, String newText); VirtualCharSequence replace(int start, int length, String newText, boolean snapNext); void replaceSmart(int start, int length, String newText); void replaceSmart(int start, int length, String newText, int secondsTimeout, boolean enableLineOptimization); void flattenArea(int start, int length); static String quoteReplacement(String s); VirtualCharSequence replaceAll(Pattern p, String replacement, boolean smartMerging); VirtualCharSequence replaceAll(String regex, String replacement, boolean smartMerging); int replaceMatch(Matcher m, String replacement, boolean smartMerging); VirtualCharSequence trimStart(); VirtualCharSequence trimEnd(); VirtualCharSequence trim(); VirtualCharSequence append(String newText); public HashSet<String> deletedText; }