/** * Returns the line at the given index with delimiters. * <p> * @param index the index of the line to return * @return the logical line text (i.e., without the gap) with delimiters */ String getFullLine(int index) { int start = lines[index][0]; int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { // line is before or after the gap return new String(textStore, start, length); } else { // gap is in the specified range, strip out the gap StringBuffer buffer = new StringBuffer(); int gapLength = gapEnd - gapStart; buffer.append(textStore, start, gapStart - start); buffer.append(textStore, gapEnd, length - gapLength - (gapStart - start)); return buffer.toString(); } } /**
/** * Returns the line at the given index with delimiters. * <p> * @param index the index of the line to return * @return the logical line text (i.e., without the gap) with delimiters */ String getFullLine(int index) { int start = lines[index][0]; int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { // line is before or after the gap return new String(textStore, start, length); } else { // gap is in the specified range, strip out the gap StringBuffer buffer = new StringBuffer(); int gapLength = gapEnd - gapStart; buffer.append(textStore, start, gapStart - start); buffer.append(textStore, gapEnd, length - gapLength - (gapStart - start)); return buffer.toString(); } } /**
/** * Returns the line at the given index with delimiters. * <p> * @param index the index of the line to return * @return the logical line text (i.e., without the gap) with delimiters */ String getFullLine(int index) { int start = lines[index][0]; int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { // line is before or after the gap return new String(textStore, start, length); } else { // gap is in the specified range, strip out the gap StringBuffer buffer = new StringBuffer(); int gapLength = gapEnd - gapStart; buffer.append(textStore, start, gapStart - start); buffer.append(textStore, gapEnd, length - gapLength - (gapStart - start)); return buffer.toString(); } } /**
/** * Returns the line at the given index with delimiters. * <p> * @param index the index of the line to return * @return the logical line text (i.e., without the gap) with delimiters */ String getFullLine(int index) { int start = lines[index][0]; int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { // line is before or after the gap return new String(textStore, start, length); } else { // gap is in the specified range, strip out the gap StringBuffer buffer = new StringBuffer(); int gapLength = gapEnd - gapStart; buffer.append(textStore, start, gapStart - start); buffer.append(textStore, gapEnd, length - gapLength - (gapStart - start)); return buffer.toString(); } } /**
/** * Returns the line at the given index with delimiters. * <p> * @param index the index of the line to return * @return the logical line text (i.e., without the gap) with delimiters */ String getFullLine(int index) { int start = lines[index][0]; int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) { // line is before or after the gap return new String(textStore, start, length); } else { // gap is in the specified range, strip out the gap StringBuffer buffer = new StringBuffer(); int gapLength = gapEnd - gapStart; buffer.append(textStore, start, gapStart - start); buffer.append(textStore, gapEnd, length - gapLength - (gapStart - start)); return buffer.toString(); } } /**
/** * Returns a string representing the logical content of * the text store (i.e., gap stripped out). * <p> * * @param start the logical start offset of the text to return * @param length the logical length of the text to return * @return the text */ @Override public String getTextRange(int start, int length) { if (textStore == null) return ""; if (length == 0) return ""; int end= start + length; if (!gapExists() || (end < gapStart)) return new String(textStore, start, length); if (gapStart < start) { int gapLength= gapEnd - gapStart; return new String(textStore, start + gapLength , length); } StringBuffer buf = new StringBuffer(); buf.append(textStore, start, gapStart - start); buf.append(textStore, gapEnd, end - gapStart); return buf.toString(); } /**
/** * Returns a string representing the logical content of * the text store (i.e., gap stripped out). * <p> * * @param start the logical start offset of the text to return * @param length the logical length of the text to return * @return the text */ @Override public String getTextRange(int start, int length) { if (textStore == null) return ""; if (length == 0) return ""; int end= start + length; if (!gapExists() || (end < gapStart)) return new String(textStore, start, length); if (gapStart < start) { int gapLength= gapEnd - gapStart; return new String(textStore, start + gapLength , length); } StringBuffer buf = new StringBuffer(); buf.append(textStore, start, gapStart - start); buf.append(textStore, gapEnd, end - gapStart); return buf.toString(); } /**
/** * Returns a string representing the logical content of * the text store (i.e., gap stripped out). * <p> * * @param start the logical start offset of the text to return * @param length the logical length of the text to return * @return the text */ @Override public String getTextRange(int start, int length) { if (textStore == null) return ""; if (length == 0) return ""; int end= start + length; if (!gapExists() || (end < gapStart)) return new String(textStore, start, length); if (gapStart < start) { int gapLength= gapEnd - gapStart; return new String(textStore, start + gapLength , length); } StringBuffer buf = new StringBuffer(); buf.append(textStore, start, gapStart - start); buf.append(textStore, gapEnd, end - gapStart); return buf.toString(); } /**
/** * Returns a string representing the logical content of * the text store (i.e., gap stripped out). * <p> * * @param start the logical start offset of the text to return * @param length the logical length of the text to return * @return the text */ public String getTextRange(int start, int length) { if (textStore == null) return ""; if (length == 0) return ""; int end= start + length; if (!gapExists() || (end < gapStart)) return new String(textStore, start, length); if (gapStart < start) { int gapLength= gapEnd - gapStart; return new String(textStore, start + gapLength , length); } StringBuffer buf = new StringBuffer(); buf.append(textStore, start, gapStart - start); buf.append(textStore, gapEnd, end - gapStart); return buf.toString(); } /**
/** * Returns a string representing the logical content of * the text store (i.e., gap stripped out). * <p> * * @param start the logical start offset of the text to return * @param length the logical length of the text to return * @return the text */ @Override public String getTextRange(int start, int length) { if (textStore == null) return ""; if (length == 0) return ""; int end= start + length; if (!gapExists() || (end < gapStart)) return new String(textStore, start, length); if (gapStart < start) { int gapLength= gapEnd - gapStart; return new String(textStore, start + gapLength , length); } StringBuffer buf = new StringBuffer(); buf.append(textStore, start, gapStart - start); buf.append(textStore, gapEnd, end - gapStart); return buf.toString(); } /**
int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) {
int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) {
int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) {
int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) {
int length = lines[index][1]; int end = start + length - 1; if (!gapExists() || (end < gapStart) || (start >= gapEnd)) {