headSet

open override fun headSet(toElement: E, inclusive: Boolean): NavigableSet<E>

Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Return

a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement

Parameters

toElement

high endpoint of the returned set

inclusive

true if the high endpoint is to be included in the returned view

Throws

if toElement is not compatible with this set's comparator (or, if the set has no comparator, if toElement does not implement Comparable). Implementations may, but are not required to, throw this exception if toElement cannot be compared to elements currently in the set.

if toElement is null and this set does not permit null elements

if this set itself has a restricted range, and toElement lies outside the bounds of the range


open override fun headSet(toElement: E): SortedSet<E>

{@inheritDoc}

Equivalent to headSet(toElement, false).

Throws