/** *FactoryclasswhichgeneratesandprintstoSTDOUTalong-valuedseed *foruseininitializingaPRNG.Aninstanceof{@codeRandom}or *{@codeSplittableRandom}maylikewisebeobtained.
*/ publicclass RandomFactory { /** *Attempttoobtaintheseedfromthevalueofthe"seed"property. *@returnTheseedor{@codenull}ifthe"seed"propertywasnotsetor *couldnotbeparsed.
*/ privatestaticLong getSystemSeed() { Long seed = null; try { // note that Long.valueOf(null) also throws a // NumberFormatException so if the property is undefined this // will still work correctly
seed = Long.valueOf(System.getProperty("seed"));
} catch (NumberFormatException e) { // do nothing: seed is still null
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.