// Copyright 2012 Georg-August-Universität Göttingen, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package de.ugoe.cs.autoquest.usability.util; import java.util.List; import com.google.common.base.CharMatcher; import com.google.common.base.Predicate; import com.google.common.base.Splitter; import com.google.common.collect.HashMultiset; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Multiset; import de.ugoe.cs.autoquest.eventcore.gui.TextInput; import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; /** *
* Util class to handle text input events/tasks. *
* * @author Alexander Deicke */ public class TextInputUtil { private TextInputUtil() { // util class } /** * ** Returns all entered words and signs of all instances of text input events. *
* * @param tasksWithTextInputEvents * tasks with event type {@link TextInput} * @return set of all entered word and signs with unique entries */ public static Multiset* Splits entered text into words and signs. *
* * @param enteredText * entered text (e.g. from text input event) * @return collection of words and signs */ public static Iterable* Determines, if a character is not part of a Java identifier. *
* * @return true, iff no part of Java identifier */ public static Predicate* Determines if the specified character is not a letter or digit. *
* * @return */ public static Predicate