From 64ee09610024eb1436c51f9c9ef9fc3f77239d73 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 23 Aug 2012 17:29:36 +0900 Subject: [PATCH] Add toString method to InputPointers and ResizableIntArray Change-Id: I835ee131855bef8233cf2672e2fb288b939148a6 --- .../com/android/inputmethod/latin/InputPointers.java | 6 ++++++ .../android/inputmethod/latin/ResizableIntArray.java | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/java/src/com/android/inputmethod/latin/InputPointers.java b/java/src/com/android/inputmethod/latin/InputPointers.java index cbc916a7e..c01a373f2 100644 --- a/java/src/com/android/inputmethod/latin/InputPointers.java +++ b/java/src/com/android/inputmethod/latin/InputPointers.java @@ -124,4 +124,10 @@ public class InputPointers { public int[] getTimes() { return mTimes.getPrimitiveArray(); } + + @Override + public String toString() { + return "size=" + getPointerSize() + " id=" + mPointerIds + " time=" + mTimes + + " x=" + mXCoordinates + " y=" + mYCoordinates; + } } diff --git a/java/src/com/android/inputmethod/latin/ResizableIntArray.java b/java/src/com/android/inputmethod/latin/ResizableIntArray.java index 387d45a53..c660f92c4 100644 --- a/java/src/com/android/inputmethod/latin/ResizableIntArray.java +++ b/java/src/com/android/inputmethod/latin/ResizableIntArray.java @@ -131,4 +131,16 @@ public class ResizableIntArray { mLength = endPos; } } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < mLength; i++) { + if (i != 0) { + sb.append(","); + } + sb.append(mArray[i]); + } + return "[" + sb + "]"; + } }