com.croftsoft.core.util.id
Class IntId
java.lang.Object
com.croftsoft.core.util.id.IntId
- All Implemented Interfaces:
- Id, Serializable, Cloneable
public class IntId
- extends Object
- implements Id
An Id implementation that uses an integer as its value.
Maintains a static variable "next" which it increments with each
new IntId object created using the zero-argument constructor.
This ensures uniqueness among IntegerId objects created within the
current process.
- Since:
- 2000-01-16
- Version:
- $Id: IntId.java,v 1.3 2008/09/20 05:11:34 croft Exp $
- See Also:
- Serialized Form
- Author:
- David Wallace Croft
Constructor Summary |
IntId()
this ( next++ ); |
IntId(int i)
|
IntId
public IntId(int i)
IntId
public IntId()
- this ( next++ );
getI
public int getI()
equals
public boolean equals(Object other)
- Specified by:
equals
in interface Id
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Specified by:
hashCode
in interface Id
- Overrides:
hashCode
in class Object
clone
public Object clone()
- Specified by:
clone
in interface Id
- Overrides:
clone
in class Object
toString
public String toString()
- return Integer.toString ( i );
- Overrides:
toString
in class Object
CroftSoft Core Javadoc (2008-09-28 20:58:02)