- Timestamp:
- 02/19/13 09:41:27 (12 years ago)
- Location:
- trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlDocument.java
r1075 r1089 45 45 46 46 /** 47 * the hash code of this document 48 */ 49 private int hashCode; 50 51 /** 47 52 * <p> 48 53 * instantiates a new document element … … 74 79 this.query = "?" + this.query; 75 80 } 81 82 this.hashCode = this.server.hashCode() + this.path.hashCode() + 83 (this.query != null ? this.query.hashCode() : 0) + 84 (this.title != null ? this.title.hashCode() : 0); 76 85 } 77 86 … … 138 147 @Override 139 148 public int hashCode() { 140 return server.hashCode() + path.hashCode() + (query != null ? query.hashCode() : 0) + 141 (title != null ? title.hashCode() : 0); 149 return hashCode; 142 150 } 143 151 -
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
r1069 r1089 21 21 import java.io.PrintWriter; 22 22 import java.text.DecimalFormat; 23 import java.util.HashSet; 24 import java.util.Set; 23 25 24 26 import de.ugoe.cs.util.StringTools; … … 62 64 63 65 /** 64 * the i sof the client of which all messages are logged through this writer66 * the id of the client of which all messages are logged through this writer 65 67 */ 66 68 private String clientId; … … 80 82 */ 81 83 private long lastUpdate; 84 85 /** 86 * the GUI elements, that were already logged and need therefore not be logged again into 87 * the same file 88 */ 89 private Set<HtmlGUIElement> loggedGUIElements = new HashSet<HtmlGUIElement>(); 82 90 83 91 /** … … 215 223 */ 216 224 private void dumpGuiStructure(HtmlGUIElement guiStructure) { 217 outputWriter.print("<component id=\""); 218 outputWriter.print(guiStructure.getId()); 219 outputWriter.println("\">"); 220 221 if (guiStructure instanceof HtmlServer) { 222 dumpParam("host", ((HtmlServer) guiStructure).getName()); 223 dumpParam("port", ((HtmlServer) guiStructure).getPort()); 224 } 225 else if (guiStructure instanceof HtmlDocument) { 226 dumpParam("path", ((HtmlDocument) guiStructure).getPath()); 227 dumpParam("query", ((HtmlDocument) guiStructure).getQuery()); 228 dumpParam("title", ((HtmlDocument) guiStructure).getTitle()); 229 } 230 else if (guiStructure instanceof HtmlPageElement) { 231 dumpParam("tagname", ((HtmlPageElement) guiStructure).getTagName()); 232 dumpParam("htmlid", ((HtmlPageElement) guiStructure).getHtmlId()); 233 dumpParam("index", ((HtmlPageElement) guiStructure).getIndex()); 234 } 235 236 dumpParam("parent", guiStructure.getParentId()); 237 238 outputWriter.println("</component>"); 225 if (!loggedGUIElements.contains(guiStructure)) { 226 outputWriter.print("<component id=\""); 227 outputWriter.print(guiStructure.getId()); 228 outputWriter.println("\">"); 229 230 if (guiStructure instanceof HtmlServer) { 231 dumpParam("host", ((HtmlServer) guiStructure).getName()); 232 dumpParam("port", ((HtmlServer) guiStructure).getPort()); 233 } 234 else if (guiStructure instanceof HtmlDocument) { 235 dumpParam("path", ((HtmlDocument) guiStructure).getPath()); 236 dumpParam("query", ((HtmlDocument) guiStructure).getQuery()); 237 dumpParam("title", ((HtmlDocument) guiStructure).getTitle()); 238 } 239 else if (guiStructure instanceof HtmlPageElement) { 240 dumpParam("tagname", ((HtmlPageElement) guiStructure).getTagName()); 241 dumpParam("htmlid", ((HtmlPageElement) guiStructure).getHtmlId()); 242 dumpParam("index", ((HtmlPageElement) guiStructure).getIndex()); 243 } 244 245 dumpParam("parent", guiStructure.getParentId()); 246 247 outputWriter.println("</component>"); 248 249 loggedGUIElements.add(guiStructure); 250 } 239 251 240 252 if (guiStructure.getChildren() != null) { … … 369 381 outputWriter.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); 370 382 outputWriter.println("<session>"); 383 384 loggedGUIElements.clear(); 371 385 } 372 386 -
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlPageElement.java
r1075 r1089 51 51 52 52 /** 53 * the hash code of this document 54 */ 55 private int hashCode; 56 57 /** 53 58 * <p> 54 59 * instantiates a new element representing a tag in an HTML page … … 89 94 this.htmlId = htmlId; 90 95 this.index = index; 96 97 this.hashCode = this.document.hashCode() + this.tagName.hashCode() + 98 (this.parent != null ? this.parent.hashCode() : 0) + 99 (this.htmlId != null ? this.htmlId.hashCode() : 0) + 100 (this.index != null ? this.index : 0); 91 101 } 92 102 … … 203 213 @Override 204 214 public int hashCode() { 205 return document.hashCode() + tagName.hashCode() + (parent != null ? parent.hashCode() : 0) + 206 (htmlId != null ? htmlId.hashCode() : 0) + (index != null ? index : 0); 215 return hashCode; 207 216 } 208 217 -
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlServer.java
r1075 r1089 35 35 36 36 /** 37 * the hash code of this document 38 */ 39 private int hashCode; 40 41 /** 37 42 * <p> 38 43 * instantiates a new server element … … 57 62 } 58 63 64 this.hashCode = this.name.hashCode() + this.port; 59 65 } 60 66 … … 113 119 @Override 114 120 public int hashCode() { 115 return name.hashCode() + port;121 return hashCode; 116 122 } 117 123
Note: See TracChangeset
for help on using the changeset viewer.