Package edu.cornell.cs.apl.viaduct.util

Types

Colors
Link copied to clipboard
object Colors

A nice, web-compatible color palette. Based on Colors.

FreshNameGenerator
Link copied to clipboard
class FreshNameGenerator(initialNames: Set<String>)

Generates distinct names. Never generates the same name twice.

UniqueQueue
Link copied to clipboard
class UniqueQueue<E> : AbstractQueue<E>

A queue implementation that keeps only one copy of each element.

Functions

asComparable
Link copied to clipboard
fun <T : Comparable<T>> Set<T>.asComparable(): Comparable<Set<T>>
duration
Link copied to clipboard
fun <R> KLogger.duration(operationName: String, operation: () -> R): R

Calls operation and returns the result. Additionally, logs its running time using KLogger.info.

graphemeClusterCount
Link copied to clipboard
fun CharSequence.graphemeClusterCount(): Int

Number of grapheme clusters (i.e. user-perceived characters) in the string.

unions
Link copied to clipboard
fun <K, V> Iterable<Map<K, V>>.unions(): Map<K, V>

Returns the union of all given maps.

fun <T> Iterable<Set<T>>.unions(): Set<T>

Returns the union of all given sets.

Properties

unicodeLineBreak
Link copied to clipboard
val unicodeLineBreak: Regex

A regular expression that recognizes Unicode line breaks.