Interface Set<E>
-
- All Superinterfaces:
Iterable<E>,java.lang.Iterable<E>,Traversable<E>
- All Known Subinterfaces:
SortedSet<E>
- All Known Implementing Classes:
AbstractSet,AbstractSortedSet,HashSet,TreeSet
public interface Set<E> extends Iterable<E>
Set defines the interface for a unique set of values as defined byObject.equals(Object).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull Set<E>add(E value)Returns a set that adds the specified value if it doesn't already exist in this set.java.util.Set<E>asSet()Returns an immutable view of this set as an instance ofjava.util.Set.booleancontains(E value)Returns true if the value exists in this set.@NotNull Set<E>remove(E value)Removes the specified value from the set if it exists.-
Methods inherited from interface com.github.andrewoma.dexx.collection.Traversable
forEach, isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet
-
-
-
-
Method Detail
-
add
@NotNull @NotNull Set<E> add(E value)
Returns a set that adds the specified value if it doesn't already exist in this set.
-
remove
@NotNull @NotNull Set<E> remove(E value)
Removes the specified value from the set if it exists.
-
contains
boolean contains(E value)
Returns true if the value exists in this set.
-
asSet
@NotNull java.util.Set<E> asSet()
Returns an immutable view of this set as an instance ofjava.util.Set.
-
-