Package aQute.bnd.unmodifiable
Class ImmutableSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- aQute.bnd.unmodifiable.ImmutableSet<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>
final class ImmutableSet<E> extends java.util.AbstractSet<E> implements java.util.Set<E>, java.io.Serializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classImmutableSet.SerializationProxy
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Object[]elements(package private) static ImmutableSet<?>EMPTY(package private) short[]hash_bucketprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ImmutableSet(java.lang.Object... elements)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(java.util.Collection<? extends E> collection)voidclear()booleancontains(java.lang.Object o)booleanequals(java.lang.Object o)voidforEach(java.util.function.Consumer<? super E> action)private static short[]hash(java.lang.Object[] elements)inthashCode()java.util.Iterator<E>iterator()private intlinear_probe(java.lang.Object e)private static intlinear_probe(java.lang.Object[] elements, short[] hash_bucket, java.lang.Object e)private voidreadObject(java.io.ObjectInputStream ois)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> collection)booleanremoveIf(java.util.function.Predicate<? super E> filter)booleanretainAll(java.util.Collection<?> collection)intsize()java.util.Spliterator<E>spliterator()java.lang.Object[]toArray()<T> T[]toArray(T[] array)private java.lang.ObjectwriteReplace()
-
-
-
Field Detail
-
EMPTY
static final ImmutableSet<?> EMPTY
-
elements
final java.lang.Object[] elements
-
hash_bucket
final transient short[] hash_bucket
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
hash
private static short[] hash(java.lang.Object[] elements)
-
linear_probe
private static int linear_probe(java.lang.Object[] elements, short[] hash_bucket, java.lang.Object e)
-
linear_probe
private int linear_probe(java.lang.Object e)
-
iterator
public java.util.Iterator<E> iterator()
-
spliterator
public java.util.Spliterator<E> spliterator()
-
size
public int size()
-
contains
public boolean contains(java.lang.Object o)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] array)
-
forEach
public void forEach(java.util.function.Consumer<? super E> action)
- Specified by:
forEachin interfacejava.lang.Iterable<E>
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
addAll
public boolean addAll(java.util.Collection<? extends E> collection)
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
-
retainAll
public boolean retainAll(java.util.Collection<?> collection)
-
clear
public void clear()
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super E> filter)
- Specified by:
removeIfin interfacejava.util.Collection<E>
-
readObject
private void readObject(java.io.ObjectInputStream ois) throws java.io.InvalidObjectException- Throws:
java.io.InvalidObjectException
-
writeReplace
private java.lang.Object writeReplace()
-
-