Class SeedGeneratorPreferenceList

    • Constructor Detail

      • SeedGeneratorPreferenceList

        public SeedGeneratorPreferenceList​(Collection<? extends SeedGenerator> contents,
                                           boolean isAlwaysWorthTrying)
        Creates an instance.
        Parameters:
        contents - the initial list of delegates, in the order they will be tried until one succeeds
        isAlwaysWorthTrying - true if isWorthTrying() should always return true rather than delegating
      • SeedGeneratorPreferenceList

        public SeedGeneratorPreferenceList​(boolean isAlwaysWorthTrying,
                                           SeedGenerator... contents)
        Creates an instance.
        Parameters:
        contents - the initial delegates, in the order they will be tried until one succeeds
        isAlwaysWorthTrying - true if isWorthTrying() should always return true rather than delegating
    • Method Detail

      • generateSeed

        public void generateSeed​(byte[] output)
                          throws SeedException
        Description copied from interface: SeedGenerator
        Generates a seed value for a random number generator in an existing array.
        Specified by:
        generateSeed in interface SeedGenerator
        Parameters:
        output - The array that is to be populated with the seed.
        Throws:
        SeedException - If a seed cannot be generated for any reason.
      • generateSeed

        public byte[] generateSeed​(int length)
                            throws SeedException
        Description copied from interface: SeedGenerator
        Generates and returns a seed value for a random number generator as a new array.
        Specified by:
        generateSeed in interface SeedGenerator
        Parameters:
        length - The length of the seed to generate (in bytes).
        Returns:
        A byte array containing the seed data.
        Throws:
        SeedException - If a seed cannot be generated for any reason.