- Timestamp:
- 04/14/11 16:09:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchCore/src/de/ugoe/cs/eventbench/models/TrieNode.java
r13 r30 26 26 public TrieNode(T symbol) { 27 27 if( symbol==null ) { 28 throw new InvalidParameterException("symbol must not be null. ");28 throw new InvalidParameterException("symbol must not be null. null is reserved for root node!"); 29 29 } 30 30 this.symbol = symbol; … … 120 120 } 121 121 } 122 122 123 void appendDotRepresentation(StringBuilder stringBuilder) { 124 String thisSaneId; 125 if( symbol==null ) { 126 thisSaneId = "root"; 127 } else { 128 thisSaneId = symbol.toString().replace("\"", "\\\"").replaceAll("[\r\n]","")+"#"+count; 129 } 130 stringBuilder.append(" " + hashCode() + " [label=\""+thisSaneId+"\"];" + StringTools.ENDLINE); 131 for( TrieNode<T> childNode : children ) { 132 stringBuilder.append(" "+hashCode()+" -> " + childNode.hashCode() + ";" + StringTools.ENDLINE); 133 } 134 for( TrieNode<T> childNode : children ) { 135 childNode.appendDotRepresentation(stringBuilder); 136 } 137 } 123 138 }
Note: See TracChangeset
for help on using the changeset viewer.