Package net.minecraft.util.collection
Class SortedArraySet<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
net.minecraft.util.collection.SortedArraySet<T>
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Set<T>
public class SortedArraySet<T> extends AbstractSet<T>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
SortedArraySet.SetIterator
-
Field Summary
Fields Modifier and Type Field Description private Comparator<T>
comparator
private T[]
elements
private int
size
-
Constructor Summary
Constructors Modifier Constructor Description private
SortedArraySet(int initialCapacity, Comparator<T> comparator)
-
Method Summary
Modifier and Type Method Description boolean
add(T t)
private void
add(T object, int index)
T
addAndGet(T object)
private int
binarySearch(T object)
private static <T> T[]
cast(Object[] array)
void
clear()
boolean
contains(Object object)
static <T extends Comparable<T>>
SortedArraySet<T>create(int initialCapacity)
private void
ensureCapacity(int minCapacity)
boolean
equals(Object object)
T
first()
private T
get(int index)
private static int
insertionPoint(int binarySearchResult)
Iterator<T>
iterator()
private void
remove(int index)
boolean
remove(Object object)
int
size()
Object[]
toArray()
<U> U[]
toArray(U[] u)
Methods inherited from class java.util.AbstractSet
hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, retainAll, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
addAll, containsAll, isEmpty, retainAll, spliterator
-
Field Details
-
comparator
-
elements
-
size
private int size
-
-
Constructor Details
-
SortedArraySet
-
-
Method Details
-
create
-
cast
-
binarySearch
-
insertionPoint
private static int insertionPoint(int binarySearchResult) -
add
- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceSet<T>
- Overrides:
add
in classAbstractCollection<T>
-
ensureCapacity
private void ensureCapacity(int minCapacity) -
add
-
remove
private void remove(int index) -
get
-
addAndGet
-
remove
- Specified by:
remove
in interfaceCollection<T>
- Specified by:
remove
in interfaceSet<T>
- Overrides:
remove
in classAbstractCollection<T>
-
first
-
contains
- Specified by:
contains
in interfaceCollection<T>
- Specified by:
contains
in interfaceSet<T>
- Overrides:
contains
in classAbstractCollection<T>
-
iterator
-
size
public int size()- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceSet<T>
- Specified by:
size
in classAbstractCollection<T>
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceSet<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
toArray
public <U> U[] toArray(U[] u)- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceSet<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceSet<T>
- Overrides:
clear
in classAbstractCollection<T>
-
equals
- Specified by:
equals
in interfaceCollection<T>
- Specified by:
equals
in interfaceSet<T>
- Overrides:
equals
in classAbstractSet<T>
-