OpMath

com.opmath.test.j2ee.uid
Class UniqueIdGeneratorPK

java.lang.Object
  |
  +--com.opmath.test.j2ee.uid.UniqueIdGeneratorPK
All Implemented Interfaces:
Serializable

public class UniqueIdGeneratorPK
extends Object
implements Serializable

The primary key class for the UniqueIdGenerator EJB. This is in fact a simple primary key - this class simply delegates to String.

Copyright: (c) 2002 The Open Math Company Limited

The Terms of Distribution of this software are stipulated in the javadoc Overview for this project.

Since:
J2SDK 1.3.1, J2SDKEE 1.3.1, EJB 2.0
Version:
OpMath J2EE Example v1.0
Author:
Bruno Beloff bruno.beloff@opmath.com
See Also:
UniqueIdGeneratorBean, Serialized Form

Field Summary
 String name
          The name of the key.
 
Constructor Summary
UniqueIdGeneratorPK(String name)
          Constructs a new UniqueIdGeneratorPK.
 
Method Summary
 boolean equals(Object o)
          Returns true iff the given Object is the same class as this instance, and has the same name.
 String getName()
          Returns the name of this UniqueIdGeneratorPK.
 int hashCode()
          Returns the hash code for this UniqueIdGeneratorPK.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public String name

The name of the key. This is the only instance variable for this class. Note that it is declared as public to match EJB recommendations [ http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/CMP.html].

Constructor Detail

UniqueIdGeneratorPK

public UniqueIdGeneratorPK(String name)

Constructs a new UniqueIdGeneratorPK.

Parameters:
name - a String specifying the name of the new instance.
Method Detail

getName

public String getName()

Returns the name of this UniqueIdGeneratorPK.

Returns:
a String carrying the name of this UniqueIdGeneratorPK.

equals

public boolean equals(Object o)

Returns true iff the given Object is the same class as this instance, and has the same name.

Overrides:
equals in class Object
Returns:
a boolean indicating equivalance.

hashCode

public int hashCode()

Returns the hash code for this UniqueIdGeneratorPK. The value returned is the hash code of the name of this UniqueIdGeneratorPK.

Overrides:
hashCode in class Object
Returns:
an int hash code.

OpMath

Submit a bug or feature to Open Math
Copyright © 2002 Open Math Company Limited, Brighton, UK