01: /**
02: * Copyright (C) 2001-2004 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package org.objectweb.speedo.pobjects.userid;
18:
19: import java.io.Serializable;
20:
21: /**
22: *
23: * @author S.Chassande-Barrioz
24: */
25: public class InnerUserId {
26: private String f1;
27: private int f2;
28: private long oid1;
29: private long oid2;
30:
31: public InnerUserId() {
32: }
33:
34: public InnerUserId(String f1, int f2, long oid1, long oid2) {
35: this .f1 = f1;
36: this .f2 = f2;
37: this .oid1 = oid1;
38: this .oid2 = oid2;
39: }
40:
41: public InnerUserId(String f1, int f2, Oid oid) {
42: this .f1 = f1;
43: this .f2 = f2;
44: oid1 = oid.oid1;
45: oid2 = oid.oid2;
46: }
47:
48: public String getF1() {
49: return f1;
50: }
51:
52: public int getF2() {
53: return f2;
54: }
55:
56: public long getOid1() {
57: return oid1;
58: }
59:
60: public long getOid2() {
61: return oid2;
62: }
63:
64: /**
65: *This class is used to represent the application identifier
66: for the <code>InnerUserId</code> class.
67: */
68: public static class Oid implements Serializable {
69: public long oid1;
70: public long oid2;
71:
72: /**
73: *The required public, null constructor.
74: */
75: public Oid() {
76: oid1 = 0;
77: oid2 = 0;
78: }
79:
80: /**
81: *A constructor to initialize the identifier field.
82: */
83: public Oid(long o1, long o2) {
84: oid1 = o1;
85: oid2 = o2;
86: }
87:
88: public boolean equals(java.lang.Object obj) {
89: if (obj == null || !this .getClass().equals(obj.getClass()))
90: return (false);
91: return oid1 == ((Oid) obj).oid1 && oid2 == ((Oid) obj).oid2;
92: }
93:
94: public int hashCode() {
95: return ((int) oid1);
96: }
97: }
98:
99: }
|