object ThreadLocalRandom extends ThreadLocalRandom
- Alphabetic
- By Inheritance
- ThreadLocalRandom
- ThreadLocalRandom
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getRandomAlpha(maxLength: Int, minLength: Int = 0): String
Returns a string of pseudorandom lower and upper case letters from the current thread local random instance.
Returns a string of pseudorandom lower and upper case letters from the current thread local random instance.
- maxLength
The greatest number of char the random string the return can possibly be (inclusive)
- minLength
The least number of char the random string will be; defaults to max value
- returns
A pseudorandom Letters only string
- Definition Classes
- ThreadLocalRandom
-
def
getRandomAlphaNumeric(maxLength: Int, minLength: Int = 0): String
Returns a string of pseudorandom numbers and lower/upper case letters from the current thread local random instance.
Returns a string of pseudorandom numbers and lower/upper case letters from the current thread local random instance.
- maxLength
The greatest number of char the random string the return can possibly be (inclusive)
- minLength
The least number of char the random string will be; defaults to max value
- returns
A pseudorandom Letters and Numbers string
- Definition Classes
- ThreadLocalRandom
-
def
getRandomCustom(maxLength: Int, minLength: Int, chars: Seq[Char]): String
Returns a string of pseudorandom user defined input from the current thread local random instance.
Returns a string of pseudorandom user defined input from the current thread local random instance.
This is the work horse of the entire Random String set of functions as they are all just hard coded user defined char sets It is also where the random length of the string is determined for all of them
- maxLength
The greatest number of char the random string the return can possibly be
- minLength
The least number of char the random string will be; defaults to max value
- chars
The seq of character's you wish to choose from to form this string
- returns
A pseudorandom string from user defined values
- Definition Classes
- ThreadLocalRandom
-
def
getRandomDouble(max: Double = Double.MaxValue, min: Double = 1.0): Double
Returns the next generated pseudorandom between Double.MaxValue and Double.MinValue from the current thread local random instance.
Returns the next generated pseudorandom between Double.MaxValue and Double.MinValue from the current thread local random instance.
- max
The greatest Double the return can possibly be (inclusive)
- min
The least Double the return can possibly be (inclusive)
- returns
A pseudorandom Double
- Definition Classes
- ThreadLocalRandom
- Note
Within the java implementation of ThreadLocalRandom The origin (min) is inclusive The bound (max) is exclusive Have to do a little math on the decimal point to determine how much you need to add in order to make the max value inclusive We don't need to add 1 to the double that are valid Int's because a max of 1 min of 0 would result in a possible value of 1.1
-
def
getRandomDoubleFormatted(max: Double = Double.MaxValue, min: Double = 1.0, decimalPlaces: Int = 2): String
Returns the next generated pseudorandom Double between user defined max and user defined min from the current thread local random instance with specific amount of decimal places.
Returns the next generated pseudorandom Double between user defined max and user defined min from the current thread local random instance with specific amount of decimal places.
- max
The greatest Double the return can possibly be (inclusive)
- min
The least Double the return can possibly be (inclusive)
- decimalPlaces
The amount of decimal places in the returned value
- returns
A pseudorandom Double
- Definition Classes
- ThreadLocalRandom
-
def
getRandomFloat(max: Float = Float.MaxValue, min: Float = 1.0F): Float
Returns the next generated pseudorandom between Float.MaxValue and Float.MinValue from the current thread local random instance.
Returns the next generated pseudorandom between Float.MaxValue and Float.MinValue from the current thread local random instance.
- max
The greatest Float the return can possibly be (inclusive)
- min
The least Float the return can possibly be (inclusive)
- returns
A pseudorandom Float
- Definition Classes
- ThreadLocalRandom
- Note
Within the java implementation of ThreadLocalRandom The origin (min) is inclusive The bound (max) is exclusive Have to do a little math on the decimal point to determine how much you need to add in order to make the max value inclusive We don't need to add 1 to the double that are valid Int's because a max of 1 min of 0 would result in a possible value of 1.1
-
def
getRandomInt(max: Int = Int.MaxValue, min: Int = 1): Int
Returns the next generated pseudorandom between Int.MaxValue and Int.MinValue from the current thread local random instance.
Returns the next generated pseudorandom between Int.MaxValue and Int.MinValue from the current thread local random instance.
- max
The greatest Int the return can possibly be (inclusive)
- min
The least Int the return can possibly be (inclusive)
- returns
A pseudorandom Int
- Definition Classes
- ThreadLocalRandom
- Note
Within the java implementation of ThreadLocalRandom The origin (min) is inclusive The bound (max) is exclusive Which is why its necessary to sometimes add 1 behind the scenes to the max value so this becomes inclusive
-
def
getRandomLong(max: Long = Long.MaxValue, min: Long = 1L): Long
Returns the next generated pseudorandom between Long.MaxValue and Long.MinValue from the current thread local random instance.
Returns the next generated pseudorandom between Long.MaxValue and Long.MinValue from the current thread local random instance.
- max
The greatest Long the return can possibly be (inclusive)
- min
The least Long the return can possibly be (inclusive)
- returns
A pseudorandom Long
- Definition Classes
- ThreadLocalRandom
- Note
Within the java implementation of ThreadLocalRandom The origin (min) is inclusive The bound (max) is exclusive Which is why its necessary to sometimes add 1 behind the scenes to the max value so this becomes inclusive
-
def
getRandomNumeric(maxLength: Int, minLength: Int = 0): String
Returns a string of pseudorandom numbers from the current thread local random instance.
Returns a string of pseudorandom numbers from the current thread local random instance.
- maxLength
The greatest number of char the random string the return can possibly be
- minLength
The least number of char the random string will be; defaults to max value
- returns
A pseudorandom Letters and Numbers string
- Definition Classes
- ThreadLocalRandom
-
def
getRandomZonedDateTime(alphaDateTime: ZonedDateTime, omegaDateTime: ZonedDateTime, zoneId: Option[String] = None): ZonedDateTime
Returns the next generated pseudorandom Date and Time
Returns the next generated pseudorandom Date and Time
- alphaDateTime
The most distant a timestamp should be for the time range
- omegaDateTime
The least distant a timestamp should be for the time range
- zoneId
The timezone
- returns
A pseudorandom ZonedDateTime
- Definition Classes
- ThreadLocalRandom
-
def
getRandomZonedDateTime(alphaDateTime: ZonedDateTime, omegaDateTime: ZonedDateTime, dateTimeFormat: String, zoneId: Option[String]): String
Returns the next generated pseudorandom Date and Time
Returns the next generated pseudorandom Date and Time
- alphaDateTime
The most distant a timestamp should be for the time range
- omegaDateTime
The least distant a timestamp should be for the time range
- dateTimeFormat
The format the date and time should be in
- zoneId
The timezone
- returns
A pseudorandom Formatted String of ZonedDateTime
- Definition Classes
- ThreadLocalRandom
-
def
getRandomZonedDateTimeByOffset(pastOffsetInSeconds: Long, futureOffsetInSeconds: Long, mediumDateTime: ZonedDateTime): ZonedDateTime
Returns the next generated pseudorandom Date and Time
Returns the next generated pseudorandom Date and Time
- pastOffsetInSeconds
The most distant a datetime should in seconds to be considered for the time range
- futureOffsetInSeconds
The least distant a datetime should in seconds to be considered for the time range
- mediumDateTime
The middle of the datetime range
- returns
A pseudorandom ZonedDateTime
- Definition Classes
- ThreadLocalRandom
-
def
getRandomZonedDateTimeByOffset(dateTimeFormat: String, pastOffsetInSeconds: Long, futureOffsetInSeconds: Long, mediumDateTime: ZonedDateTime): String
Returns the next generated pseudorandom Date and Time
Returns the next generated pseudorandom Date and Time
- dateTimeFormat
The format of the returned datetime
- pastOffsetInSeconds
The most distant a datetime should in seconds to be considered for the time range
- futureOffsetInSeconds
The least distant a datetime should in seconds to be considered for the time range
- mediumDateTime
The middle of the datetime range
- returns
A pseudorandom Formatted String of ZonedDateTime
- Definition Classes
- ThreadLocalRandom
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
setRandomSeed(seed: Long): Unit
Sets the random seed for every ThreadLocalRandom call
Sets the random seed for every ThreadLocalRandom call
- seed
The value to use to seed the ThreadLocalRandom calls
- returns
Unit
- Definition Classes
- ThreadLocalRandom
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )