Ignore:
Timestamp:
02/19/13 09:41:27 (11 years ago)
Author:
pharms
Message:
  • prevent logging of the same GUI elements several times
  • improved efficiency of hash code calculation
  • improved efficiency of reuse of GUI elements
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlPageElement.java

    r1075 r1089  
    5151     
    5252    /** 
     53     * the hash code of this document 
     54     */ 
     55    private int hashCode; 
     56     
     57    /** 
    5358     * <p> 
    5459     * instantiates a new element representing a tag in an HTML page 
     
    8994        this.htmlId = htmlId; 
    9095        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); 
    91101    } 
    92102 
     
    203213    @Override 
    204214    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; 
    207216    } 
    208217 
Note: See TracChangeset for help on using the changeset viewer.