Changeset 1217 for trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util
- Timestamp:
- 06/06/13 17:08:25 (11 years ago)
- Location:
- trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/NullTask.java
r1163 r1217 22 22 /** 23 23 * <p> 24 * TODO comment24 * Implementation of Null Object pattern {@link http://en.wikipedia.org/wiki/Null_Object_pattern}. 25 25 * </p> 26 26 * … … 29 29 public class NullTask implements ITask { 30 30 31 /** */32 31 private static final long serialVersionUID = 1236779392413787860L; 33 32 34 /* (non-Javadoc) 33 /* 34 * (non-Javadoc) 35 * 35 36 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITask#getId() 36 37 */ … … 39 40 return -1; 40 41 } 41 42 /* (non-Javadoc) 42 43 /* 44 * (non-Javadoc) 45 * 43 46 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#getName() 44 47 */ … … 47 50 } 48 51 49 /* (non-Javadoc) 52 /* 53 * (non-Javadoc) 54 * 50 55 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#getDescription() 51 56 */ … … 54 59 } 55 60 56 /* (non-Javadoc) 57 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#equals(de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode) 61 /* 62 * (non-Javadoc) 63 * 64 * @see 65 * de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#equals(de.ugoe.cs.autoquest.tasktrees 66 * .treeifc.ITaskTreeNode) 58 67 */ 59 68 public boolean equals(ITask task) { 60 69 return false; 61 70 } 62 63 /* (non-Javadoc) 71 72 /* 73 * (non-Javadoc) 74 * 64 75 * @see java.lang.Object#clone() 65 76 */ … … 69 80 } 70 81 71 /* (non-Javadoc) 72 * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#accept(de.ugoe.cs.autoquest.tasktrees.treeifc.NodeVisitor) 82 /* 83 * (non-Javadoc) 84 * 85 * @see 86 * de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#accept(de.ugoe.cs.autoquest.tasktrees 87 * .treeifc.NodeVisitor) 73 88 */ 74 89 public void accept(ITaskVisitor visitor) { 75 90 // do nothing 76 91 } 77 92 78 93 } 79 -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/PatternsVisitorUtil.java
r1164 r1217 15 15 package de.ugoe.cs.autoquest.usability.util; 16 16 17 import java.util. List;17 import java.util.Collection; 18 18 19 19 import com.google.common.collect.Iterables; 20 20 21 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; 23 import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession; 24 import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory; 22 import de.ugoe.cs.autoquest.usability.rules.patterns.InteractionPatternVisitor; 25 23 26 24 /** 27 25 * <p> 28 * TODO comment26 * Util class for {@link InteractionPatternVisitor}. 29 27 * </p> 30 28 * … … 36 34 // no instantiation 37 35 } 38 36 39 37 /** 40 38 * <p> 41 * TODO: comment39 * Gets the first sub task. 42 40 * </p> 43 * 44 * @param taskTreeNode 45 * @return 41 * 42 * @param tasks 43 * collection of tasks 44 * @return first sub task 46 45 */ 47 public static ITaskModel createTaskModelFromUserSessions(List<IUserSession> userSessions) { 48 return new TaskFactory().createTaskModel(userSessions); 49 } 50 51 /** 52 * <p> 53 * TODO: comment 54 * </p> 55 * 56 * @param taskTreeNodes 57 * @return 58 */ 59 public static ITask firstNodeOf(List<ITask> tasks) { 46 public static ITask firstSubtaskOf(Collection<ITask> tasks) { 60 47 return Iterables.getFirst(tasks, new NullTask()); 61 48 } … … 63 50 /** 64 51 * <p> 65 * TODO: comment52 * Gets the last sub task. 66 53 * </p> 67 * 68 * @param taskTreeNodes 69 * @return 54 * 55 * @param tasks 56 * collection of tasks 57 * @return last sub task 70 58 */ 71 public static ITask last NodeOf(List<ITask> tasks) {59 public static ITask lastSubTaskOf(Collection<ITask> tasks) { 72 60 return Iterables.getLast(tasks, new NullTask()); 73 61 } 74 62 75 63 } -
trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/TextInputUtil.java
r1152 r1217 31 31 /** 32 32 * <p> 33 * TODO comment33 * Util class to handle text input events/tasks. 34 34 * </p> 35 35 * … … 42 42 } 43 43 44 /** 45 * 46 * <p> 47 * Returns all entered words and signs of text input events. 48 * </p> 49 * 50 * @param tasksWithTextInputEvents 51 * tasks with event type {@link TextInput} 52 * @return set of all entered word and signs with unique entries 53 */ 44 54 public static Multiset<String> aggregateEnteredTextFromTextInputs(List<ITask> tasksWithTextInputEvents) 45 55 { … … 52 62 } 53 63 64 /** 65 * 66 * <p> 67 * Splits entered text into words and signs. 68 * </p> 69 * 70 * @param enteredText 71 * entered text (e.g. from text input event) 72 * @return collection of words and signs 73 */ 54 74 public static Iterable<String> splitTextIntoWordsAndSigns(String enteredText) { 55 75 CharMatcher onlyWords = 56 CharMatcher.WHITESPACE.or(CharMatcher 57 .forPredicate(characterIsJavaIdentifierPartPredicate())); 76 CharMatcher.WHITESPACE.or(CharMatcher.forPredicate(characterIsNoJavaIdentifierPart())); 58 77 CharMatcher onlySigns = 59 CharMatcher.WHITESPACE.or(CharMatcher 60 . forPredicate(characterIsJavaIdentifierPartPredicate()).negate());78 CharMatcher.WHITESPACE.or(CharMatcher.forPredicate(characterIsNoJavaIdentifierPart()) 79 .negate()); 61 80 Iterable<String> words = 62 81 Splitter.on(onlyWords).omitEmptyStrings().trimResults().split(enteredText); … … 66 85 } 67 86 68 public static Predicate<Character> characterIsJavaIdentifierPartPredicate() { 87 /** 88 * 89 * <p> 90 * Determines, if a character is not part of a Java identifier. 91 * </p> 92 * 93 * @return true, iff no part of Java identifier 94 */ 95 public static Predicate<Character> characterIsNoJavaIdentifierPart() { 69 96 return new Predicate<Character>() { 70 97 … … 77 104 } 78 105 79 public static Predicate<Character> characterIsLetterOrDigitPredicate() { 106 /** 107 * 108 * <p> 109 * Determines if the specified character is not a letter or digit. 110 * </p> 111 * 112 * @return 113 */ 114 public static Predicate<Character> characterIsNoLetterOrDigitPredicate() { 80 115 return new Predicate<Character>() { 81 116
Note: See TracChangeset
for help on using the changeset viewer.