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 class
ImmutableSet.SerializationProxy
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Object[]
elements
(package private) static ImmutableSet<?>
EMPTY
(package private) short[]
hash_bucket
private static long
serialVersionUID
-
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 boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> collection)
void
clear()
boolean
contains(java.lang.Object o)
boolean
equals(java.lang.Object o)
void
forEach(java.util.function.Consumer<? super E> action)
private static short[]
hash(java.lang.Object[] elements)
int
hashCode()
java.util.Iterator<E>
iterator()
private int
linear_probe(java.lang.Object e)
private static int
linear_probe(java.lang.Object[] elements, short[] hash_bucket, java.lang.Object e)
private void
readObject(java.io.ObjectInputStream ois)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> collection)
boolean
removeIf(java.util.function.Predicate<? super E> filter)
boolean
retainAll(java.util.Collection<?> collection)
int
size()
java.util.Spliterator<E>
spliterator()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] array)
private java.lang.Object
writeReplace()
-
-
-
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:
forEach
in 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:
removeIf
in 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()
-
-