public class IntSet extends AbstractSet<Integer> implements Serializable
Constructor and Description |
---|
IntSet()
Creates a new empty integer set
|
IntSet(Collection<Integer> collection)
Creates a set of integers from the given collection
|
IntSet(int capacity)
Creates an empty integer set pre-allocated to store a specific number of
items
|
IntSet(int capacity,
float loadFactor)
Creates an empty integer set pre-allocated to store a specific number of
items
|
IntSet(Set<Integer> set)
Creates a new set of integers from the given set
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int e) |
boolean |
add(Integer e) |
void |
clear() |
boolean |
contains(int o) |
boolean |
contains(Object o) |
static IntSet |
from(int... ints)
Creates a set of integers from the given list of integers.
|
Iterator<Integer> |
iterator() |
boolean |
remove(int key) |
boolean |
remove(Object key) |
int |
size() |
equals, hashCode, removeAll
addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
public IntSet()
public IntSet(int capacity)
capacity
- the number of items to storepublic IntSet(int capacity, float loadFactor)
capacity
- the number of items to storeloadFactor
- the maximum ratio of used to un-used storagepublic IntSet(Set<Integer> set)
set
- the set of integers to create a copy ofpublic IntSet(Collection<Integer> collection)
collection
- a collection of integers to create a set frompublic static IntSet from(int... ints)
ints
- a list of integers to create a set frompublic void clear()
clear
in interface Collection<Integer>
clear
in interface Set<Integer>
clear
in class AbstractCollection<Integer>
public boolean add(Integer e)
add
in interface Collection<Integer>
add
in interface Set<Integer>
add
in class AbstractCollection<Integer>
public boolean add(int e)
e
- element to be added to this setpublic boolean contains(int o)
public boolean remove(Object key)
remove
in interface Collection<Integer>
remove
in interface Set<Integer>
remove
in class AbstractCollection<Integer>
public boolean remove(int key)
key
- the value from the set to removepublic boolean contains(Object o)
contains
in interface Collection<Integer>
contains
in interface Set<Integer>
contains
in class AbstractCollection<Integer>
public int size()
size
in interface Collection<Integer>
size
in interface Set<Integer>
size
in class AbstractCollection<Integer>
Copyright © 2017. All rights reserved.