# FloatSet

# FloatSet

Artifact: [androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection)  
[View Source](https://cs.android.com/search?q=file:androidx/collection/FloatSet.kt+class:androidx.collection.FloatSet)  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/collection/FloatSet "View this page in Java")
Common/AllAndroid/JVMNative/C/iOSJavaScript
  - Cmn  

  ```
  sealed class FloatSet
```  
Known direct subclasses  
[MutableFloatSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableFloatSet)  

|-------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MutableFloatSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableFloatSet) | [MutableFloatSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableFloatSet) is a container with a [MutableSet](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)-like interface based on a flat hash table implementation. |

*** ** * ** ***

[FloatSet](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet) is a container with a [Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)-like interface designed to avoid allocations, including boxing.

This implementation makes no guarantee as to the order of the elements, nor does it make guarantees that the order remains constant over time.

Though [FloatSet](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet) offers a read-only interface, it is always backed by a [MutableFloatSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableFloatSet). Read operations alone are thread-safe. However, any mutations done through the backing [MutableFloatSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableFloatSet) while reading on another thread are not safe and the developer must protect the set from such changes during read operations.  

|                                               See also                                                |
|-------------------------------------------------------------------------------------------------------|---|
| [MutableFloatSet](https://developer.android.com/reference/kotlin/androidx/collection/MutableFloatSet) |   |

## Summary

|                                       ### Protected constructors                                       |
|--------------------------------------------------------------------------------------------------------|-----|
| [FloatSet](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#FloatSet())`()` | Cmn |

|                                                                                   ### Public functions                                                                                    |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `inline `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                              | [all](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#all(kotlin.Function1))`(predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns true if all elements match the given [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#all(kotlin.Function1)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [any](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#any())`()` Returns `true` if this set has at least one element.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Cmn |
| `inline `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                              | [any](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#any(kotlin.Function1))`(predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns true if at least one element matches the given [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#any(kotlin.Function1)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Cmn |
| `operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                            | [contains](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#contains(kotlin.Float))`(element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns `true` if the specified [element](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#contains(kotlin.Float)) is present in this set, `false` otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Cmn |
| `@`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)        | [count](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#count())`()` Returns the number of elements in this set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Cmn |
| `inline @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [count](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#count(kotlin.Function1))`(predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns the number of elements matching the given [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#count(kotlin.Function1)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Cmn |
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                       | [equals](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` Compares the specified object [other](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#equals(kotlin.Any)) with this set for equality.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Cmn |
| `inline `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                                                                                                  | [first](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#first())`()` Returns the first element in the collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Cmn |
| `inline `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                                                                                                  | [first](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#first(kotlin.Function1))`(predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns the first element in the collection for which [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#first(kotlin.Function1)) returns `true`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Cmn |
| `inline `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                    | [forEach](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#forEach(kotlin.Function1))`(block: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`)` Iterates over every element stored in this set by invoking the specified [block](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#forEach(kotlin.Function1)) lambda.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Cmn |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                        | [hashCode](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#hashCode())`()` Returns the hash code value for this set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [isEmpty](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#isEmpty())`()` Indicates whether this set is empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [isNotEmpty](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#isNotEmpty())`()` Returns `true` if this set is not empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Cmn |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                         | [joinToString](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))`(` ` separator: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` prefix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` postfix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` limit: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` truncated: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html) `)` Creates a String from the elements separated by [separator](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) and using [prefix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) before and [postfix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) after, if supplied.                                                                                                                                                                                                                                                                                          | Cmn |
| `inline `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                | [joinToString](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1))`(` ` separator: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` prefix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` postfix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` limit: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` truncated: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` crossinline transform: (`[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html) `)` Creates a String from the elements separated by [separator](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) and using [prefix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) before and [postfix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) after, if supplied. | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                       | [none](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#none())`()` Returns `true` if this set has no elements.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Cmn |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                  | [toString](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#toString())`()` Returns a string representation of this set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Cmn |

|                            ### Public properties                            |
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [capacity](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#capacity()) Returns the number of elements that can be stored in this set without requiring internal storage reallocation. | Cmn |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [size](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#size()) Returns the number of elements in this set.                                                                            | Cmn |

## Protected constructors

### FloatSet

Cmn  

```
protected FloatSet()
```

## Public functions

### all

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun all(predicate: (element: Float) -> Boolean): Boolean
```

Returns true if all elements match the given [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#all(kotlin.Function1)).  

|                                                                                             Parameters                                                                                             |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| `predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | called for elements in the set to determine if it returns return `true` for all elements. |

### any

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun any(): Boolean
```

Returns `true` if this set has at least one element.  

### any

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun any(predicate: (element: Float) -> Boolean): Boolean
```

Returns true if at least one element matches the given [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#any(kotlin.Function1)).  

|                                                                                             Parameters                                                                                             |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| `predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | called for elements in the set to determine if it returns `true` for any elements. |

### contains

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
operator fun contains(element: Float): Boolean
```

Returns `true` if the specified [element](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#contains(kotlin.Float)) is present in this set, `false` otherwise.  

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|-------------------------------------|
| `element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The element to look for in this set |

### count

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun count(): @IntRange(from = 0) Int
```

Returns the number of elements in this set.  

### count

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun count(predicate: (element: Float) -> Boolean): @IntRange(from = 0) Int
```

Returns the number of elements matching the given [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#count(kotlin.Function1)).  

|                                                                                             Parameters                                                                                             |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|
| `predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Called for all elements in the set to count the number for which it returns `true`. |

### equals

Cmn  

```
open operator fun equals(other: Any?): Boolean
```

Compares the specified object [other](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#equals(kotlin.Any)) with this set for equality. The two objects are considered equal if [other](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#equals(kotlin.Any)):

- Is a [FloatSet](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet)

- Has the same [size](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#size()) as this set

- Contains elements equal to this set's elements

### first

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun first(): Float
```

Returns the first element in the collection.  

|                                                           Throws                                                            |
|-----------------------------------------------------------------------------------------------------------------------------|----------------------------|
| [kotlin.NoSuchElementException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-no-such-element-exception/index.html) | if the collection is empty |

### first

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun first(predicate: (element: Float) -> Boolean): Float
```

Returns the first element in the collection for which [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#first(kotlin.Function1)) returns `true`.

**Note** There is no mechanism for both determining if there is an element that matches [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#first(kotlin.Function1)) *and* returning it if it exists. Developers should use [forEach](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#forEach(kotlin.Function1)) to achieve this behavior.  

|                                                                                             Parameters                                                                                             |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| `predicate: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Called on elements of the set, returning `true` for an element that matches or `false` if it doesn't |

|                                     Returns                                     |
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | An element in the set for which [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#first(kotlin.Function1)) returns `true`. |

|                                                           Throws                                                            |
|-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.NoSuchElementException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-no-such-element-exception/index.html) | if [predicate](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#first(kotlin.Function1)) returns `false` for all elements or the collection is empty. |

### forEach

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun forEach(block: (element: Float) -> Unit): Unit
```

Iterates over every element stored in this set by invoking the specified [block](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#forEach(kotlin.Function1)) lambda.  

|                                                                                        Parameters                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| `block: (element: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | called with each element in the set |

### hashCode

Cmn  

```
open fun hashCode(): Int
```

Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set.  

### isEmpty

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun isEmpty(): Boolean
```

Indicates whether this set is empty.  

### isNotEmpty

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun isNotEmpty(): Boolean
```

Returns `true` if this set is not empty.  

### joinToString

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun joinToString(
    separator: CharSequence = ", ",
    prefix: CharSequence = "",
    postfix: CharSequence = "",
    limit: Int = -1,
    truncated: CharSequence = "..."
): String
```

Creates a String from the elements separated by [separator](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) and using [prefix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) before and [postfix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) after, if supplied.

When a non-negative value of [limit](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) is provided, a maximum of [limit](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) items are used to generate the string. If the collection holds more than [limit](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)) items, the string is terminated with [truncated](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)).  

### joinToString

Cmn  

```
inline fun joinToString(
    separator: CharSequence = ", ",
    prefix: CharSequence = "",
    postfix: CharSequence = "",
    limit: Int = -1,
    truncated: CharSequence = "...",
    crossinline transform: (Float) -> CharSequence
): String
```

Creates a String from the elements separated by [separator](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) and using [prefix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) before and [postfix](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) after, if supplied. [transform](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) dictates how each element will be represented.

When a non-negative value of [limit](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) is provided, a maximum of [limit](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) items are used to generate the string. If the collection holds more than [limit](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)) items, the string is terminated with [truncated](https://developer.android.com/reference/kotlin/androidx/collection/FloatSet#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function1)).  

### none

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun none(): Boolean
```

Returns `true` if this set has no elements.  

### toString

Cmn  

```
open fun toString(): String
```

Returns a string representation of this set. The set is denoted in the string by the `{}`. Each element is separated by `, `.

## Public properties

### capacity

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
val capacity: Int
```

Returns the number of elements that can be stored in this set without requiring internal storage reallocation.  

### size

Cmn  
Added in [1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
val size: Int
```

Returns the number of elements in this set.