Back to Acra

ImmutableSet

web/static/javadoc/5.5.0/org/acra/collections/ImmutableSet.html

latest9.0 KB
Original Source

Skip navigation links

org.acra.collections

Class ImmutableSet<E>


public final classImmutableSet\<E\>extends[Object](http://d.android.com/reference/java/lang/Object.html?is-external=true "class or interface in java.lang")implements[Set](http://d.android.com/reference/java/util/Set.html?is-external=true "class or interface in java.util")<E>,[Serializable](http://d.android.com/reference/java/io/Serializable.html?is-external=true "class or interface in java.io")

Naive (not optimized) implementation of an Immutable Set with reliable, user-specified iteration order. Since:4.9.0See Also:Serialized Form

Nested Class Summary

Nested Classes | Modifier and Type | Class and Description | | --- | --- | | static class | ImmutableSet.Builder<E> |

Constructor Summary

Constructors | Constructor and Description | | --- | | ImmutableSet(Collection<E> collection) | | ImmutableSet(E... elements) |

Method Summary

All Methods Static Methods Instance Methods Concrete Methods | Modifier and Type | Method and Description | | --- | --- | | boolean | add(E object) | | boolean | addAll(Collection<? extends E> collection) | | void | clear() | | boolean | contains(Object object) | | boolean | containsAll(Collection<?> collection) | | static <T> ImmutableSet<T> | empty() | | boolean | isEmpty() | | Iterator<E> | iterator() | | boolean | remove(Object object) | | boolean | removeAll(Collection<?> collection) | | boolean | retainAll(Collection<?> collection) | | int | size() | | Object[] | toArray() | | <T> T[] | toArray(T[] array) |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

- 

Methods inherited from interface java.util.Set

equals, hashCode, spliterator

- 

Methods inherited from interface java.util.Collection

parallelStream, removeIf, stream

- 

Methods inherited from interface java.lang.Iterable

forEach

Constructor Detail

- 

ImmutableSet

[@SafeVarargs](http://d.android.com/reference/java/lang/SafeVarargs.html?is-external=true "class or interface in java.lang")public ImmutableSet([E](../../../org/acra/collections/ImmutableSet.html "type parameter in ImmutableSet")... elements)
- 

ImmutableSet

public ImmutableSet(@NonNull[Collection](http://d.android.com/reference/java/util/Collection.html?is-external=true "class or interface in java.util")<[E](../../../org/acra/collections/ImmutableSet.html "type parameter in ImmutableSet")> collection)

Method Detail

- 

empty

@NonNull
public static <T>[ImmutableSet](../../../org/acra/collections/ImmutableSet.html "class in org.acra.collections")<T> empty()
- 

add

public boolean add([E](../../../org/acra/collections/ImmutableSet.html "type parameter in ImmutableSet")object)

Specified by:add in interface Collection<E>Specified by:add in interface Set<E>

- 

addAll

public boolean addAll(@NonNull[Collection](http://d.android.com/reference/java/util/Collection.html?is-external=true "class or interface in java.util")<? extends[E](../../../org/acra/collections/ImmutableSet.html "type parameter in ImmutableSet")> collection)

Specified by:addAll in interface Collection<E>Specified by:addAll in interface Set<E>

- 

clear

public void clear()

Specified by:clear in interface Collection<E>Specified by:clear in interface Set<E>

- 

contains

public boolean contains([Object](http://d.android.com/reference/java/lang/Object.html?is-external=true "class or interface in java.lang")object)

Specified by:contains in interface Collection<E>Specified by:contains in interface Set<E>

- 

containsAll

public boolean containsAll(@NonNull[Collection](http://d.android.com/reference/java/util/Collection.html?is-external=true "class or interface in java.util")<?> collection)

Specified by:containsAll in interface Collection<E>Specified by:containsAll in interface Set<E>

- 

isEmpty

public boolean isEmpty()

Specified by:isEmpty in interface Collection<E>Specified by:isEmpty in interface Set<E>

- 

iterator

@NonNull
public[Iterator](http://d.android.com/reference/java/util/Iterator.html?is-external=true "class or interface in java.util")<[E](../../../org/acra/collections/ImmutableSet.html "type parameter in ImmutableSet")> iterator()

Specified by:iterator in interface Iterable<E>Specified by:iterator in interface Collection<E>Specified by:iterator in interface Set<E>

- 

remove

public boolean remove([Object](http://d.android.com/reference/java/lang/Object.html?is-external=true "class or interface in java.lang")object)

Specified by:remove in interface Collection<E>Specified by:remove in interface Set<E>

- 

removeAll

public boolean removeAll(@NonNull[Collection](http://d.android.com/reference/java/util/Collection.html?is-external=true "class or interface in java.util")<?> collection)

Specified by:removeAll in interface Collection<E>Specified by:removeAll in interface Set<E>

- 

retainAll

public boolean retainAll(@NonNull[Collection](http://d.android.com/reference/java/util/Collection.html?is-external=true "class or interface in java.util")<?> collection)

Specified by:retainAll in interface Collection<E>Specified by:retainAll in interface Set<E>

- 

size

public int size()

Specified by:size in interface Collection<E>Specified by:size in interface Set<E>

- 

toArray

@NonNull
public[Object](http://d.android.com/reference/java/lang/Object.html?is-external=true "class or interface in java.lang")[] toArray()

Specified by:toArray in interface Collection<E>Specified by:toArray in interface Set<E>

- 

toArray

@NonNull
public <T> T[] toArray(@NonNull
                                T[] array)

Specified by:toArray in interface Collection<E>Specified by:toArray in interface Set<E>

Skip navigation links