intellij-randomness / com.fwdekker.randomness.decimal / DecimalScheme

DecimalScheme

data class DecimalScheme : Scheme<DecimalScheme>

Contains settings for generating random decimals.

Constructors

<init>

DecimalScheme(myName: String = DEFAULT_NAME, minValue: Double = DEFAULT_MIN_VALUE, maxValue: Double = DEFAULT_MAX_VALUE, decimalCount: Int = DEFAULT_DECIMAL_COUNT, showTrailingZeroes: Boolean = DEFAULT_SHOW_TRAILING_ZEROES, groupingSeparator: String = DEFAULT_GROUPING_SEPARATOR, decimalSeparator: String = DEFAULT_DECIMAL_SEPARATOR, prefix: String = DEFAULT_PREFIX, suffix: String = DEFAULT_SUFFIX)

Contains settings for generating random decimals.

Properties

decimalCount

var decimalCount: Int

The number of decimals to display.

decimalSeparator

var decimalSeparator: String

The character that should separate decimals.

groupingSeparator

var groupingSeparator: String

The character that should separate groups.

maxValue

var maxValue: Double

The maximum value to be generated, inclusive.

minValue

var minValue: Double

The minimum value to be generated, inclusive.

myName

var myName: String

The name of the scheme.

prefix

var prefix: String

The string to prepend to the generated value.

showTrailingZeroes

var showTrailingZeroes: Boolean

Whether to include trailing zeroes in the decimals.

suffix

var suffix: String

The string to append to the generated value.

Functions

copyAs

fun copyAs(name: String): DecimalScheme

Returns a copy of this scheme that has the given name.

copyFrom

fun copyFrom(other: DecimalScheme): Unit

Shallowly copies the state of other into this.

safeSetDecimalSeparator

fun safeSetDecimalSeparator(decimalSeparator: String?): Unit

Sets the decimal separator safely to ensure that exactly one character is set.

safeSetGroupingSeparator

fun safeSetGroupingSeparator(groupingSeparator: String?): Unit

Sets the grouping separator safely to ensure that exactly one character is set.

Inherited Functions

getName

open fun getName(): String

Same as myName.

Companion Object Properties

DEFAULT_DECIMAL_COUNT

const val DEFAULT_DECIMAL_COUNT: Int

The default value of the decimalCount field.

DEFAULT_DECIMAL_SEPARATOR

const val DEFAULT_DECIMAL_SEPARATOR: String

The default value of the decimalSeparator field.

DEFAULT_GROUPING_SEPARATOR

const val DEFAULT_GROUPING_SEPARATOR: String

The default value of the groupingSeparator field.

DEFAULT_MAX_VALUE

const val DEFAULT_MAX_VALUE: Double

The default value of the maxValue field.

DEFAULT_MIN_VALUE

const val DEFAULT_MIN_VALUE: Double

The default value of the minValue field.

DEFAULT_PREFIX

const val DEFAULT_PREFIX: String

The default value of the prefix field.

DEFAULT_SHOW_TRAILING_ZEROES

const val DEFAULT_SHOW_TRAILING_ZEROES: Boolean

The default value of the showTrailingZeroes field.

DEFAULT_SUFFIX

const val DEFAULT_SUFFIX: String

The default value of the suffix field.