Changeset 1853 for trunk/autoquest-core-tasktrees/src/main/java/de/ugoe
- Timestamp:
- 12/23/14 11:39:42 (10 years ago)
- Location:
- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskComparator.java
r1401 r1853 22 22 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager; 23 23 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 24 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;25 24 import de.ugoe.cs.autoquest.usageprofiles.SymbolComparator; 26 25 … … 34 33 * </p> 35 34 */ 36 public class Task InstanceComparator implements SymbolComparator<ITaskInstance> {35 public class TaskComparator implements SymbolComparator<ITask> { 37 36 38 37 /** */ … … 76 75 * @param minimalTaskEquality the considered task equality level 77 76 */ 78 public Task InstanceComparator(TaskEquality minimalTaskEquality) {77 public TaskComparator(TaskEquality minimalTaskEquality) { 79 78 this.minimalTaskEquality = minimalTaskEquality; 80 79 init(); 81 80 } 82 81 83 /* (non-Javadoc)84 * @see SymbolComparator#equals(Object, Object)85 */86 @Override87 public boolean equals(ITaskInstance taskInstance1, ITaskInstance taskInstance2) {88 return equals(taskInstance1.getTask(), taskInstance2.getTask());89 }90 91 82 /** 92 83 * <p> … … 99 90 * @return as described 100 91 */ 92 @Override 101 93 public boolean equals(ITask task1, ITask task2) { 102 94 Boolean result; … … 113 105 114 106 if (equalityBuffer.size() < MAX_BUFFER_SIZE) { 115 equalityBuffer.put(key, result);107 //equalityBuffer.put(key, result); 116 108 } 117 109 } -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskHandlingStrategy.java
r1401 r1853 16 16 17 17 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask Instance;18 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 19 19 import de.ugoe.cs.autoquest.usageprofiles.SymbolComparator; 20 20 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap; … … 32 32 * @author Patrick Harms 33 33 */ 34 public class TaskHandlingStrategy implements SymbolStrategy<ITask Instance> {34 public class TaskHandlingStrategy implements SymbolStrategy<ITask> { 35 35 36 36 /** */ … … 49 49 * </p> 50 50 */ 51 private Task InstanceComparator comparator;51 private TaskComparator comparator; 52 52 53 53 /** … … 65 65 } 66 66 else { 67 comparator = new Task InstanceComparator(this.consideredEquality);67 comparator = new TaskComparator(this.consideredEquality); 68 68 } 69 69 } … … 73 73 */ 74 74 @Override 75 public SymbolComparator<ITask Instance> getSymbolComparator() {75 public SymbolComparator<ITask> getSymbolComparator() { 76 76 return comparator; 77 77 } … … 83 83 * </p> 84 84 */ 85 public Task InstanceComparator getTaskComparator() {85 public TaskComparator getTaskComparator() { 86 86 return comparator; 87 87 } … … 91 91 */ 92 92 @Override 93 public <V> SymbolMap<ITask Instance, V> createSymbolMap() {93 public <V> SymbolMap<ITask, V> createSymbolMap() { 94 94 if (consideredEquality == TaskEquality.IDENTICAL) { 95 95 return new TaskSymbolIdentityMap<V>(); … … 104 104 */ 105 105 @Override 106 public <V> SymbolMap<ITask Instance, V> copySymbolMap(SymbolMap<ITaskInstance, V> other) {106 public <V> SymbolMap<ITask, V> copySymbolMap(SymbolMap<ITask, V> other) { 107 107 if (consideredEquality == TaskEquality.IDENTICAL) { 108 108 return new TaskSymbolIdentityMap<V>(other); -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskIdentityComparator.java
r1767 r1853 17 17 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality; 18 18 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 19 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;20 19 21 20 /** … … 25 24 * </p> 26 25 */ 27 class TaskIdentityComparator extends Task InstanceComparator {26 class TaskIdentityComparator extends TaskComparator { 28 27 29 28 /** */ … … 38 37 super(TaskEquality.IDENTICAL); 39 38 } 40 41 /* (non-Javadoc)42 * @see SymbolComparator#equals(Object, Object)43 */44 @Override45 public boolean equals(ITaskInstance taskInstance1, ITaskInstance taskInstance2) {46 return equals(taskInstance1.getTask(), taskInstance2.getTask());47 }48 39 49 40 /* (non-Javadoc) -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrie.java
r1401 r1853 19 19 import java.util.List; 20 20 import java.util.Map; 21 import java.util.logging.Level; 21 22 22 23 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; … … 26 27 import de.ugoe.cs.autoquest.usageprofiles.Trie; 27 28 import de.ugoe.cs.autoquest.usageprofiles.TrieProcessor; 29 import de.ugoe.cs.util.console.Console; 28 30 29 31 /** … … 39 41 * @author Patrick Harms 40 42 */ 41 class TaskInstanceTrie extends Trie<ITask Instance> {43 class TaskInstanceTrie extends Trie<ITask> { 42 44 43 45 /** */ … … 77 79 } 78 80 79 SymbolMap<ITask Instance, Counter> equalTaskInstancesMap =81 SymbolMap<ITask, Counter> equalTaskInstancesMap = 80 82 taskStrategy.createSymbolMap(); 81 83 82 84 Map<ITask, Counter> instanceCountMap = new HashMap<ITask, Counter>(); 83 85 84 System.out.println("preparing training");86 Console.traceln(Level.FINEST, "preparing training"); 85 87 int noOfTaskInstances = 0; 86 88 for (IUserSession session : userSessions) { 87 89 for (ITaskInstance taskInstance : session) { 88 Counter counter = equalTaskInstancesMap.getValue(taskInstance );90 Counter counter = equalTaskInstancesMap.getValue(taskInstance.getTask()); 89 91 90 92 if (counter == null) { 91 93 counter = new Counter(); 92 equalTaskInstancesMap.addSymbol(taskInstance , counter);94 equalTaskInstancesMap.addSymbol(taskInstance.getTask(), counter); 93 95 } 94 96 … … 100 102 } 101 103 102 System.out.println("performing training of " + noOfTaskInstances + " task instances"); 104 Console.traceln 105 (Level.FINEST, "performing training of " + noOfTaskInstances + " task instances"); 106 103 107 Counter processedTaskInstances = new Counter(); 104 108 int counterRecheckAt = noOfTaskInstances / 10; // recheck the maximum count after each … … 146 150 int counterRecheckAt) 147 151 { 148 List<ITask Instance> subsequence = new LinkedList<ITaskInstance>();152 List<ITask> subsequence = new LinkedList<ITask>(); 149 153 150 154 int sequenceMaxCount = 0; … … 172 176 } 173 177 else { 174 subsequence.add(currentTaskInstance );178 subsequence.add(currentTaskInstance.getTask()); 175 179 176 180 if (subsequence.size() == maxOrder) { … … 211 215 * @author Patrick Harms 212 216 */ 213 private static class MaxSequenceCountFinder implements TrieProcessor<ITask Instance> {217 private static class MaxSequenceCountFinder implements TrieProcessor<ITask> { 214 218 215 219 /** … … 224 228 */ 225 229 @Override 226 public TrieProcessor.Result process(List<ITask Instance> foundTask, int count) {230 public TrieProcessor.Result process(List<ITask> foundTask, int count) { 227 231 if (foundTask.size() == 2) { 228 232 this.currentCount = Math.max(this.currentCount, count); -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolBucketedMap.java
r1408 r1853 27 27 28 28 import de.ugoe.cs.autoquest.eventcore.Event; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; 29 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIterationInstance; 31 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance; 32 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequenceInstance; 31 import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; 32 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; 33 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; 34 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; 35 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 33 36 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; 34 37 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap; … … 56 59 * @param <V> 57 60 */ 58 class TaskSymbolBucketedMap<V> implements SymbolMap<ITask Instance, V>, Serializable {61 class TaskSymbolBucketedMap<V> implements SymbolMap<ITask, V>, Serializable { 59 62 60 63 /** … … 78 81 * </p> 79 82 */ 80 private Task InstanceComparator comparator;83 private TaskComparator comparator; 81 84 82 85 /** … … 85 88 * </p> 86 89 */ 87 private List<Map.Entry<ITask Instance, V>> symbolList;90 private List<Map.Entry<ITask, V>> symbolList; 88 91 89 92 /** … … 93 96 * </p> 94 97 */ 95 private Map<Integer, List<Map.Entry<ITask Instance, V>>> symbolBuckets;98 private Map<Integer, List<Map.Entry<ITask, V>>> symbolBuckets; 96 99 97 100 /** … … 113 116 * @throws IllegalArgumentException if the provided comparator is null 114 117 */ 115 public TaskSymbolBucketedMap(Task InstanceComparator comparator) {118 public TaskSymbolBucketedMap(TaskComparator comparator) { 116 119 if (comparator == null) { 117 120 throw new IllegalArgumentException("comparator must not be null"); … … 119 122 120 123 this.comparator = comparator; 121 this.symbolList = new ArrayList<Map.Entry<ITask Instance, V>>();124 this.symbolList = new ArrayList<Map.Entry<ITask, V>>(); 122 125 } 123 126 … … 137 140 138 141 this.comparator = otherMap.comparator; 139 this.symbolList = new ArrayList<Map.Entry<ITask Instance, V>>(otherMap.symbolList);142 this.symbolList = new ArrayList<Map.Entry<ITask, V>>(otherMap.symbolList); 140 143 141 144 if (this.symbolList.size() > MAX_LIST_SIZE) { … … 177 180 * @throws IllegalArgumentException if the provided task instance is null 178 181 */ 179 public boolean containsSymbol(ITask Instancesymbol) {182 public boolean containsSymbol(ITask symbol) { 180 183 if (symbol == null) { 181 184 throw new IllegalArgumentException("symbol must not be null"); … … 198 201 * @throws IllegalArgumentException if the provided task instance is null 199 202 */ 200 public V getValue(ITask Instancesymbol) {203 public V getValue(ITask symbol) { 201 204 if (symbol == null) { 202 205 throw new IllegalArgumentException("symbol must not be null"); 203 206 } 204 207 205 Map.Entry<ITask Instance, V> entry = getEntry(symbol);208 Map.Entry<ITask, V> entry = getEntry(symbol); 206 209 207 210 if (entry != null) { … … 230 233 * @throws IllegalArgumentException if the provided task instance is null 231 234 */ 232 public void addSymbol(ITask Instancesymbol, V value) {235 public void addSymbol(ITask symbol, V value) { 233 236 if (symbol == null) { 234 237 throw new IllegalArgumentException("symbol must not be null"); 235 238 } 236 239 237 Map.Entry<ITask Instance, V> entry = new SymbolMapEntry(symbol, value);240 Map.Entry<ITask, V> entry = new SymbolMapEntry(symbol, value); 238 241 239 242 symbolList.add(entry); … … 261 264 * @throws IllegalArgumentException if the provided task instance is null 262 265 */ 263 public V removeSymbol(ITask Instancesymbol) {266 public V removeSymbol(ITask symbol) { 264 267 if (symbol == null) { 265 268 throw new IllegalArgumentException("symbol must not be null"); … … 289 292 * @return as described 290 293 */ 291 public Collection<ITask Instance> getSymbols() {292 return new ReadOnlyCollectionFacade<ITask Instance>(symbolList, new SymbolFacade());294 public Collection<ITask> getSymbols() { 295 return new ReadOnlyCollectionFacade<ITask>(symbolList, new SymbolFacade()); 293 296 } 294 297 … … 351 354 */ 352 355 private void createSymbolBuckets() { 353 //System.out.println("creating symbol buckets"); 354 symbolBuckets = new HashMap<Integer, List<Map.Entry<ITaskInstance, V>>>(); 355 356 for (Map.Entry<ITaskInstance, V> symbol : symbolList) { 356 symbolBuckets = new HashMap<Integer, List<Map.Entry<ITask, V>>>(); 357 358 for (Map.Entry<ITask, V> symbol : symbolList) { 357 359 addToSymbolBucket(symbol); 358 360 } … … 368 370 * </p> 369 371 */ 370 private void addToSymbolBucket(Map.Entry<ITask Instance, V> symbolEntry) {372 private void addToSymbolBucket(Map.Entry<ITask, V> symbolEntry) { 371 373 int bucketId = defaultBucket; 372 374 int[] bucketSearchOrder = getBucketSearchOrder(symbolEntry.getKey()); … … 380 382 } 381 383 382 List<Map.Entry<ITask Instance, V>> list = symbolBuckets.get(bucketId);384 List<Map.Entry<ITask, V>> list = symbolBuckets.get(bucketId); 383 385 384 386 if (list == null) { 385 list = new LinkedList<Map.Entry<ITask Instance, V>>();387 list = new LinkedList<Map.Entry<ITask, V>>(); 386 388 symbolBuckets.put(bucketId, list); 387 389 } … … 396 398 * </p> 397 399 */ 398 private int[] getBucketSearchOrder(ITask Instance taskInstance) {400 private int[] getBucketSearchOrder(ITask task) { 399 401 // 0 = sequence; 1 = selection; 2 = iteration; 3 = optional; 4 = event task in general; 400 402 // other = hashCode of name of event type 401 403 402 if (task Instance instanceof IEventTaskInstance) {404 if (task instanceof IEventTask) { 403 405 // event tasks are most likely equal to those of the same type happening on the same 404 406 // target. Afterwards, they should be equal to those of the event type with the same 405 407 // name. Afterwards, they may be equal to iterations, optionals, other event tasks, 406 408 // selections, and finally the rest. 407 Event event = ((IEventTaskInstance) taskInstance).getEvent(); 408 return new int[] { event.getTarget().hashCode() + event.getType().getName().hashCode(), 409 event.getType().getName().hashCode(), 2, 3, 4, 1 }; 410 } 411 else if (taskInstance instanceof ISequenceInstance) { 409 410 if (task.getInstances().iterator().hasNext()) { 411 Event event = 412 ((IEventTaskInstance) ((IEventTask) task).getInstances().iterator().next()).getEvent(); 413 414 return new int[] { event.getTarget().hashCode() + event.getType().getName().hashCode(), 415 event.getType().getName().hashCode(), 2, 3, 4, 1 }; 416 } 417 else { 418 return new int[] { 4, 2, 3, 1 }; 419 } 420 } 421 else if (task instanceof ISequence) { 412 422 return new int[] { 0, 2, 3, 1 }; 413 423 } 414 else if (task Instance instanceof ISelectionInstance) {424 else if (task instanceof ISelection) { 415 425 return new int[] { 1, 4, 2, 3 }; 416 426 } 417 else if (task Instance instanceof IIterationInstance) {427 else if (task instanceof IIteration) { 418 428 return new int[] { 2, 1, 4 }; 429 } 430 else if (task instanceof IOptional) { 431 return new int[] { 3, 4, 2, 1, 0 }; 419 432 } 420 433 … … 428 441 * </p> 429 442 */ 430 private Map.Entry<ITask Instance, V> removeFromSymbolBuckets(ITaskInstancesymbol) {443 private Map.Entry<ITask, V> removeFromSymbolBuckets(ITask symbol) { 431 444 int bucketId = defaultBucket; 432 445 int[] bucketSearchOrder = getBucketSearchOrder(symbol); … … 436 449 } 437 450 438 List<Map.Entry<ITask Instance, V>> list = symbolBuckets.get(bucketId);439 Map.Entry<ITask Instance, V> result = null;451 List<Map.Entry<ITask, V>> list = symbolBuckets.get(bucketId); 452 Map.Entry<ITask, V> result = null; 440 453 441 454 if (list != null) { … … 479 492 * </p> 480 493 */ 481 private Map.Entry<ITask Instance, V> getEntry(ITaskInstancesymbol) {482 Map.Entry<ITask Instance, V> entry = null;494 private Map.Entry<ITask, V> getEntry(ITask symbol) { 495 Map.Entry<ITask, V> entry = null; 483 496 if (symbolBuckets == null) { 484 497 entry = lookup(symbol, symbolList); … … 487 500 int[] bucketSearchOrder = getBucketSearchOrder(symbol); 488 501 for (int bucketId : bucketSearchOrder) { 489 List<Map.Entry<ITask Instance, V>> list = symbolBuckets.get(bucketId);502 List<Map.Entry<ITask, V>> list = symbolBuckets.get(bucketId); 490 503 if (list != null) { 491 504 entry = lookup(symbol, list); … … 499 512 if (entry == null) { 500 513 Arrays.sort(bucketSearchOrder); 501 for (Map.Entry<Integer, List<Map.Entry<ITask Instance, V>>> bucket : symbolBuckets.entrySet()) {514 for (Map.Entry<Integer, List<Map.Entry<ITask, V>>> bucket : symbolBuckets.entrySet()) { 502 515 if (Arrays.binarySearch(bucketSearchOrder, bucket.getKey()) < 0) { 503 List<Map.Entry<ITask Instance, V>> list = bucket.getValue();516 List<Map.Entry<ITask, V>> list = bucket.getValue(); 504 517 if (list != null) { 505 518 entry = lookup(symbol, list); … … 521 534 * </p> 522 535 */ 523 private Map.Entry<ITask Instance, V> lookup(ITaskInstance symbol, List<Map.Entry<ITaskInstance, V>> list) {524 for (Map.Entry<ITask Instance, V> candidate : list) {536 private Map.Entry<ITask, V> lookup(ITask symbol, List<Map.Entry<ITask, V>> list) { 537 for (Map.Entry<ITask, V> candidate : list) { 525 538 if (comparator.equals(candidate.getKey(), symbol)) { 526 539 return candidate; … … 538 551 * @author Patrick Harms 539 552 */ 540 private class SymbolMapEntry implements Map.Entry<ITask Instance, V> {553 private class SymbolMapEntry implements Map.Entry<ITask, V> { 541 554 542 555 /** 543 556 * the task instance to map to a value 544 557 */ 545 private ITask Instancesymbol;558 private ITask symbol; 546 559 547 560 /** … … 556 569 * </p> 557 570 */ 558 private SymbolMapEntry(ITask Instancesymbol, V value) {571 private SymbolMapEntry(ITask symbol, V value) { 559 572 super(); 560 573 this.symbol = symbol; … … 566 579 */ 567 580 @Override 568 public ITask InstancegetKey() {581 public ITask getKey() { 569 582 return symbol; 570 583 } … … 640 653 * the list facaded by this facade 641 654 */ 642 private List<Map.Entry<ITask Instance, V>> list;655 private List<Map.Entry<ITask, V>> list; 643 656 644 657 /** … … 652 665 * </p> 653 666 */ 654 private ReadOnlyCollectionFacade(List<Map.Entry<ITask Instance, V>> list,655 EntryFacade<TYPE> 667 private ReadOnlyCollectionFacade(List<Map.Entry<ITask, V>> list, 668 EntryFacade<TYPE> entryFacade) 656 669 { 657 670 this.list = list; … … 681 694 public boolean contains(Object o) { 682 695 if (o == null) { 683 for (Map.Entry<ITask Instance, V> entry : list) {696 for (Map.Entry<ITask, V> entry : list) { 684 697 if (entryFacade.getFacadedElement(entry) == null) { 685 698 return true; … … 688 701 } 689 702 else { 690 for (Map.Entry<ITask Instance, V> entry : list) {703 for (Map.Entry<ITask, V> entry : list) { 691 704 if (o.equals(entryFacade.getFacadedElement(entry))) { 692 705 return true; … … 812 825 * the facaded iterator 813 826 */ 814 private Iterator<Map.Entry<ITask Instance, V>> iterator;827 private Iterator<Map.Entry<ITask, V>> iterator; 815 828 816 829 /** … … 825 838 * </p> 826 839 */ 827 private ReadOnlyCollectionIteratorFacade(Iterator<Map.Entry<ITask Instance, V>> iterator,828 EntryFacade<TYPE> 840 private ReadOnlyCollectionIteratorFacade(Iterator<Map.Entry<ITask, V>> iterator, 841 EntryFacade<TYPE> entryFacade) 829 842 { 830 843 this.iterator = iterator; … … 877 890 * @return the part of the entry to be returned 878 891 */ 879 protected abstract T getFacadedElement(Entry<ITask Instance, V> entry);892 protected abstract T getFacadedElement(Entry<ITask, V> entry); 880 893 881 894 } … … 888 901 * @author Patrick Harms 889 902 */ 890 private class SymbolFacade extends EntryFacade<ITask Instance> {903 private class SymbolFacade extends EntryFacade<ITask> { 891 904 892 905 /* (non-Javadoc) … … 894 907 */ 895 908 @Override 896 protected ITask Instance getFacadedElement(Entry<ITaskInstance, V> entry) {909 protected ITask getFacadedElement(Entry<ITask, V> entry) { 897 910 return entry.getKey(); 898 911 } … … 913 926 */ 914 927 @Override 915 protected V getFacadedElement(Entry<ITask Instance, V> entry) {928 protected V getFacadedElement(Entry<ITask, V> entry) { 916 929 return entry.getValue(); 917 930 } -
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolIdentityMap.java
r1401 r1853 20 20 21 21 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 22 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;23 22 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap; 24 23 … … 31 30 * @author Patrick Harms 32 31 */ 33 public class TaskSymbolIdentityMap<V> implements SymbolMap<ITask Instance, V> {32 public class TaskSymbolIdentityMap<V> implements SymbolMap<ITask, V> { 34 33 35 34 /** */ … … 48 47 * </p> 49 48 */ 50 private Map<ITask, ITask Instance> symbols;49 private Map<ITask, ITask> symbols; 51 50 52 51 /** … … 57 56 public TaskSymbolIdentityMap() { 58 57 delegate = new HashMap<ITask, V>(); 59 symbols = new HashMap<ITask, ITask Instance>();58 symbols = new HashMap<ITask, ITask>(); 60 59 } 61 60 … … 67 66 * @param other the map to be copied 68 67 */ 69 public TaskSymbolIdentityMap(SymbolMap<ITask Instance, V> other) {68 public TaskSymbolIdentityMap(SymbolMap<ITask, V> other) { 70 69 if (other == null) { 71 70 throw new IllegalArgumentException("other map must not be null"); … … 73 72 74 73 delegate = new HashMap<ITask, V>(); 75 symbols = new HashMap<ITask, ITask Instance>();74 symbols = new HashMap<ITask, ITask>(); 76 75 77 for (ITask Instancesymbol : other.getSymbols()) {78 delegate.put(symbol .getTask(), other.getValue(symbol));79 symbols.put(symbol .getTask(), symbol);76 for (ITask symbol : other.getSymbols()) { 77 delegate.put(symbol, other.getValue(symbol)); 78 symbols.put(symbol, symbol); 80 79 } 81 80 } … … 101 100 */ 102 101 @Override 103 public boolean containsSymbol(ITask Instancesymbol) {102 public boolean containsSymbol(ITask symbol) { 104 103 if (symbol == null) { 105 104 throw new IllegalArgumentException("symbol must not be null"); 106 105 } 107 106 108 return delegate.containsKey(symbol .getTask());107 return delegate.containsKey(symbol); 109 108 } 110 109 … … 113 112 */ 114 113 @Override 115 public V getValue(ITask Instancesymbol) {114 public V getValue(ITask symbol) { 116 115 if (symbol == null) { 117 116 throw new IllegalArgumentException("symbol must not be null"); 118 117 } 119 118 120 return delegate.get(symbol .getTask());119 return delegate.get(symbol); 121 120 } 122 121 … … 125 124 */ 126 125 @Override 127 public void addSymbol(ITask Instancesymbol, V value) {126 public void addSymbol(ITask symbol, V value) { 128 127 if (symbol == null) { 129 128 throw new IllegalArgumentException("symbol must not be null"); 130 129 } 131 130 132 delegate.put(symbol .getTask(), value);133 symbols.put(symbol .getTask(), symbol);131 delegate.put(symbol, value); 132 symbols.put(symbol, symbol); 134 133 } 135 134 … … 138 137 */ 139 138 @Override 140 public V removeSymbol(ITask Instancesymbol) {139 public V removeSymbol(ITask symbol) { 141 140 if (symbol == null) { 142 141 throw new IllegalArgumentException("symbol must not be null"); 143 142 } 144 143 145 symbols.remove(symbol .getTask());146 return delegate.remove(symbol .getTask());144 symbols.remove(symbol); 145 return delegate.remove(symbol); 147 146 } 148 147 … … 151 150 */ 152 151 @Override 153 public Collection<ITask Instance> getSymbols() {152 public Collection<ITask> getSymbols() { 154 153 return symbols.values(); 155 154 }
Note: See TracChangeset
for help on using the changeset viewer.