|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.factory.IdFactoryImpl
planet.generic.commonapi.factory.IdFactoryDoubleImpl
This Factory generate uniques Id from a material. The Id must to be based on a double representation of its internal value.
Field Summary |
Fields inherited from class planet.generic.commonapi.factory.IdFactoryImpl |
actualBuildsIds, actualValue, chunkValue, defaultIdClass, defaultNetworkSize, defaultTopology, idClass, idClassConstructorBigInteger, idClassConstructorByteArray, idClassConstructorDouble, idClassConstructorInt, idClassConstructorIntArray, idClassConstructorString, networkSize, propertiesFile, random, topology |
Constructor Summary | |
IdFactoryDoubleImpl(java.lang.Class idClass,
java.lang.String topology,
int networkSize)
Constructor that builds an instance with these parameters |
|
IdFactoryDoubleImpl(java.lang.String propertiesFile)
This constructor reads the properties' file and initializes the IdFactory and Class for new Nodes. |
Method Summary | |
Id |
buildId(java.math.BigInteger bigNumber)
Generate an Id from the BigInteger as its internal value. |
Id |
buildId(byte[] material)
Generate an Id from material in byte[] format as its internal value. |
Id |
buildId(double material)
Builds an Id with the double parameter as its internal value. |
Id |
buildId(int material)
Builds an Id with the int parameter as its internal value. |
Id |
buildId(int[] material)
Generate an Id from material in int[] format, as its internal value. |
protected Id |
buildRandomId()
Builds a random Id using the double constructor of the target Id. |
protected void |
initDistributedAttr()
Initializes the protected attributes to permits the uniform distribution of Ids. |
Methods inherited from class planet.generic.commonapi.factory.IdFactoryImpl |
buildId, buildId, buildKey, init, readIdFactoryObject, writeIdFactoryObject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IdFactoryDoubleImpl(java.lang.String propertiesFile) throws InitializationException
InitializationException
- If occur any problem during
initialization steps.public IdFactoryDoubleImpl(java.lang.Class idClass, java.lang.String topology, int networkSize) throws InitializationException
idClass
- Id class to build.topology
- Network topology to known how build the new Ids.networkSize
- Size of the network. It is important if is used the topology Topology.CIRCULAR.
InitializationException
- if occurs some error during initialization of values.Topology
Method Detail |
protected void initDistributedAttr() throws InitializationException
initDistributedAttr
in class IdFactoryImpl
InitializationException
- if an error occurs during
their initialization.protected Id buildRandomId() throws InitializationException
buildRandomId
in class IdFactoryImpl
InitializationException
- if an error occurs during the
initialization of the Id.public Id buildId(double material) throws InitializationException
buildId
in interface IdFactory
buildId
in class IdFactoryImpl
material
- double with the internal value for the new Id.
InitializationException
- if an error occurs during the
initialization of the Id or if it is nonapplicable to the
target Id.IdFactory.buildId(double)
public Id buildId(int material) throws InitializationException
buildId
in interface IdFactory
buildId
in class IdFactoryImpl
material
- Int with the internal value for the new Id.
Always
- InitializationException for nonapplicable constructor.
InitializationException
- if an error occurs during the
initialization of the Id or if it is nonapplicable to the
target Id.IdFactory.buildId(int)
public Id buildId(byte[] material) throws InitializationException
buildId
in interface IdFactory
buildId
in class IdFactoryImpl
material
- Hash code previously generated.
InitializationException
- if an error occurs during the
initialization of the Id or if it is nonapplicable to the
target Id.IdFactory.buildId(byte[])
public Id buildId(int[] material) throws InitializationException
buildId
in interface IdFactory
buildId
in class IdFactoryImpl
material
- Internal value of the new Id in int[] format.
InitializationException
- if an error occurs during the
initialization of the Id or if it is nonapplicable to the
target Id.IdFactory.buildId(int[])
public Id buildId(java.math.BigInteger bigNumber) throws InitializationException
buildId
in interface IdFactory
buildId
in class IdFactoryImpl
InitializationException
- when an error occurs during the
initialization of the Id or when this factory method is
nonapplicable.IdFactory.buildId(java.math.BigInteger)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |