Class GKRandomSource

    • Constructor Detail

      • GKRandomSource

        protected GKRandomSource​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • sharedRandom

        public static GKRandomSource sharedRandom()
        Returns a shared instance of a random source that uses the system's underlying random source. Using this instance modifies the outcome of future calls to the arc4random family of C calls. It is also affected by calls to the C apis and should not be used for sources that are intended to be deterministic. Note that while it may seem semantically similar to a GKARC4RandomSource, this is not a drop in replacement.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • arrayByShufflingObjectsInArray

        public NSArray<?> arrayByShufflingObjectsInArray​(NSArray<?> array)
        Returns a shuffled instance of the given array. The objects in the array are shuffled based on a Fisher-Yates shuffle. Any random, be it custom, source or a distribution, that can provide a number with an upper bound of at least the array.count is suitable for this shuffle.
      • copyWithZone

        public java.lang.Object copyWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • init

        public GKRandomSource init()
        Creates a new random source initialized using bits from an entropy source like SecRandomCopyBytes. When used directly from the base class; this source is deterministic and performant but the underlying implementation details are not specified. Use a subclass with a specific algorithm implementation guaranteed if your application requires very stringent random source charateristics.
        Overrides:
        init in class NSObject
        See Also:
        GKARC4RandomSource, GKLinearCongruentialRandomSource, GKMersenneTwisterRandomSource
      • nextBool

        public boolean nextBool()
        Description copied from interface: GKRandom
        Returns the next true or false value in the random sequence and moves ahead to the next one. The value is either nonzero (true) or zero (false). Use this for simple boolean switches in logic that don't require fuzzy evaluation. For fuzzy evaluation use nextUniform. By default this should be based on nextIntWithUpperBound:. Implementations may base it on another representation if needed.
        Specified by:
        nextBool in interface GKRandom
        See Also:
        GKRandom.nextUniform()
      • nextInt

        public long nextInt()
        Description copied from interface: GKRandom
        Returns the next integer in the random sequence and moves ahead to the next one. The value is in the range of [INT32_MIN, INT32_MAX]. The lower bits are not guaranteed to be random so please use another property for simple choices.
        Specified by:
        nextInt in interface GKRandom
        See Also:
        GKRandom.nextBool(), GKRandom.nextUniform()
      • nextIntWithUpperBound

        public long nextIntWithUpperBound​(long upperBound)
        Description copied from interface: GKRandom
        Returns the next unsigned value in the random sequence that is less than upperBound. The value is in the range of [0, upperBound). Thus the value never equals or exceeeds upperBound. The unsigned nature and upper bound allows implementations to use logical shifts to return a value whose lower bits are more random than a similar call to nextInt. This is used to implement nextBool and nextUniform by default.
        Specified by:
        nextIntWithUpperBound in interface GKRandom
      • nextUniform

        public float nextUniform()
        Description copied from interface: GKRandom
        Returns the next uniform float in the random sequence and moves ahead to the next one. The value is in the range of [0.0, 1.0]. There is no weighting across the range so remapping this with a curve may give the best sampling distribution for your algorithm. By default this should be based on nextIntWithUpperBound:. Implementions may base it on another representation if needed.
        Specified by:
        nextUniform in interface GKRandom
        See Also:
        GKRandom.nextInt()
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding