home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / text / StyleContext$FontKey.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  1.1 KB  |  31 lines

  1. package com.sun.java.swing.text;
  2.  
  3. class StyleContext$FontKey {
  4.    private String family;
  5.    private int style;
  6.    private int size;
  7.  
  8.    public StyleContext$FontKey(String var1, int var2, int var3) {
  9.       this.setValue(var1, var2, var3);
  10.    }
  11.  
  12.    public void setValue(String var1, int var2, int var3) {
  13.       this.family = var1 != null ? var1.intern() : null;
  14.       this.style = var2;
  15.       this.size = var3;
  16.    }
  17.  
  18.    public int hashCode() {
  19.       return this.family.hashCode() ^ this.style ^ this.size;
  20.    }
  21.  
  22.    public boolean equals(Object var1) {
  23.       if (var1 instanceof StyleContext$FontKey) {
  24.          StyleContext$FontKey var2 = (StyleContext$FontKey)var1;
  25.          return this.size == var2.size && this.style == var2.style && this.family == var2.family;
  26.       } else {
  27.          return false;
  28.       }
  29.    }
  30. }
  31.