Fix wrong indents.

Removed an unused method too.

Change-Id: Id364009fd4e94ec65862fc3651a181e862909a42
This commit is contained in:
Ken Wakasa 2014-01-24 23:55:33 +09:00
parent 90adbc7fdf
commit 0acd121083
2 changed files with 9 additions and 14 deletions

View file

@ -50,16 +50,16 @@ public final class CoordinateUtils {
} }
public static int[] newCoordinateArray(final int arraySize) { public static int[] newCoordinateArray(final int arraySize) {
return new int[ELEMENT_SIZE * arraySize]; return new int[ELEMENT_SIZE * arraySize];
} }
public static int[] newCoordinateArray(final int arraySize, public static int[] newCoordinateArray(final int arraySize,
final int defaultX, final int defaultY) { final int defaultX, final int defaultY) {
final int[] result = new int[ELEMENT_SIZE * arraySize]; final int[] result = new int[ELEMENT_SIZE * arraySize];
for (int i = 0; i < arraySize; ++i) { for (int i = 0; i < arraySize; ++i) {
setXYInArray(result, i, defaultX, defaultY); setXYInArray(result, i, defaultX, defaultY);
} }
return result; return result;
} }
public static int xFromArray(final int[] coordsArray, final int index) { public static int xFromArray(final int[] coordsArray, final int index) {
@ -88,8 +88,4 @@ public final class CoordinateUtils {
coordsArray[baseIndex + INDEX_X] = coords[INDEX_X]; coordsArray[baseIndex + INDEX_X] = coords[INDEX_X];
coordsArray[baseIndex + INDEX_Y] = coords[INDEX_Y]; coordsArray[baseIndex + INDEX_Y] = coords[INDEX_Y];
} }
public static void copyArray(final int[] destination, final int[] source) {
System.arraycopy(source, 0, destination, 0, source.length);
}
} }

View file

@ -39,11 +39,10 @@ public class WordComposerTests extends AndroidTestCase {
final int[] CODEPOINTS_WITHIN_BMP = StringUtils.toCodePointArray(STR_WITHIN_BMP); final int[] CODEPOINTS_WITHIN_BMP = StringUtils.toCodePointArray(STR_WITHIN_BMP);
final int[] COORDINATES_WITHIN_BMP = final int[] COORDINATES_WITHIN_BMP =
CoordinateUtils.newCoordinateArray(CODEPOINTS_WITHIN_BMP.length, CoordinateUtils.newCoordinateArray(CODEPOINTS_WITHIN_BMP.length,
Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE); Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE);
final String PREVWORD = "prevword"; final String PREVWORD = "prevword";
wc.setComposingWord(CODEPOINTS_WITHIN_BMP, COORDINATES_WITHIN_BMP, PREVWORD); wc.setComposingWord(CODEPOINTS_WITHIN_BMP, COORDINATES_WITHIN_BMP, PREVWORD);
assertEquals(wc.size(), assertEquals(wc.size(), STR_WITHIN_BMP.codePointCount(0, STR_WITHIN_BMP.length()));
STR_WITHIN_BMP.codePointCount(0, STR_WITHIN_BMP.length()));
assertFalse(wc.isCursorFrontOrMiddleOfComposingWord()); assertFalse(wc.isCursorFrontOrMiddleOfComposingWord());
wc.setCursorPositionWithinWord(2); wc.setCursorPositionWithinWord(2);
assertTrue(wc.isCursorFrontOrMiddleOfComposingWord()); assertTrue(wc.isCursorFrontOrMiddleOfComposingWord());