aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/research/LogUnit.java
diff options
context:
space:
mode:
authorKurt Partridge <kep@google.com>2012-11-30 15:18:30 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-30 15:18:30 -0800
commit33d5da590f8b733b7bae980f919705b9d975c568 (patch)
tree242606abecf6831b17a076e82559b2bb4838d90f /java/src/com/android/inputmethod/research/LogUnit.java
parentbdbe279cecea7a16ef2a5c3b62622eb19e4b18bf (diff)
downloadlatinime-33d5da590f8b733b7bae980f919705b9d975c568.tar.gz
latinime-33d5da590f8b733b7bae980f919705b9d975c568.tar.xz
latinime-33d5da590f8b733b7bae980f919705b9d975c568.zip
Revert "ResearchLog. Track time of log statements"
This reverts commit bdbe279cecea7a16ef2a5c3b62622eb19e4b18bf Other half of this change couldn't be committed because of a inter-project directory migration. Reverting until things settle down. Change-Id: I3862fc8485dfca6d507f620e905cfa583aa0e39a
Diffstat (limited to 'java/src/com/android/inputmethod/research/LogUnit.java')
-rw-r--r--java/src/com/android/inputmethod/research/LogUnit.java57
1 files changed, 6 insertions, 51 deletions
diff --git a/java/src/com/android/inputmethod/research/LogUnit.java b/java/src/com/android/inputmethod/research/LogUnit.java
index 5ce2d4883..d8b3a29ff 100644
--- a/java/src/com/android/inputmethod/research/LogUnit.java
+++ b/java/src/com/android/inputmethod/research/LogUnit.java
@@ -18,7 +18,7 @@ package com.android.inputmethod.research;
import com.android.inputmethod.latin.CollectionUtils;
-import java.util.List;
+import java.util.ArrayList;
/**
* A group of log statements related to each other.
@@ -35,39 +35,16 @@ import java.util.List;
* been published recently, or whether the LogUnit contains numbers, etc.
*/
/* package */ class LogUnit {
- private final List<String[]> mKeysList;
- private final List<Object[]> mValuesList;
- // Assume that mTimeList is sorted in increasing order. Do not insert null values into
- // mTimeList.
- private final List<Long> mTimeList;
- private final List<Boolean> mIsPotentiallyPrivate;
+ private final ArrayList<String[]> mKeysList = CollectionUtils.newArrayList();
+ private final ArrayList<Object[]> mValuesList = CollectionUtils.newArrayList();
+ private final ArrayList<Boolean> mIsPotentiallyPrivate = CollectionUtils.newArrayList();
private String mWord;
private boolean mContainsDigit;
- public LogUnit() {
- mKeysList = CollectionUtils.newArrayList();
- mValuesList = CollectionUtils.newArrayList();
- mTimeList = CollectionUtils.newArrayList();
- mIsPotentiallyPrivate = CollectionUtils.newArrayList();
- }
-
- private LogUnit(final List<String[]> keysList, final List<Object[]> valuesList,
- final List<Long> timeList, final List<Boolean> isPotentiallyPrivate) {
- mKeysList = keysList;
- mValuesList = valuesList;
- mTimeList = timeList;
- mIsPotentiallyPrivate = isPotentiallyPrivate;
- }
-
- /**
- * Adds a new log statement. The time parameter in successive calls to this method must be
- * monotonically increasing, or splitByTime() will not work.
- */
public void addLogStatement(final String[] keys, final Object[] values,
- final long time, final boolean isPotentiallyPrivate) {
+ final Boolean isPotentiallyPrivate) {
mKeysList.add(keys);
mValuesList.add(values);
- mTimeList.add(time);
mIsPotentiallyPrivate.add(isPotentiallyPrivate);
}
@@ -75,7 +52,7 @@ import java.util.List;
final int size = mKeysList.size();
for (int i = 0; i < size; i++) {
if (!mIsPotentiallyPrivate.get(i) || isIncludingPrivateData) {
- researchLog.outputEvent(mKeysList.get(i), mValuesList.get(i), mTimeList.get(i));
+ researchLog.outputEvent(mKeysList.get(i), mValuesList.get(i));
}
}
}
@@ -103,26 +80,4 @@ import java.util.List;
public boolean isEmpty() {
return mKeysList.isEmpty();
}
-
- /**
- * Split this logUnit, with all events before maxTime staying in the current logUnit, and all
- * events after maxTime going into a new LogUnit that is returned.
- */
- public LogUnit splitByTime(final long maxTime) {
- // Assume that mTimeList is in sorted order.
- final int length = mTimeList.size();
- for (int index = 0; index < length; index++) {
- if (mTimeList.get(index) >= maxTime) {
- final LogUnit newLogUnit = new LogUnit(
- mKeysList.subList(index, length),
- mValuesList.subList(index, length),
- mTimeList.subList(index, length),
- mIsPotentiallyPrivate.subList(index, length));
- newLogUnit.mWord = null;
- newLogUnit.mContainsDigit = mContainsDigit;
- return newLogUnit;
- }
- }
- return new LogUnit();
- }
}