View Javadoc

1   // jq_NameAndDesc.java, created Mon Feb  5 23:23:20 2001 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.Class;
5   
6   import joeq.UTF.Utf8;
7   
8   /*
9    * @author  John Whaley <jwhaley@alum.mit.edu>
10   * @version $Id: jq_NameAndDesc.java 1456 2004-03-09 22:01:46Z jwhaley $
11   */
12  public class jq_NameAndDesc {
13  
14      private final Utf8 name, desc;
15      
16      /*** Creates new jq_NameAndDesc */
17      public jq_NameAndDesc(Utf8 name, Utf8 desc) {
18          this.name = name;
19          this.desc = desc;
20      }
21      public jq_NameAndDesc(String name, String desc) {
22          this(Utf8.get(name), Utf8.get(desc));
23      }
24      
25      public final Utf8 getName() { return name; }
26      public final Utf8 getDesc() { return desc; }
27      
28      public boolean equals(Object o) { return equals((jq_NameAndDesc)o); }
29      public boolean equals(jq_NameAndDesc that) {
30          return this.name == that.name && this.desc == that.desc;
31      }
32      public int hashCode() {
33          return name.hashCode() ^ desc.hashCode();
34      }
35      public String toString() {
36          return name+" "+desc;
37      }
38  
39  }