|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.service.idgen.IdSpace
public class IdSpace
IdSpace defines the scope of a set of ids and how they are generated. Within an IdSpace ids are guaranteed to be unique. There is no logic in this class. The properties of id spaces are manipulated by an id generator according to the rules of that generator.
If this class is subclassed, it should be only to add
properties. The logic for generating ids should be contained in
an IdGenerator
.
IdGenerator
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected int |
mHashCode
cached hash code |
protected long |
mSeed
seed to use for calculating ids in some sequence |
Constructor Summary | |
---|---|
|
IdSpace()
Empty constructor |
|
IdSpace(java.lang.String pName,
long pSeed)
Construct an id space with the specfied name and seed. |
|
IdSpace(java.lang.String pName,
long pSeed,
int pBatchSize,
java.lang.String pPrefix,
java.lang.String pSuffix)
Construct an id space with all the user properties set. |
protected |
IdSpace(java.lang.String pName,
long pSeed,
long pLastSeed,
int pBatchSize,
java.lang.String pPrefix,
java.lang.String pSuffix)
Construct an id space with all the properties and fields set. |
|
IdSpace(java.lang.String pName,
long pSeed,
java.lang.String pPrefix,
java.lang.String pSuffix)
Construct an id space with the name, seed, prefix, and suffix set. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Get a copy of this object |
void |
copyFrom(IdSpace pOther)
Set the values of this object from the specified id space. |
boolean |
equals(java.lang.Object pOther)
Compare an object for equality with this object. |
int |
getBatchSize()
Get property batchSize |
int |
getIdsPerBatch()
Get property idsPerBatch |
long |
getLastSeed()
Get property LastSeed |
java.lang.String |
getName()
Get property Name |
java.lang.String |
getPrefix()
Get property Prefix |
long |
getSeed()
Get property Seed |
java.lang.String |
getSuffix()
Get property Suffix |
java.util.Set |
getUsedLongIds()
Get property usedLongIds |
int |
hashCode()
Get the hash code for this object. |
void |
setBatchSize(int pBatchSize)
Set property BatchSize |
void |
setIdsPerBatch(int pIdsPerBatch)
Set property idsPerBatch |
void |
setLastSeed(long pLastSeed)
Internal setter for lastSeed |
void |
setPrefix(java.lang.String pPrefix)
Set property Prefix |
protected void |
setSeed(long pSeed)
Internal setter for seed . |
void |
setSuffix(java.lang.String pSuffix)
Set property Suffix |
void |
setUsedLongIds(java.util.Set pUsedLongIds)
Set property usedLongIds |
java.lang.String |
toString()
Get a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected transient int mHashCode
protected long mSeed
Constructor Detail |
---|
public IdSpace()
public IdSpace(java.lang.String pName, long pSeed)
pName
- name
propertypSeed
- seed
propertypublic IdSpace(java.lang.String pName, long pSeed, java.lang.String pPrefix, java.lang.String pSuffix)
pName
- name
propertypSeed
- seed
propertypPrefix
- prefix
propertypSuffix
- suffix
propertypublic IdSpace(java.lang.String pName, long pSeed, int pBatchSize, java.lang.String pPrefix, java.lang.String pSuffix)
pName
- name
propertypSeed
- seed
propertypBatchSize
- batchSize
propertypPrefix
- prefix
propertypSuffix
- suffix
propertyprotected IdSpace(java.lang.String pName, long pSeed, long pLastSeed, int pBatchSize, java.lang.String pPrefix, java.lang.String pSuffix)
pName
- name
propertypSeed
- seed
propertypLastSeed
- lastSeed
propertypBatchSize
- batchSize
propertypPrefix
- prefix
propertypSuffix
- suffix
propertyMethod Detail |
---|
public java.lang.String getName()
public long getSeed()
protected void setSeed(long pSeed)
seed
.
pSeed
- new value to setpublic long getLastSeed()
public void setLastSeed(long pLastSeed)
lastSeed
pLastSeed
- new value to setpublic void setBatchSize(int pBatchSize)
pBatchSize
- new value to setpublic int getBatchSize()
batchSize
public void setIdsPerBatch(int pIdsPerBatch)
idsPerBatch
pIdsPerBatch
- new value to setpublic int getIdsPerBatch()
idsPerBatch
idsPerBatch
public void setPrefix(java.lang.String pPrefix)
pPrefix
- new value to setpublic java.lang.String getPrefix()
public void setSuffix(java.lang.String pSuffix)
pSuffix
- new value to setpublic java.lang.String getSuffix()
public void setUsedLongIds(java.util.Set pUsedLongIds)
usedLongIds
pUsedLongIds
- new value to setpublic java.util.Set getUsedLongIds()
usedLongIds
usedLongIds
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object pOther)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public void copyFrom(IdSpace pOther)
pOther
- id space to copy from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |