public class ConcurrentIntSet extends org.mini2Dx.gdx.utils.IntSet implements ConcurrentCollection
| Modifier and Type | Field and Description |
|---|---|
protected org.mini2Dx.lockprovider.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() |
org.mini2Dx.lockprovider.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.
|
int |
size()
Returns the size in a thread-safe manner
|
java.lang.String |
toString() |
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 int size()
public boolean add(int key)
add in class org.mini2Dx.gdx.utils.IntSetkey - public void addAll(org.mini2Dx.gdx.utils.IntArray array,
int offset,
int length)
addAll in class org.mini2Dx.gdx.utils.IntSetpublic void addAll(int[] array,
int offset,
int length)
addAll in class org.mini2Dx.gdx.utils.IntSetpublic void addAll(org.mini2Dx.gdx.utils.IntSet set)
addAll in class org.mini2Dx.gdx.utils.IntSetpublic boolean remove(int key)
remove in class org.mini2Dx.gdx.utils.IntSetkey - public boolean notEmpty()
notEmpty in class org.mini2Dx.gdx.utils.IntSetpublic boolean isEmpty()
isEmpty in class org.mini2Dx.gdx.utils.IntSetpublic void shrink(int maximumCapacity)
shrink in class org.mini2Dx.gdx.utils.IntSetmaximumCapacity - public void clear(int maximumCapacity)
clear in class org.mini2Dx.gdx.utils.IntSetmaximumCapacity - public void clear()
clear in class org.mini2Dx.gdx.utils.IntSetpublic boolean contains(int key)
contains in class org.mini2Dx.gdx.utils.IntSetpublic int first()
first in class org.mini2Dx.gdx.utils.IntSetpublic void ensureCapacity(int additionalCapacity)
ensureCapacity in class org.mini2Dx.gdx.utils.IntSetadditionalCapacity - public int hashCode()
hashCode in class org.mini2Dx.gdx.utils.IntSetpublic boolean equals(java.lang.Object obj)
equals in class org.mini2Dx.gdx.utils.IntSetpublic java.lang.String toString()
toString in class org.mini2Dx.gdx.utils.IntSetpublic org.mini2Dx.gdx.utils.IntSet.IntSetIterator iterator()
iterator in class org.mini2Dx.gdx.utils.IntSetpublic org.mini2Dx.lockprovider.ReadWriteLock getLock()
ConcurrentCollectionReadWriteLockgetLock in interface ConcurrentCollectionReadWriteLock