Set
Set
A basic set container backed by either hash set or linked hash set.
Set type
set<Type>
| Subtypes | Supertypes | Comparable types |
|---|---|---|
| sorted_set<Type> | sequence<Type> | java.util.Set<Type> |
Set creation
new hashsetnew linked_hashset
| Parameter type | Result type |
|---|---|
| Type... | set<Type> |
Creates an empty set. Optionally, initial values may be specified right in the new set creation expression.
Alternatively, a sequence may be specified that is used to copy elements from.
Operations on set
iterator
| Operand type | Parameter type | Result type |
|---|---|---|
| sequence<Type> | none | modifying_iterator<Type> |
This operation is redefined for set to return a modifying_iterator .
add
| Operand type | Parameter type | Result type |
|---|---|---|
| set<Type> | Type | Type |
Adds an element to the set.
addAll
| Operand type | Parameter type | Result type |
|---|---|---|
| set<Type> | sequence<Type> | set<Type> |
Adds all elements in the parameter sequence to the set.
remove
| Operand type | Parameter type | Result type |
|---|---|---|
| set<Type> | Type | Type |
Removes an element from the set.
removeAll
| Operand type | Parameter type | Result type |
|---|---|---|
| set<Type> | sequence<Type> | set<Type> |
Removes all elements in the parameter sequence from the set.
clear
| Operand type | Parameter type | Result type |
|---|---|---|
| set<Type> | none | void |
Clears all elements from the set.