|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.io.Mixer | +--sam.io.RandomMixer
Basic pseudo-random implementation of a mixer.
Nested Class Summary |
Nested classes inherited from class sam.io.Mixer |
Mixer.InputStream, Mixer.OutputStream |
Field Summary | |
static sam.io.RandomMixer |
DEFAULT
Immutable default value, defined as new RandomMixer(0.05, 0.05, 0.50, 0.50) |
float |
density
Actual density factor |
float |
frequency
Actual frequency factor |
float |
redundancy
Actual redundancy factor |
float |
variety
Actual variety factor |
Fields inherited from class sam.io.Mixer |
DUMMY |
Constructor Summary | |
RandomMixer(float frequency,
float density,
float variety,
float redundancy)
Builds a new RandomMixer instance, with values as float in the range 0.01..0.99 |
|
RandomMixer(java.lang.String frequency)
|
|
RandomMixer(java.lang.String frequency,
java.lang.String density)
|
|
RandomMixer(java.lang.String frequency,
java.lang.String density,
java.lang.String variety)
|
|
RandomMixer(java.lang.String frequency,
java.lang.String density,
java.lang.String variety,
java.lang.String redundancy)
Builds a new RandomMixer instance, with values as String coding integers in the
range 1..99 |
Method Summary | |
static int |
factored(float value,
int factor)
|
protected long |
getDataChunkLength(long blockSize)
Sets the next data chunk length, in bytes. |
void |
readGarbageChunk(java.io.InputStream stream,
long length)
Reads garbage data from the stream. |
java.lang.String |
toString()
|
java.lang.String |
verbose()
|
void |
writeGarbageChunk(java.io.OutputStream delegee)
Writes garbage data to the stream. |
Methods inherited from class sam.io.Mixer |
blockSize, getTrace, nextDataChunkLength, setBlockSize, setTrace, setTracker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final sam.io.RandomMixer DEFAULT
new RandomMixer(0.05, 0.05, 0.50, 0.50)
public final float density
public final float frequency
public final float variety
public final float redundancy
Constructor Detail |
public RandomMixer(java.lang.String frequency) throws java.lang.NumberFormatException
public RandomMixer(java.lang.String frequency, java.lang.String density) throws java.lang.NumberFormatException
public RandomMixer(java.lang.String frequency, java.lang.String density, java.lang.String variety) throws java.lang.NumberFormatException
public RandomMixer(java.lang.String frequency, java.lang.String density, java.lang.String variety, java.lang.String redundancy) throws java.lang.NumberFormatException
RandomMixer
instance, with values as String
coding integers in the
range 1..99
public RandomMixer(float frequency, float density, float variety, float redundancy) throws java.lang.NumberFormatException
RandomMixer
instance, with values as float
in the range 0.01..0.99
Method Detail |
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String verbose()
public static int factored(float value, int factor)
protected long getDataChunkLength(long blockSize)
Mixer
getDataChunkLength
in class Mixer
blockSize
- the block size of the data stream,
which might be zero to specify infinite block size
A lazy implementation might just return blockSize
public void writeGarbageChunk(java.io.OutputStream delegee) throws java.io.IOException
Mixer
writeGarbageChunk
in class Mixer
delegee
- the output to write onto
Note that the number of bytes written will be kept back automatically
java.io.IOException
public void readGarbageChunk(java.io.InputStream stream, long length) throws java.io.IOException
Mixer
readGarbageChunk
in class Mixer
stream
- the input to write ontolength
- the number of garbage bytes to read
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |