Class GKRandomSource

All Implemented Interfaces:
NSCoding, NSObjectProtocol, NSSecureCoding, GKRandom, ObjCProtocol
Direct Known Subclasses:
GKARC4RandomSource, GKLinearCongruentialRandomSource, GKMersenneTwisterRandomSource

public class GKRandomSource
extends NSObject
implements GKRandom, NSSecureCoding
Since:
Available in iOS 9.0 and later.
  • Constructor Details

    • GKRandomSource

      public GKRandomSource()
    • GKRandomSource

      protected GKRandomSource​(NSObject.Handle h, long handle)
    • GKRandomSource

      protected GKRandomSource​(NSObject.SkipInit skipInit)
    • GKRandomSource

      public GKRandomSource​(NSCoder coder)
  • Method Details

    • supportsSecureCoding

      public static boolean supportsSecureCoding()
    • init

      protected long init​(NSCoder coder)
    • shuffleArray

      public NSArray<?> shuffleArray​(NSArray<?> array)
    • getSharedRandom

      public static GKRandomSource getSharedRandom()
    • nextInt

      public long nextInt()
      Specified by:
      nextInt in interface GKRandom
    • nextInt

      public long nextInt​(long upperBound)
      Specified by:
      nextInt in interface GKRandom
    • nextUniform

      public float nextUniform()
      Specified by:
      nextUniform in interface GKRandom
    • nextBool

      public boolean nextBool()
      Specified by:
      nextBool in interface GKRandom
    • encode

      public void encode​(NSCoder coder)
      Specified by:
      encode in interface NSCoding