KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > modfact > jmi > reflect > RefAssociationLinkImpl


1 package org.objectweb.modfact.jmi.reflect;
2
3 import javax.jmi.reflect.*;
4
5 public class RefAssociationLinkImpl implements RefAssociationLink, java.io.Serializable JavaDoc {
6     
7     RefObject end1,end2;
8     
9     public RefAssociationLinkImpl() {
10     }
11
12     public RefAssociationLinkImpl(RefObject end1, RefObject end2) {
13         this.end1 = end1;
14         this.end2 = end2;
15     }
16     
17     public javax.jmi.reflect.RefObject refFirstEnd() {
18         return end1;
19     }
20     
21     public javax.jmi.reflect.RefObject refSecondEnd() {
22         return end2;
23     }
24  
25     public boolean equals(java.lang.Object JavaDoc other) {
26         if( !(other instanceof RefAssociationLink) ) return false;
27         RefAssociationLink otherLink = (RefAssociationLink)other;
28         if( !end1.equals(otherLink.refFirstEnd()) ) return false;
29         return end2.equals(otherLink.refSecondEnd());
30     }
31             
32     public int hashCode() {
33         return end1.hashCode() + end2.hashCode();
34     }
35             
36     
37 }
38
Popular Tags