Class Long2LongArray

  • All Implemented Interfaces:
    Seed2ArrayConverter<java.lang.Long,​long[]>, SeedConverter<java.lang.Long,​long[]>

    public class Long2LongArray
    extends java.lang.Object
    implements Seed2ArrayConverter<java.lang.Long,​long[]>
    Uses a Long value to seed a SplitMix64 RNG and create a long[] with the requested number of random values.
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int size
      Size of the output array.
    • Constructor Summary

      Constructors 
      Constructor Description
      Long2LongArray​(int size)
      Create an instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long[] convert​(java.lang.Long seed)
      Converts seed from input type to output type.
      long[] convert​(java.lang.Long seed, int outputSize)
      Converts seed from input type to output type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • size

        private final int size
        Size of the output array.
    • Constructor Detail

      • Long2LongArray

        public Long2LongArray​(int size)
        Create an instance.
        Parameters:
        size - Size of the output array.
    • Method Detail

      • convert

        public long[] convert​(java.lang.Long seed)
        Converts seed from input type to output type.
        Specified by:
        convert in interface SeedConverter<java.lang.Long,​long[]>
        Parameters:
        seed - Original seed value.
        Returns:
        the converted seed value.
      • convert

        public long[] convert​(java.lang.Long seed,
                              int outputSize)
        Converts seed from input type to output type. The output type is expected to be an array.
        Specified by:
        convert in interface Seed2ArrayConverter<java.lang.Long,​long[]>
        Parameters:
        seed - Original seed value.
        outputSize - Output size.
        Returns:
        the converted seed value.
        Since:
        1.3