public class ShortSet extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ShortSet.ShortSetIterator |
Modifier and Type | Field and Description |
---|---|
int |
size |
Constructor and Description |
---|
ShortSet()
Creates a new sets with an initial capacity of 32 and a load factor of 0.8.
|
ShortSet(int initialCapacity)
Creates a new set with a load factor of 0.8.
|
ShortSet(int initialCapacity,
float loadFactor)
Creates a new set with the specified initial capacity and load factor.
|
ShortSet(ShortSet map)
Creates a new map identical to the specified map.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(short key)
Returns true if the key was not already in the set.
|
void |
addAll(short... array) |
void |
addAll(short[] array,
int offset,
int length) |
void |
addAll(ShortSet set) |
void |
addAll(ShortVLA array) |
void |
addAll(ShortVLA array,
int offset,
int length) |
void |
clear() |
void |
clear(int maximumCapacity)
Clears the map and reduces the size of the backing arrays to be the specified capacity if they are larger.
|
boolean |
contains(short key) |
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
boolean |
equals(Object obj) |
int |
first() |
int |
hashCode() |
ShortSet.ShortSetIterator |
iterator()
Returns an iterator for the keys in the set.
|
boolean |
remove(short key)
Returns true if the key was removed.
|
void |
shrink(int maximumCapacity)
Reduces the size of the backing arrays to be the specified capacity or less.
|
String |
toString() |
static ShortSet |
with(short... array) |
public int size
public ShortSet()
public ShortSet(int initialCapacity)
public ShortSet(int initialCapacity, float loadFactor)
public boolean add(short key)
public void addAll(short... array)
public void addAll(short[] array, int offset, int length)
public boolean remove(short key)
public void shrink(int maximumCapacity)
public void clear(int maximumCapacity)
public void clear()
public boolean contains(short key)
public int first()
public void ensureCapacity(int additionalCapacity)
public ShortSet.ShortSetIterator iterator()
ShortSet.ShortSetIterator
constructor for nested or multithreaded iteration.Copyright © 2012–2016. All rights reserved.