Ignore:
Timestamp:
08/17/12 09:26:21 (12 years ago)
Author:
pharms
Message:
  • adapted to new coding style in quest
File:
1 edited

Legend:

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

    r477 r561  
    1 //------------------------------------------------------------------------------------------------- 
    21// Module    : $RCSfile: UsabilityDefect.java,v $ 
    32// Version   : $Revision: 0.0 $  $Author: pharms $  $Date: 16.07.2012 $ 
     
    54// Creation  : 2012 by pharms 
    65// Copyright : Patrick Harms, 2012 
    7 //------------------------------------------------------------------------------------------------- 
     6 
     7 
    88package de.ugoe.cs.quest.usability; 
    99 
    1010import java.util.Map; 
    1111 
    12 //------------------------------------------------------------------------------------------------- 
    1312/** 
    1413 * TODO comment 
     
    1716 * @author 2012, last modified by $Author: pharms$ 
    1817 */ 
    19 //------------------------------------------------------------------------------------------------- 
    20 public class UsabilityDefect 
    21 { 
     18public class UsabilityDefect { 
    2219 
    23   /** */ 
    24   private UsabilityDefectSeverity mSeverity; 
    25    
    26   /** */ 
    27   private UsabilityDefectDescription mDescription; 
     20    /** */ 
     21    private UsabilityDefectSeverity severity; 
    2822 
    29   /** */ 
    30   private Map<String, String> mDescriptionParameters; 
     23    /** */ 
     24    private UsabilityDefectDescription description; 
    3125 
    32   //----------------------------------------------------------------------------------------------- 
    33   /** 
    34    * TODO: comment 
    35    * 
    36    * @param medium 
    37    * @param highTextInputRatio 
    38    */ 
    39   //----------------------------------------------------------------------------------------------- 
    40   public UsabilityDefect(UsabilityDefectSeverity    severity, 
    41                          UsabilityDefectDescription description) 
    42   { 
    43     this(severity, description, null); 
    44   } 
     26    /** */ 
     27    private Map<String, String> descriptionParameters; 
    4528 
    46   //----------------------------------------------------------------------------------------------- 
    47   /** 
    48    * TODO: comment 
    49    * 
    50    * @param medium 
    51    * @param highTextInputRatio 
    52    */ 
    53   //----------------------------------------------------------------------------------------------- 
    54   public UsabilityDefect(UsabilityDefectSeverity    severity, 
    55                          UsabilityDefectDescription description, 
    56                          Map<String, String>        parameters) 
    57   { 
    58     mSeverity = severity; 
    59     mDescription = description; 
    60     mDescriptionParameters = parameters; 
    61   } 
     29    /** 
     30     * TODO: comment 
     31     *  
     32     * @param medium 
     33     * @param highTextInputRatio 
     34     */ 
     35    public UsabilityDefect(UsabilityDefectSeverity severity, UsabilityDefectDescription description) 
     36    { 
     37        this(severity, description, null); 
     38    } 
    6239 
    63   //----------------------------------------------------------------------------------------------- 
    64   /** 
    65    * TODO: comment 
    66    * 
    67    * @return 
    68    */ 
    69   //----------------------------------------------------------------------------------------------- 
    70   public UsabilityDefectSeverity getSeverity() 
    71   { 
    72     return mSeverity; 
    73   } 
     40    /** 
     41     * TODO: comment 
     42     *  
     43     * @param medium 
     44     * @param highTextInputRatio 
     45     */ 
     46    public UsabilityDefect(UsabilityDefectSeverity    severity, 
     47                           UsabilityDefectDescription description, 
     48                           Map<String, String>        parameters) 
     49    { 
     50        this.severity = severity; 
     51        this.description = description; 
     52        this.descriptionParameters = parameters; 
     53    } 
    7454 
    75   //----------------------------------------------------------------------------------------------- 
    76   /** 
    77    * @param severity the severity to set 
    78    */ 
    79   //----------------------------------------------------------------------------------------------- 
    80   public void setSeverity(UsabilityDefectSeverity severity) 
    81   { 
    82     mSeverity = severity; 
    83   } 
     55    /** 
     56     * TODO: comment 
     57     *  
     58     * @return 
     59     */ 
     60    public UsabilityDefectSeverity getSeverity() { 
     61        return severity; 
     62    } 
    8463 
    85   //----------------------------------------------------------------------------------------------- 
    86   /** 
    87    * @param description the description to set 
    88    */ 
    89   //----------------------------------------------------------------------------------------------- 
    90   public void setDescription(UsabilityDefectDescription description) 
    91   { 
    92     mDescription = description; 
    93   } 
     64    /** 
     65     * @param severity 
     66     *            the severity to set 
     67     */ 
     68    public void setSeverity(UsabilityDefectSeverity severity) { 
     69        this.severity = severity; 
     70    } 
    9471 
    95   //----------------------------------------------------------------------------------------------- 
    96   /** 
     72    /** 
     73     * @param description 
     74     *            the description to set 
     75     */ 
     76    public void setDescription(UsabilityDefectDescription description) { 
     77        this.description = description; 
     78    } 
     79 
     80    /** 
    9781   *  
    9882   */ 
    99   //----------------------------------------------------------------------------------------------- 
    100   public String getParameterizedDescription() 
    101   { 
    102     return mDescription.toString(mDescriptionParameters); 
    103   } 
     83    public String getParameterizedDescription() { 
     84        return description.toString(descriptionParameters); 
     85    } 
    10486 
    105   //----------------------------------------------------------------------------------------------- 
    106   /* (non-Javadoc) 
    107    * @see java.lang.Object#equals(java.lang.Object) 
    108    */ 
    109   //----------------------------------------------------------------------------------------------- 
    110   @Override 
    111   public boolean equals(Object obj) 
    112   { 
    113     if (obj instanceof UsabilityDefect) 
    114     { 
    115       return 
    116         (mSeverity == ((UsabilityDefect) obj).mSeverity) && 
    117         (mDescription == ((UsabilityDefect) obj).mDescription); 
     87    /* 
     88     * (non-Javadoc) 
     89     *  
     90     * @see java.lang.Object#equals(java.lang.Object) 
     91     */ 
     92    @Override 
     93    public boolean equals(Object obj) { 
     94        if (obj instanceof UsabilityDefect) { 
     95            return 
     96                (severity == ((UsabilityDefect) obj).severity) && 
     97                (description == ((UsabilityDefect) obj).description); 
     98        } 
     99        else { 
     100            return false; 
     101        } 
    118102    } 
    119     else 
    120     { 
    121       return false; 
     103 
     104    /* 
     105     * (non-Javadoc) 
     106     *  
     107     * @see java.lang.Object#hashCode() 
     108     */ 
     109    @Override 
     110    public int hashCode() { 
     111        return severity.hashCode() + description.hashCode(); 
    122112    } 
    123   } 
    124113 
    125   //----------------------------------------------------------------------------------------------- 
    126   /* (non-Javadoc) 
    127    * @see java.lang.Object#hashCode() 
    128    */ 
    129   //----------------------------------------------------------------------------------------------- 
    130   @Override 
    131   public int hashCode() 
    132   { 
    133     return mSeverity.hashCode() + mDescription.hashCode(); 
    134   } 
    135  
    136   //----------------------------------------------------------------------------------------------- 
    137   /* (non-Javadoc) 
    138    * @see java.lang.Object#toString() 
    139    */ 
    140   //----------------------------------------------------------------------------------------------- 
    141   @Override 
    142   public String toString() 
    143   { 
    144     return "UsabilityDefect(" + mSeverity.name() + ", " + mDescription.name() + ")"; 
    145   } 
     114    /* 
     115     * (non-Javadoc) 
     116     *  
     117     * @see java.lang.Object#toString() 
     118     */ 
     119    @Override 
     120    public String toString() { 
     121        return "UsabilityDefect(" + severity.name() + ", " + description.name() + ")"; 
     122    } 
    146123 
    147124} 
Note: See TracChangeset for help on using the changeset viewer.