net.sf.asyncobjects.io.util
Class RandomTextInput
java.lang.Object
net.sf.asyncobjects.AsyncUnicastServer<I>
net.sf.asyncobjects.io.util.GeneratingInput<TextData,ATextInput>
net.sf.asyncobjects.io.util.RandomTextInput
- All Implemented Interfaces:
- ACloseable, AsyncObject, ExplicitSharing, AInput<TextData>, ATextInput
public class RandomTextInput
- extends GeneratingInput<TextData,ATextInput>
- implements ATextInput
A random text input. It uses internal array of to hold the data. It makes
best effort to generate valid unicode codepoints.
- Author:
- const
Method Summary |
protected TextData |
generate(int toRead)
Generate at most limit of the data |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomTextInput
public RandomTextInput(Random random,
int limit)
- A constructor for unlmited stream
- Parameters:
random
- a random number generatorlimit
- a limit on data generated at one time
RandomTextInput
public RandomTextInput(Random random)
- A constructor for unlimited stream with limit 1024
- Parameters:
random
- a random number generator
RandomTextInput
public RandomTextInput()
- A constructor for unlimited stream with limit 1024 and generator created
with
Random.Random()
RandomTextInput
public RandomTextInput(Random random,
int limit,
long toGenerate)
- A constructor
- Parameters:
random
- a random number generatorlimit
- a limit on data generated at one timetoGenerate
- amount to generate
generate
protected TextData generate(int toRead)
- Description copied from class:
GeneratingInput
- Generate at most limit of the data
- Specified by:
generate
in class GeneratingInput<TextData,ATextInput>
- Parameters:
toRead
- a limit on generated data
- Returns:
- a generated data
- See Also:
GeneratingInput.generate(int)
Copyright © 2002-2007 Constantine Plotnikov. All Rights Reserved.