@ALDDataIOProvider
public class RandomGeneratorDataIOCmdline
extends de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
java.util.Random
objects.
When a random generator is to be created from an input string, it is initialized with a seed
if the string represents a Long integer. If the string cannot be parsed as Long, e.g. because it is not a numerical
value, a random generator is created without seed.
When a random generator has to be written, i.e. it will be formated as string, that string represents the random
generator's seed. Note that the current state of the random generator is not represented, i.e. if a new random generator
is constructed from this string, it will share the same seed, but will have the initial state of the old random generator.
TODO: Consider serialization
Constructor and Description |
---|
RandomGeneratorDataIOCmdline() |
Modifier and Type | Method and Description |
---|---|
String |
formatAsString(Object obj)
Get a string representing the seed of the specified Random generator.
|
Object |
parse(Field field,
Class<?> cl,
String valueString)
Convert a string to a Random generator.
|
Collection<Class<?>> |
providedClasses() |
public Collection<Class<?>> providedClasses()
public Object parse(Field field, Class<?> cl, String valueString) throws de.unihalle.informatik.Alida.exceptions.ALDDataIOProviderException
parse
in class de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
de.unihalle.informatik.Alida.exceptions.ALDDataIOProviderException
public String formatAsString(Object obj) throws de.unihalle.informatik.Alida.exceptions.ALDDataIOProviderException
formatAsString
in class de.unihalle.informatik.Alida.dataio.provider.cmdline.ALDStandardizedDataIOCmdline
de.unihalle.informatik.Alida.exceptions.ALDDataIOProviderException
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.