Ignore:
Timestamp:
03/12/15 15:50:28 (9 years ago)
Author:
pharms
Message:
  • extension with further smell detections
  • may not fully work. But Hudson is more happy because compile errors should be gone
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilitySmell.java

    r1493 r1918  
    1818import java.util.Map; 
    1919 
     20import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; 
     21 
    2022/** 
    2123 * TODO comment 
     
    2426 * @author 2012, last modified by $Author: pharms$ 
    2527 */ 
    26 public class UsabilityDefect { 
     28public class UsabilitySmell { 
    2729 
    2830    /** */ 
    29     private UsabilityDefectSeverity severity; 
     31    private ITask smellingTask; 
     32     
     33    /** */ 
     34    private UsabilitySmellIntensity intensity; 
    3035 
    3136    /** */ 
    32     private UsabilityDefectDescription description; 
     37    private UsabilitySmellDescription description; 
    3338 
    3439    /** */ 
     
    3843     * 
    3944     */ 
    40     UsabilityDefect(UsabilityDefectSeverity severity, UsabilityDefectDescription description) { 
    41         this(severity, description, null); 
     45    UsabilitySmell(UsabilitySmellIntensity intensity, UsabilitySmellDescription description) { 
     46        this(intensity, description, null); 
     47    } 
     48     
     49    /** 
     50     * 
     51     */ 
     52    UsabilitySmell(ITask                     smellingTask, 
     53                   UsabilitySmellIntensity   intensity, 
     54                   UsabilitySmellDescription description) 
     55    { 
     56        this(intensity, description, null); 
    4257    } 
    4358 
     
    4560     * 
    4661     */ 
    47     UsabilityDefect(UsabilityDefectSeverity    severity, 
    48                     UsabilityDefectDescription description, 
    49                     Map<String, Object>        parameters) 
     62    UsabilitySmell(UsabilitySmellIntensity   intensity, 
     63                   UsabilitySmellDescription description, 
     64                   Map<String, Object>       parameters) 
    5065    { 
    51         this.severity = severity; 
     66        this(null, intensity, description, parameters); 
     67    } 
     68 
     69    /** 
     70     * 
     71     */ 
     72    UsabilitySmell(ITask                     smellingTask, 
     73                   UsabilitySmellIntensity   intensity, 
     74                   UsabilitySmellDescription description, 
     75                   Map<String, Object>       parameters) 
     76    { 
     77        this.smellingTask = smellingTask; 
     78        this.intensity = intensity; 
    5279        this.description = description; 
    5380        this.descriptionParameters = parameters; 
     
    5784     *  
    5885     */ 
    59     public UsabilityDefectSeverity getSeverity() { 
    60         return severity; 
     86    public ITask getSmellingTask() { 
     87        return smellingTask; 
     88    } 
     89 
     90    /** 
     91     *  
     92     */ 
     93    public UsabilitySmellIntensity getIntensity() { 
     94        return intensity; 
    6195    } 
    6296 
     
    6498     * 
    6599     */ 
    66     public void setSeverity(UsabilityDefectSeverity severity) { 
    67         this.severity = severity; 
     100    public void setIntensity(UsabilitySmellIntensity intensity) { 
     101        this.intensity = intensity; 
    68102    } 
    69103 
     
    71105     * 
    72106     */ 
    73     public void setDescription(UsabilityDefectDescription description) { 
     107    public void setDescription(UsabilitySmellDescription description) { 
    74108        this.description = description; 
    75109    } 
     
    102136    @Override 
    103137    public boolean equals(Object obj) { 
    104         if (obj instanceof UsabilityDefect) { 
    105             return 
    106                 (severity == ((UsabilityDefect) obj).severity) && 
    107                 (description == ((UsabilityDefect) obj).description); 
     138        if (obj instanceof UsabilitySmell) { 
     139            return description.equals(((UsabilitySmell) obj).description); 
    108140        } 
    109141        else { 
     
    119151    @Override 
    120152    public int hashCode() { 
    121         return severity.hashCode() + description.hashCode(); 
     153        return description.hashCode(); 
    122154    } 
    123155 
     
    129161    @Override 
    130162    public String toString() { 
    131         return "UsabilityDefect(" + severity.name() + ", " + description.name() + ")"; 
     163        if (smellingTask == null) { 
     164            return "UsabilitySmell(" + intensity + ", " + description.name() + ")"; 
     165        } 
     166        else { 
     167            return "UsabilitySmell(" + smellingTask + ", " + intensity + ", " + 
     168                description.name() + ")"; 
     169        } 
    132170    } 
    133171 
Note: See TracChangeset for help on using the changeset viewer.