01: package org.contineo.core.document;
02:
03: import java.io.Serializable;
04:
05: /**
06: * Composite identifier of <code>Term</code>
07: *
08: * @author Marco Meschieri
09: * @version $Id: TermID.java,v 1.1 2007/06/29 06:28:28 marco Exp $
10: * @since 3.0
11: */
12: public class TermID implements Serializable {
13:
14: private static final long serialVersionUID = 1L;
15:
16: private int menuId;
17:
18: private String stem = "";
19:
20: public TermID(int menuId, String stem) {
21: this .menuId = menuId;
22: this .stem = stem;
23: }
24:
25: public TermID() {
26: }
27:
28: public int getMenuId() {
29: return menuId;
30: }
31:
32: public void setMenuId(int menuId) {
33: this .menuId = menuId;
34: }
35:
36: public String getStem() {
37: return stem;
38: }
39:
40: public void setStem(String stem) {
41: this .stem = stem;
42: }
43:
44: @Override
45: public boolean equals(Object obj) {
46: if (!(obj instanceof TermID))
47: return false;
48:
49: TermID other = (TermID) obj;
50: if (other.getMenuId() != this .getMenuId())
51: return false;
52: return other.getStem().equals(this .getStem());
53: }
54:
55: @Override
56: public int hashCode() {
57: return (menuId + stem).hashCode();
58: }
59:
60: @Override
61: public String toString() {
62: return menuId + "," + stem;
63: }
64: }
|