Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

JDomain::AJId Class Reference

Inheritance diagram for JDomain::AJId:

Inheritance graph
[legend]
Collaboration diagram for JDomain::AJId:

Collaboration graph
[legend]
List of all members.

Public Methods

NamingContext getContext ()
boolean equals (Object other)
int hashCode ()

Private Attributes

int jid
byte [] encoding

Member Function Documentation

boolean JDomain::AJId::equals ( Object obj ) [inline]
 

Reimplemented in JDomain::JId.

Definition at line 338 of file JDomain.java.

00338                                           {
00339          try {
00340             if (other instanceof AJId) {
00341                byte[] this_encoding = encode();
00342                byte[] other_encoding = ((AJId) other).encode();
00343                int len = this_encoding.length;
00344                if (len == other_encoding.length) {
00345                   for (int i = 0; i < len; i++) {
00346                      if (this_encoding[i] != other_encoding[i]) {
00347                         return false;
00348                      }
00349                   }
00350                   return true;
00351                }
00352             }
00353             return false;
00354          } catch (JonathanException e) {
00355             return this == other;
00356          }
00357       }

NamingContext JDomain::AJId::getContext ( ) [inline]
 

Returns the naming context associated with the target identifier.

An identifier is always associated the naming context that created it.

Returns:
the naming context associated with the target identifier.

Reimplemented from Identifier.

Definition at line 334 of file JDomain.java.

00334                                         {
00335          return JDomain.this;
00336       }

int JDomain::AJId::hashCode ( ) [inline]
 

Reimplemented in JDomain::JId.

Definition at line 359 of file JDomain.java.

00359                             {
00360          try {
00361             int hashcode = 0;
00362             int g;
00363             byte[] enc = encode();
00364             int len = enc.length;
00365             for (int p = 0; p < len; p++) {
00366                hashcode = (hashcode << 4) + (enc[p] & 0xFF) ;
00367                g = hashcode & 0xF0000000;
00368                if (g != 0) {
00369                   hashcode = (hashcode ^ (g >>> 24)) ^ g;
00370                }
00371             }
00372             return hashcode;
00373          } catch (JonathanException e) {
00374             return System.identityHashCode(this);
00375          }
00376       }


Member Data Documentation

byte [] JDomain::AJId::encoding [private]
 

Definition at line 333 of file JDomain.java.

int JDomain::AJId::jid [private]
 

Definition at line 332 of file JDomain.java.


The documentation for this class was generated from the following file:
Generated at Fri May 31 19:23:40 2002 for Jonathan by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001