class NonEmptySet<T> : MutableSet<T>
A set which is constrained to ensure it can never be empty. An initial value must be provided at construction, and attempting to remove the last element will cause an IllegalStateException. The underlying set is exposed for Kryo to access, but should not be accessed directly.
Iterator |
inner class Iterator<out T, T> : MutableIterator<T> |
<init> |
NonEmptySet(initial: T) A set which is constrained to ensure it can never be empty. An initial value must be provided at construction, and attempting to remove the last element will cause an IllegalStateException. The underlying set is exposed for Kryo to access, but should not be accessed directly. |
size |
val size: Int |
add |
fun add(element: T): Boolean |
addAll |
fun addAll(elements: Collection<T>): Boolean |
clear |
fun clear(): Nothing |
contains |
fun contains(element: T): Boolean |
containsAll |
fun containsAll(elements: Collection<T>): Boolean |
equals |
fun equals(other: Any?): Boolean |
hashCode |
fun hashCode(): Int |
isEmpty |
fun isEmpty(): Boolean |
iterator |
fun iterator(): MutableIterator<T> |
remove |
fun remove(element: T): Boolean |
removeAll |
fun removeAll(elements: Collection<T>): Boolean |
retainAll |
fun retainAll(elements: Collection<T>): Boolean |
toString |
fun toString(): String |
isOrderedAndUnique |
fun <T, I : Comparable<I>> Iterable<T>.isOrderedAndUnique(extractId: T.() -> I): Boolean Determine if an iterable data types contents are ordered and unique, based on their Comparable.compareTo function. |
noneOrSingle |
fun <T> Iterable<T>.noneOrSingle(predicate: (T) -> Boolean): T? Returns the single element matching the given predicate, or fun <T> Iterable<T>.noneOrSingle(): T? Returns single element, or |