All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.data.Cluster.kt Maven / Gradle / Ivy

There is a newer version: 0.11.4
Show newest version
package com.juul.krayon.chart.data

/** A non-empty [List]. A cluster is usually used to represent multiple nouns within a single state or category. */
public data class Cluster(
    private val entries: List,
) : List by entries {
    init {
        require(entries.isNotEmpty()) { "A cluster must have at least 1 entry." }
    }
}

public fun  clusterOf(firstValue: T, vararg moreValues: T): Cluster =
    Cluster(listOf(firstValue, *moreValues))

public fun  Iterable.toCluster(): Cluster =
    Cluster(toList())




© 2015 - 2025 Weber Informatics LLC | Privacy Policy