Changeset 766 for trunk/quest-core-usageprofiles/src
- Timestamp:
- 09/04/12 17:15:28 (12 years ago)
- Location:
- trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/DeterministicFiniteAutomaton.java
r655 r766 1 1 package de.ugoe.cs.quest.usageprofiles; 2 2 3 import java.security.InvalidParameterException;4 3 import java.util.Collection; 5 4 import java.util.LinkedList; … … 52 51 public double getProbability(List<Event> context, Event symbol) { 53 52 if (context == null) { 54 throw new I nvalidParameterException("context must not be null");53 throw new IllegalArgumentException("context must not be null"); 55 54 } 56 55 if (symbol == null) { 57 throw new I nvalidParameterException("symbol must not be null");56 throw new IllegalArgumentException("symbol must not be null"); 58 57 } 59 58 double result = 0.0d; -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/HighOrderMarkovModel.java
r655 r766 1 1 package de.ugoe.cs.quest.usageprofiles; 2 2 3 import java.security.InvalidParameterException;4 3 import java.util.Collection; 5 4 import java.util.LinkedList; … … 52 51 public double getProbability(List<Event> context, Event symbol) { 53 52 if (context == null) { 54 throw new I nvalidParameterException("context must not be null");53 throw new IllegalArgumentException("context must not be null"); 55 54 } 56 55 if (symbol == null) { 57 throw new I nvalidParameterException("symbol must not be null");56 throw new IllegalArgumentException("symbol must not be null"); 58 57 } 59 58 double result = 0.0d; -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/IStochasticProcess.java
r655 r766 2 2 3 3 import java.io.Serializable; 4 import java.security.InvalidParameterException;5 4 import java.util.Collection; 6 5 import java.util.List; … … 31 30 * @return probabilty the {@code symbol} is the next event, given the last events 32 31 * {@code context} 33 * @throws I nvalidParameterException32 * @throws IllegalArgumentException 34 33 * thrown if context or symbol is null 35 34 */ … … 44 43 * sequences of which the probability is calculated 45 44 * @return probability of the sequences; 1.0 if sequence is empty or null 46 * @throws I nvalidParameterException45 * @throws IllegalArgumentException 47 46 * thrown if sequence is null 48 47 */ … … 90 89 * @return generated sequences 91 90 * @see #generateSequences(int, boolean) 92 * @throws I nvalidParameterException91 * @throws IllegalArgumentException 93 92 * thrown if length is less than or equal to 0 94 93 */ … … 108 107 * if true, all generated sequences start with {@link Event#STARTEVENT} 109 108 * @return generated sequences 110 * @throws I nvalidParameterException109 * @throws IllegalArgumentException 111 110 * thrown if length is less than or equal to 0 112 111 */ … … 123 122 * @param length 124 123 * @return generated sequences 125 * @throws I nvalidParameterException124 * @throws IllegalArgumentException 126 125 * thrown if length is less than or equal to 0 127 126 */ -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/IncompleteMemory.java
r655 r766 1 1 package de.ugoe.cs.quest.usageprofiles; 2 2 3 import java.security.InvalidParameterException;4 3 import java.util.LinkedList; 5 4 import java.util.List; … … 41 40 * @param length 42 41 * number of recent events that are remembered 43 * @throws I nvalidParameterException42 * @throws IllegalArgumentException 44 43 * This exception is thrown if the length is smaller than 1 45 44 */ 46 45 public IncompleteMemory(int length) { 47 46 if (length < 1) { 48 throw new I nvalidParameterException("Length of IncompleteMemory must be at least 1.");47 throw new IllegalArgumentException("Length of IncompleteMemory must be at least 1."); 49 48 } 50 49 this.length = length; -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/PredictionByPartialMatch.java
r655 r766 1 1 package de.ugoe.cs.quest.usageprofiles; 2 2 3 import java.security.InvalidParameterException;4 3 import java.util.Collection; 5 4 import java.util.LinkedList; … … 90 89 * @param probEscape 91 90 * escape probability used by the model 92 * @throws I nvalidParameterException91 * @throws IllegalArgumentException 93 92 * thrown if minOrder is less than 0 or greater than markovOrder or probEscape is 94 93 * not in the interval (0,1) … … 97 96 super(markovOrder, r); 98 97 if (minOrder < 0) { 99 throw new I nvalidParameterException("minOrder must be greather than or equal to 0");98 throw new IllegalArgumentException("minOrder must be greather than or equal to 0"); 100 99 } 101 100 if (minOrder > markovOrder) { 102 throw new I nvalidParameterException(101 throw new IllegalArgumentException( 103 102 "minOrder must be less than or equal to markovOrder"); 104 103 } 105 104 if (probEscape <= 0.0 || probEscape >= 1.0) { 106 throw new I nvalidParameterException("probEscape must be in the interval (0,1)");105 throw new IllegalArgumentException("probEscape must be in the interval (0,1)"); 107 106 } 108 107 this.probEscape = probEscape; … … 147 146 public double getProbability(List<Event> context, Event symbol) { 148 147 if (context == null) { 149 throw new I nvalidParameterException("context must not be null");148 throw new IllegalArgumentException("context must not be null"); 150 149 } 151 150 if (symbol == null) { 152 throw new I nvalidParameterException("symbol must not be null");151 throw new IllegalArgumentException("symbol must not be null"); 153 152 } 154 153 double result = 0.0d; -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/Trie.java
r655 r766 2 2 3 3 import java.io.Serializable; 4 import java.security.InvalidParameterException;5 4 import java.util.Collection; 6 5 import java.util.HashSet; … … 71 70 public Trie(Trie<T> other) { 72 71 if (other == null) { 73 throw new I nvalidParameterException("other trie must not be null");72 throw new IllegalArgumentException("other trie must not be null"); 74 73 } 75 74 rootNode = new TrieNode<T>(other.rootNode); -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/TrieBasedModel.java
r655 r766 1 1 package de.ugoe.cs.quest.usageprofiles; 2 2 3 import java.security.InvalidParameterException;4 3 import java.util.ArrayList; 5 4 import java.util.Collection; … … 66 65 * @param r 67 66 * random number generator used by probabilistic methods of the class 68 * @throws I nvalidParameterException67 * @throws IllegalArgumentException 69 68 * thrown if markovOrder is less than 0 or the random number generator r is null 70 69 */ … … 72 71 super(); 73 72 if (markovOrder < 0) { 74 throw new I nvalidParameterException("markov order must not be less than 0");73 throw new IllegalArgumentException("markov order must not be less than 0"); 75 74 } 76 75 if (r == null) { 77 throw new I nvalidParameterException("random number generator r must not be null");76 throw new IllegalArgumentException("random number generator r must not be null"); 78 77 } 79 78 this.trieOrder = markovOrder + 1; … … 90 89 * @param sequences 91 90 * training data 92 * @throws I nvalidParameterException91 * @throws IllegalArgumentException 93 92 * thrown is sequences is null 94 93 */ … … 107 106 * @param sequences 108 107 * training data 109 * @throws I nvalidParameterException108 * @throws IllegalArgumentException 110 109 * thrown is sequences is null 111 110 */ 112 111 public void update(Collection<List<Event>> sequences) { 113 112 if (sequences == null) { 114 throw new I nvalidParameterException("sequences must not be null");113 throw new IllegalArgumentException("sequences must not be null"); 115 114 } 116 115 if (trie == null) { … … 300 299 Set<List<Event>> sequenceSet = new LinkedHashSet<List<Event>>(); 301 300 if (length < 1) { 302 throw new I nvalidParameterException(301 throw new IllegalArgumentException( 303 302 "Length of generated subsequences must be at least 1."); 304 303 } … … 361 360 public double getProbability(List<Event> sequence) { 362 361 if (sequence == null) { 363 throw new I nvalidParameterException("sequence must not be null");362 throw new IllegalArgumentException("sequence must not be null"); 364 363 } 365 364 double prob = 1.0; -
trunk/quest-core-usageprofiles/src/main/java/de/ugoe/cs/quest/usageprofiles/TrieNode.java
r655 r766 2 2 3 3 import java.io.Serializable; 4 import java.security.InvalidParameterException;5 4 import java.util.Collection; 6 5 import java.util.LinkedList; … … 78 77 TrieNode(T symbol) { 79 78 if (symbol == null) { 80 throw new I nvalidParameterException(79 throw new IllegalArgumentException( 81 80 "symbol must not be null. null is reserved for root node!"); 82 81 } … … 95 94 TrieNode(TrieNode<T> other) { 96 95 if (other == null) { 97 throw new I nvalidParameterException("other must not be null");96 throw new IllegalArgumentException("other must not be null"); 98 97 } 99 98 symbol = other.symbol;
Note: See TracChangeset
for help on using the changeset viewer.