public class ConcurrentIntSet extends org.mini2Dx.gdx.utils.IntSet implements ConcurrentCollection
Modifier and Type | Field and Description |
---|---|
protected ReadWriteLock |
lock |
Constructor and Description |
---|
ConcurrentIntSet()
Creates a new set with an initial capacity of 51 and a load factor of 0.8.
|
ConcurrentIntSet(int initialCapacity)
Creates a new set with a load factor of 0.8.
|
ConcurrentIntSet(int initialCapacity,
float loadFactor)
Creates a new set with the specified initial capacity and load factor.
|
ConcurrentIntSet(org.mini2Dx.gdx.utils.IntSet set)
Creates a new set identical to the specified set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int key)
Returns true if the key was not already in the set.
|
void |
addAll(int[] array,
int offset,
int length) |
void |
addAll(org.mini2Dx.gdx.utils.IntArray array,
int offset,
int length) |
void |
addAll(org.mini2Dx.gdx.utils.IntSet set) |
void |
clear() |
void |
clear(int maximumCapacity)
Clears the set and reduces the size of the backing arrays to be the specified capacity if they are larger.
|
boolean |
contains(int key) |
void |
ensureCapacity(int additionalCapacity)
Increases the size of the backing array to accommodate the specified number of additional items.
|
boolean |
equals(java.lang.Object obj) |
int |
first() |
ReadWriteLock |
getLock()
Returns the collection's
ReadWriteLock |
int |
hashCode() |
boolean |
isEmpty()
Returns true if the set is empty.
|
org.mini2Dx.gdx.utils.IntSet.IntSetIterator |
iterator()
Returns an iterator for the keys in the set.
|
boolean |
notEmpty()
Returns true if the set has one or more items.
|
boolean |
remove(int 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.
|
java.lang.String |
toString() |
protected ReadWriteLock lock
public ConcurrentIntSet()
public ConcurrentIntSet(int initialCapacity)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.public ConcurrentIntSet(int initialCapacity, float loadFactor)
initialCapacity
- If not a power of two, it is increased to the next nearest power of two.loadFactor
- public ConcurrentIntSet(org.mini2Dx.gdx.utils.IntSet set)
set
- public boolean add(int key)
add
in class org.mini2Dx.gdx.utils.IntSet
key
- public void addAll(org.mini2Dx.gdx.utils.IntArray array, int offset, int length)
addAll
in class org.mini2Dx.gdx.utils.IntSet
public void addAll(int[] array, int offset, int length)
addAll
in class org.mini2Dx.gdx.utils.IntSet
public void addAll(org.mini2Dx.gdx.utils.IntSet set)
addAll
in class org.mini2Dx.gdx.utils.IntSet
public boolean remove(int key)
remove
in class org.mini2Dx.gdx.utils.IntSet
key
- public boolean notEmpty()
notEmpty
in class org.mini2Dx.gdx.utils.IntSet
public boolean isEmpty()
isEmpty
in class org.mini2Dx.gdx.utils.IntSet
public void shrink(int maximumCapacity)
shrink
in class org.mini2Dx.gdx.utils.IntSet
maximumCapacity
- public void clear(int maximumCapacity)
clear
in class org.mini2Dx.gdx.utils.IntSet
maximumCapacity
- public void clear()
clear
in class org.mini2Dx.gdx.utils.IntSet
public boolean contains(int key)
contains
in class org.mini2Dx.gdx.utils.IntSet
public int first()
first
in class org.mini2Dx.gdx.utils.IntSet
public void ensureCapacity(int additionalCapacity)
ensureCapacity
in class org.mini2Dx.gdx.utils.IntSet
additionalCapacity
- public int hashCode()
hashCode
in class org.mini2Dx.gdx.utils.IntSet
public boolean equals(java.lang.Object obj)
equals
in class org.mini2Dx.gdx.utils.IntSet
public java.lang.String toString()
toString
in class org.mini2Dx.gdx.utils.IntSet
public org.mini2Dx.gdx.utils.IntSet.IntSetIterator iterator()
iterator
in class org.mini2Dx.gdx.utils.IntSet
public ReadWriteLock getLock()
ConcurrentCollection
ReadWriteLock
getLock
in interface ConcurrentCollection
ReadWriteLock