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/TrieNode.java

    r258 r361  
    7878         *            symbol associated with the trie node 
    7979         */ 
    80         public TrieNode(T symbol) { 
     80        TrieNode(T symbol) { 
    8181                if (symbol == null) { 
    8282                        throw new InvalidParameterException( 
     
    8686                count = 0; 
    8787                children = new LinkedList<TrieNode<T>>(); 
     88        } 
     89 
     90        /** 
     91         * <p> 
     92         * Copy-Constructor. Creates a new TrieNode as copy of other. Other must not 
     93         * be null. 
     94         * </p> 
     95         *  
     96         * @param other 
     97         */ 
     98        TrieNode(TrieNode<T> other) { 
     99                if (other == null) { 
     100                        throw new InvalidParameterException("other must not be null"); 
     101                } 
     102                symbol = other.symbol; 
     103                count = other.count; 
     104                children = new LinkedList<TrieNode<T>>(); 
     105                for (TrieNode<T> child : other.children) { 
     106                        children.add(new TrieNode<T>(child)); 
     107                } 
    88108        } 
    89109 
Note: See TracChangeset for help on using the changeset viewer.