Ignore:
Timestamp:
01/27/12 14:42:36 (12 years ago)
Author:
sherbold
Message:
  • implemented copy-constructors for de.ugoe.cs.eventbench.models.Trie/TrieNode?
  • de.ugoe.cs.eventbench.ModelFlatterner? now handles high order markov models that are really first order markov models better (copies the internal trie directly)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/Trie.java

    r316 r361  
    22 
    33import java.io.Serializable; 
     4import java.security.InvalidParameterException; 
    45import java.util.Collection; 
    56import java.util.HashSet; 
     
    6465        /** 
    6566         * <p> 
     67         * Copy-Constructor. Creates a new Trie as the copy of other. The other trie 
     68         * must noch be null. 
     69         * </p> 
     70         *  
     71         * @param other 
     72         *            Trie that is copied 
     73         */ 
     74        public Trie(Trie<T> other) { 
     75                if (other == null) { 
     76                        throw new InvalidParameterException("other trie must not be null"); 
     77                } 
     78                rootNode = new TrieNode<T>(other.rootNode); 
     79                knownSymbols = new LinkedHashSet<T>(other.knownSymbols); 
     80        } 
     81 
     82        /** 
     83         * <p> 
    6684         * Returns a collection of all symbols occuring in the trie. 
    6785         * </p> 
     
    251269        public List<T> getContextSuffix(List<T> context) { 
    252270                List<T> contextSuffix; 
    253                 if( context!=null ) { 
     271                if (context != null) { 
    254272                        contextSuffix = new LinkedList<T>(context); // defensive copy 
    255273                } else { 
Note: See TracChangeset for help on using the changeset viewer.