comparison dwtx/jface/text/TextAttribute.d @ 160:3678e4f1a766

toHash, toString
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 02:07:22 +0200
parents 000f9136b8f7
children 1a5b8f8129df
comparison
equal deleted inserted replaced
159:7926b636c282 160:3678e4f1a766
275 } 275 }
276 276
277 /* 277 /*
278 * @see Object#hashCode() 278 * @see Object#hashCode()
279 */ 279 */
280 public int hashCode() { 280 public override hash_t toHash() {
281 if (fHashCode is 0) { 281 if (fHashCode is 0) {
282 int multiplier= 37; // some prime 282 int multiplier= 37; // some prime
283 fHashCode= 13; // some random value 283 fHashCode= 13; // some random value
284 fHashCode= multiplier * fHashCode + (font is null ? 0 : font.hashCode()); 284 fHashCode= multiplier * fHashCode + (font is null ? 0 : font.toHash());
285 fHashCode= multiplier * fHashCode + (background is null ? 0 : background.hashCode()); 285 fHashCode= multiplier * fHashCode + (background is null ? 0 : background.toHash());
286 fHashCode= multiplier * fHashCode + (foreground is null ? 0 : foreground.hashCode()); 286 fHashCode= multiplier * fHashCode + (foreground is null ? 0 : foreground.toHash());
287 fHashCode= multiplier * fHashCode + style; 287 fHashCode= multiplier * fHashCode + style;
288 } 288 }
289 return fHashCode; 289 return fHashCode;
290 } 290 }
291 291