public class ByteArraySet extends AbstractByteSet implements ByteSortedSet
List.indexOf(Object) for no duplication.
Unless a array constructor is used the ArraySet does not allow for duplication.
This implementation does not shrink the backing array| Constructor and Description |
|---|
ByteArraySet()
Default Constructor
|
ByteArraySet(byte[] array)
Constructur using initial Array
|
ByteArraySet(byte[] array,
int length)
Constructur using initial Array
|
ByteArraySet(ByteCollection c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
ByteArraySet(ByteSet s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
ByteArraySet(java.util.Collection<? extends java.lang.Byte> c)
Deprecated.
|
ByteArraySet(int capacity)
Minimum Capacity Constructor
|
ByteArraySet(java.util.Set<? extends java.lang.Byte> s)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(byte o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAndMoveToFirst(byte o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(byte o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
ByteComparator |
comparator()
A Type Specific Comparator method
|
boolean |
contains(byte e)
A Type-Specific implementation of contains.
|
byte |
firstByte()
A method to get the first element in the set
|
void |
forEach(ByteConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
ByteSortedSet |
headSet(byte toElement)
A Type Specific HeadSet method to reduce boxing/unboxing
|
ByteBidirectionalIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
ByteBidirectionalIterator |
iterator(byte fromElement)
A type Specific Iterator starting from a given key
|
byte |
lastByte()
A method to get the last element in the set
|
boolean |
moveToFirst(byte o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(byte o)
A specific move method to move a given key to the last index.
|
byte |
pollFirstByte()
A method to get and remove the first element in the set
|
byte |
pollLastByte()
A method to get and remove the last element in the set
|
boolean |
remIf(java.util.function.IntPredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remove(byte o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
removeAll(ByteCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(ByteCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
int |
size() |
ByteSortedSet |
subSet(byte fromElement,
byte toElement)
A Type Specific SubSet method to reduce boxing/unboxing
|
ByteSortedSet |
tailSet(byte fromElement)
A Type Specific TailSet method to reduce boxing/unboxing
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
byte[] |
toByteArray(byte[] a)
A Type-Specific implementation of toArray.
|
equals, hashCodeadd, addAll, addAll, contains, containsAll, containsAny, containsAny, remByte, remove, toByteArrayfirst, headSet, last, spliterator, subSet, tailSetadd, contains, remByte, removeaddAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, primitiveStream, removeIf, toByteArrayforEachpublic ByteArraySet()
public ByteArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic ByteArraySet(byte[] array)
array - the array that should be used for set.public ByteArraySet(byte[] array,
int length)
array - the array that should be used for set.length - the amount of elements present within the arrayjava.lang.NegativeArraySizeException - if the length is negative@Deprecated public ByteArraySet(java.util.Collection<? extends java.lang.Byte> c)
c - the elements that should be added to the set.public ByteArraySet(ByteCollection c)
c - the elements that should be added to the set.@Deprecated public ByteArraySet(java.util.Set<? extends java.lang.Byte> s)
s - the set the element should be taken frompublic ByteArraySet(ByteSet s)
s - the set the element should be taken frompublic boolean add(byte o)
ByteCollectionadd in interface ByteCollectiono - the element that should be addedpublic boolean addAndMoveToFirst(byte o)
ByteSortedSetaddAndMoveToFirst in interface ByteSortedSeto - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(byte o)
ByteSortedSetaddAndMoveToLast in interface ByteSortedSeto - the element that should be insertedSet.add(Object)public boolean moveToFirst(byte o)
ByteSortedSetmoveToFirst in interface ByteSortedSeto - that should be moved to the first indexpublic boolean moveToLast(byte o)
ByteSortedSetmoveToLast in interface ByteSortedSeto - that should be moved to the first lastpublic boolean contains(byte e)
AbstractByteCollectioncontains in interface ByteCollectioncontains in class AbstractByteCollectione - the element that should be searched for.public byte firstByte()
ByteSortedSetfirstByte in interface ByteSortedSetpublic byte lastByte()
ByteSortedSetlastByte in interface ByteSortedSetpublic boolean removeAll(ByteCollection c)
AbstractByteCollectionremoveAll in interface ByteCollectionremoveAll in class AbstractByteCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(ByteCollection c)
AbstractByteCollectionretainAll in interface ByteCollectionretainAll in class AbstractByteCollectionc - the elements that should be keptCollection.retainAll(Collection)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Byte>removeAll in interface java.util.Set<java.lang.Byte>removeAll in class java.util.AbstractCollection<java.lang.Byte>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Byte>retainAll in interface java.util.Set<java.lang.Byte>retainAll in class java.util.AbstractCollection<java.lang.Byte>public boolean remove(byte o)
ByteSetpublic byte pollFirstByte()
ByteSortedSetpollFirstByte in interface ByteSortedSetpublic byte pollLastByte()
ByteSortedSetpollLastByte in interface ByteSortedSetpublic boolean remIf(java.util.function.IntPredicate filter)
ByteCollectionRemoves elements that were selected by the filter
remIf in interface ByteCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public void forEach(ByteConsumer action)
ByteIterableforEach in interface ByteIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public ByteBidirectionalIterator iterator()
ByteCollectioniterator in interface java.lang.Iterable<java.lang.Byte>iterator in interface java.util.Collection<java.lang.Byte>iterator in interface java.util.Set<java.lang.Byte>iterator in interface ByteCollectioniterator in interface ByteIterableiterator in interface ByteSetiterator in interface ByteSortedSetiterator in class AbstractByteSetCollection.iterator()public ByteBidirectionalIterator iterator(byte fromElement)
ByteSortedSetiterator in interface ByteSortedSetfromElement - the element the iterator should start frompublic ByteSortedSet subSet(byte fromElement, byte toElement)
ByteSortedSetsubSet in interface ByteSortedSetfromElement - where the SubSet should starttoElement - where the SubSet should endpublic ByteSortedSet headSet(byte toElement)
ByteSortedSetheadSet in interface ByteSortedSettoElement - where the HeadSet should endpublic ByteSortedSet tailSet(byte fromElement)
ByteSortedSettailSet in interface ByteSortedSetfromElement - where the TailSet should startpublic ByteComparator comparator()
ByteSortedSetcomparator in interface java.util.SortedSet<java.lang.Byte>comparator in interface ByteSortedSetpublic void clear()
clear in interface java.util.Collection<java.lang.Byte>clear in interface java.util.Set<java.lang.Byte>clear in class java.util.AbstractCollection<java.lang.Byte>public int size()
size in interface java.util.Collection<java.lang.Byte>size in interface java.util.Set<java.lang.Byte>size in class java.util.AbstractCollection<java.lang.Byte>public byte[] toByteArray(byte[] a)
AbstractByteCollectiontoByteArray in interface ByteCollectiontoByteArray in class AbstractByteCollectiona - array that the elements should be injected to. If null or to small a new array with the right size is createdCollection.toArray(Object[])@Deprecated public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Byte>toArray in interface java.util.Set<java.lang.Byte>toArray in class java.util.AbstractCollection<java.lang.Byte>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Byte>toArray in interface java.util.Set<java.lang.Byte>toArray in class java.util.AbstractCollection<java.lang.Byte>