KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > pobjects > userid > InnerUserId


1 /**
2  * Copyright (C) 2001-2004 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * 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  */

18 package org.objectweb.speedo.pobjects.userid;
19
20 import java.io.Serializable JavaDoc;
21
22 /**
23  *
24  * @author S.Chassande-Barrioz
25  */

26 public class InnerUserId {
27     private String JavaDoc f1;
28     private int f2;
29     private long oid1;
30     private long oid2;
31
32     public InnerUserId() {
33     }
34
35     public InnerUserId(String JavaDoc f1, int f2, long oid1, long oid2) {
36         this.f1 = f1;
37         this.f2 = f2;
38         this.oid1 = oid1;
39         this.oid2 = oid2;
40     }
41
42     public InnerUserId(String JavaDoc f1, int f2, Oid oid) {
43         this.f1 = f1;
44         this.f2 = f2;
45         oid1 = oid.oid1;
46         oid2 = oid.oid2;
47     }
48
49     public String JavaDoc getF1() {
50         return f1;
51     }
52
53     public int getF2() {
54         return f2;
55     }
56
57     public long getOid1() {
58         return oid1;
59     }
60
61     public long getOid2() {
62         return oid2;
63     }
64
65     /**
66      *This class is used to represent the application identifier
67      for the <code>InnerUserId</code> class.
68      */

69     public static class Oid implements Serializable JavaDoc {
70         public long oid1;
71         public long oid2;
72
73         /**
74          *The required public, null constructor.
75          */

76         public Oid() {
77             oid1 = 0;
78             oid2 = 0;
79         }
80
81         /**
82          *A constructor to initialize the identifier field.
83          */

84         public Oid(long o1, long o2) {
85             oid1 = o1;
86             oid2 = o2;
87         }
88
89         public boolean equals(java.lang.Object JavaDoc obj) {
90             if (obj == null || !this.getClass().equals(obj.getClass()))
91                 return (false);
92             return oid1 == ((Oid) obj).oid1 && oid2 == ((Oid) obj).oid2;
93         }
94
95         public int hashCode() {
96             return ((int) oid1);
97         }
98     }
99
100 }
101
Popular Tags