Changeset 561 for trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefect.java
- Timestamp:
- 08/17/12 09:26:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-core-usability/src/main/java/de/ugoe/cs/quest/usability/UsabilityDefect.java
r477 r561 1 //-------------------------------------------------------------------------------------------------2 1 // Module : $RCSfile: UsabilityDefect.java,v $ 3 2 // Version : $Revision: 0.0 $ $Author: pharms $ $Date: 16.07.2012 $ … … 5 4 // Creation : 2012 by pharms 6 5 // Copyright : Patrick Harms, 2012 7 //------------------------------------------------------------------------------------------------- 6 7 8 8 package de.ugoe.cs.quest.usability; 9 9 10 10 import java.util.Map; 11 11 12 //-------------------------------------------------------------------------------------------------13 12 /** 14 13 * TODO comment … … 17 16 * @author 2012, last modified by $Author: pharms$ 18 17 */ 19 //------------------------------------------------------------------------------------------------- 20 public class UsabilityDefect 21 { 18 public class UsabilityDefect { 22 19 23 /** */ 24 private UsabilityDefectSeverity mSeverity; 25 26 /** */ 27 private UsabilityDefectDescription mDescription; 20 /** */ 21 private UsabilityDefectSeverity severity; 28 22 29 /** */30 private Map<String, String> mDescriptionParameters;23 /** */ 24 private UsabilityDefectDescription description; 31 25 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; 45 28 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 } 62 39 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 } 74 54 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 } 84 63 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 } 94 71 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 /** 97 81 * 98 82 */ 99 //----------------------------------------------------------------------------------------------- 100 public String getParameterizedDescription() 101 { 102 return mDescription.toString(mDescriptionParameters); 103 } 83 public String getParameterizedDescription() { 84 return description.toString(descriptionParameters); 85 } 104 86 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 } 118 102 } 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(); 122 112 } 123 }124 113 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 } 146 123 147 124 }
Note: See TracChangeset
for help on using the changeset viewer.