Class RandomUtils.RandomIntCache

  • Enclosing class:
    RandomUtils

    public static class RandomUtils.RandomIntCache
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int[] cache  
      private int generation  
      private int index  
      private java.util.logging.Logger logger  
      private java.lang.String logMe  
      private java.util.Random random  
      private int range  
      private int size  
    • Constructor Summary

      Constructors 
      Constructor Description
      RandomIntCache​(java.util.logging.Logger logger, java.lang.String logMe, java.util.Random random, int range, int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int nextInt()  
      int nextInt​(int tighterRange)  
      private void refill()  
      • Methods inherited from class java.lang.Object

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

      • logger

        private final java.util.logging.Logger logger
      • logMe

        private final java.lang.String logMe
      • random

        private final java.util.Random random
      • range

        private final int range
      • size

        private final int size
      • generation

        private int generation
      • cache

        private int[] cache
      • index

        private int index
    • Constructor Detail

      • RandomIntCache

        public RandomIntCache​(java.util.logging.Logger logger,
                              java.lang.String logMe,
                              java.util.Random random,
                              int range,
                              int size)
    • Method Detail

      • refill

        private void refill()
      • nextInt

        public int nextInt()
      • nextInt

        public int nextInt​(int tighterRange)