Package org.availlang.persistence.tools.utility

Types

Link copied to clipboard
class EnumMap<K : Enum<K>, V : Any>(enums: Array<K>, sourceValues: Array<V?>) : MutableMap<K, V>

An EnumMap is a Map implementation for use with enum type keys only. All of the keys in an EnumMap must come from a single enum that is specified, explicitly as the first parameterized type. EnumMaps are represented internally as arrays. Enum maps are maintained in the natural order of their keys (Enum.ordinals).

Link copied to clipboard
class ParagraphFormatter @JvmOverloads constructor(    val windowWidth: Int = 80,     val leftMargin: Int = 0,     val rightMargin: Int = 0,     val firstIndent: Int = 0,     val restIndent: Int = 0)

A ParagraphFormatter object holds a particular paragraph style in the form of window width, margin, and indentation settings. It is then used to apply those whitespace and word-wrap settings to a String.

Link copied to clipboard
class ParagraphFormatterStream(formatter: ParagraphFormatter, appendable: Appendable) : Appendable

ParagraphFormatterStream wraps an Appendable with a ParagraphFormatter, so that Strings can automatically be formatted by the ParagraphFormatter before being appended to the output stream.

Functions

Link copied to clipboard
inline fun <T, R> Iterable<T>.mapToSet(destination: MutableSet<R> = mutableSetOf(), transform: (T) -> R): MutableSet<R>

Transform the receiver via the supplied function and collect the results into an optionally provided set. Answer the result set.

Link copied to clipboard
inline fun <K : Enum<K>, V : Any> Array<K>.toEnumMap(generator: (K) -> V): EnumMap<K, V>

Project the receiver onto an {@link EnumMap}, applying the function to each enum value of the array.