java.lang.Object
org.metacosm.framework.random.UniformDistributionLaw
- All Implemented Interfaces:
- DistributionLaw, org.metacosm.framework.persistence.Persistent, java.io.Serializable
- Direct Known Subclasses:
- TranslatedUniformDistributionLaw
- public class UniformDistributionLaw
- extends java.lang.Object
- implements DistributionLaw
Uniform distribution law for basic numeric types
(Byte, Boolean, Double, Float, Int, Long, Short)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
type
protected java.lang.Class type
intMax
protected int intMax
UniformDistributionLaw
public UniformDistributionLaw(java.lang.Class type)
- Constructor for a uniform distribution law.
Domains are [MIN_VALUE, MAX_VALUE] for given type, except for Float and
Double which are [0.0, 1.0[.
UniformDistributionLaw
public UniformDistributionLaw(java.lang.Class type,
int max)
- Constructor for a uniform distribution law.
Domains are [0, max[ with max < type.MAX_VALUE and
max < Integer.MAX_VALUE;
nextValue
public java.lang.Object nextValue()
- Specified by:
nextValue in interface DistributionLaw
save
public void save(java.io.OutputStream os)
throws java.io.IOException
- Description copied from interface:
org.metacosm.framework.persistence.Persistent
- Saves on the stream.
- Specified by:
save in interface org.metacosm.framework.persistence.Persistent
load
public void load(java.io.InputStream is)
throws java.io.IOException
- Description copied from interface:
org.metacosm.framework.persistence.Persistent
- Loads from the stream.
- Specified by:
load in interface org.metacosm.framework.persistence.Persistent