aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/event/CombinerChain.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-06-30 23:22:28 +0900
committerJean Chalard <jchalard@google.com>2014-07-29 17:40:48 +0900
commit1db3d860ca0d7380c5a6a3a0f95751565f23043b (patch)
treecefe60ae9915562451180337c3ff5bad606e2f51 /java/src/com/android/inputmethod/event/CombinerChain.java
parent179f38cc8c79ee4f1d94a1ddc37a7644a263e4c1 (diff)
downloadlatinime-1db3d860ca0d7380c5a6a3a0f95751565f23043b.tar.gz
latinime-1db3d860ca0d7380c5a6a3a0f95751565f23043b.tar.xz
latinime-1db3d860ca0d7380c5a6a3a0f95751565f23043b.zip
[HW6] Split processing and applying the event.
If anyone has better names for those... Change-Id: Ia2dfc75381816bd688948647e2c50c10657b9e89
Diffstat (limited to 'java/src/com/android/inputmethod/event/CombinerChain.java')
-rw-r--r--java/src/com/android/inputmethod/event/CombinerChain.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/event/CombinerChain.java b/java/src/com/android/inputmethod/event/CombinerChain.java
index 61bc11b39..8c6b3d949 100644
--- a/java/src/com/android/inputmethod/event/CombinerChain.java
+++ b/java/src/com/android/inputmethod/event/CombinerChain.java
@@ -81,11 +81,11 @@ public class CombinerChain {
}
/**
- * Pass a new event through the whole chain.
+ * Process an event through the combining chain, and return a processed event to apply.
* @param previousEvents the list of previous events in this composition
* @param newEvent the new event to process
*/
- public void processEvent(final ArrayList<Event> previousEvents, final Event newEvent) {
+ public Event processEvent(final ArrayList<Event> previousEvents, final Event newEvent) {
final ArrayList<Event> modifiablePreviousEvents = new ArrayList<>(previousEvents);
Event event = newEvent;
for (final Combiner combiner : mCombiners) {
@@ -97,6 +97,14 @@ public class CombinerChain {
break;
}
}
+ return event;
+ }
+
+ /**
+ * Apply a processed event.
+ * @param event the event to be applied
+ */
+ public void applyProcessedEvent(final Event event) {
if (null != event) {
// TODO: figure out the generic way of doing this
if (Constants.CODE_DELETE == event.mKeyCode) {