1 /*
2 * sbxb library, part of ULMgen product
3 * Copyright (C) 2003,2005 Thierry Beigbeder
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /*
20 * $Header: $
21 * $Revision: $
22 * $Date: $
23 *
24 * History :
25 * Who yyyy/mm/dd Action
26 * -------- ---------- ------
27 */
28
29
30 package org.otvl.sbxbsamp.abcref;
31
32
33 // Insert here additional imports
34
35
36
37
38 /***
39 *
40 * @author
41 * @version
42 */
43
44
45 public class ABCRef
46 {
47 /*-------------------------------------------------------------------------
48 * Attributes declaration
49 *-------------------------------------------------------------------------*/
50 /***
51 *
52 */
53 public String clsName;
54 /***
55 *
56 */
57 public String id;
58
59
60 /*-------------------------------------------------------------------------
61 * Associations declaration
62 *-------------------------------------------------------------------------*/
63
64
65 /*-------------------------------------------------------------------------
66 * Operations
67 *-------------------------------------------------------------------------*/
68 /***
69 *
70 * @param clazz
71 * @param id
72 */
73 public ABCRef(
74 Class clazz,
75 String id
76 )
77 {
78
79 this.clsName = clazz.getName();
80 this.id = id;
81
82 }
83 /***
84 *
85 */
86 public ABCRef()
87 {
88
89
90 }
91 /***
92 *
93 * @return int
94 */
95 public int hashCode()
96 {
97 int vHashCode;
98
99 vHashCode = getStrid().hashCode();
100 return vHashCode;
101
102 }
103 /***
104 *
105 * @param arg0
106 * @return boolean
107 */
108 public boolean equals(
109 Object arg0
110 )
111 {
112 boolean vEquals;
113
114 if(arg0 != null && arg0 instanceof ABCRef) {
115 ABCRef other = (ABCRef)arg0;
116 vEquals = getStrid().equals(other.getStrid());
117 } else {
118 vEquals = false;
119 }
120 return vEquals;
121
122 }
123 /***
124 *
125 * @return String
126 */
127 private String getStrid()
128 {
129 String vGetStrid;
130
131 vGetStrid = clsName + "." + id;
132 return vGetStrid;
133
134 }
135 /***
136 *
137 * @return String
138 */
139 public String toString()
140 {
141 String vToString;
142
143 vToString = getStrid();
144 return vToString;
145
146 }
147
148
149 /*-------------------------------------------------------------------------
150 * Attribute accessors
151 *-------------------------------------------------------------------------*/
152
153
154 /*-------------------------------------------------------------------------
155 * Association accessors
156 *-------------------------------------------------------------------------*/
157
158 }