public class ExtendedSet<E>
extends java.lang.Object
implements java.util.Set<E>
Constructor and Description |
---|
ExtendedSet(java.util.Map<E,E> map)
Constructs a new instance by backing it with the supplied Map.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
boolean |
addAll(java.util.Collection<? extends E> c) |
void |
clear() |
boolean |
conditionalRemove(E entry,
java.util.function.Predicate<E> entryTest)
Removes the entry if the supplied predicate evaluates to true.
|
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
E |
get(java.lang.Object o)
Returns set element that is equal to the specified object.
|
boolean |
insertOrReplace(E entry,
java.util.function.Predicate<E> entryTest)
Inserts the entry if it is not already in the set otherwise replaces the existing entry
if the supplied predicate evaluates to true.
|
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public E get(java.lang.Object o)
o
- objectpublic boolean insertOrReplace(E entry, java.util.function.Predicate<E> entryTest)
entry
- entry to addentryTest
- predicate that is used to evaluate if the existing entry should be replacedpublic boolean conditionalRemove(E entry, java.util.function.Predicate<E> entryTest)
entry
- entry to removeentryTest
- predicate that is used to evaluated aginst the existing entry. Return value of
true implies value should be removed.public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public java.util.Iterator<E> iterator()
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean add(E e)
public boolean remove(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean addAll(java.util.Collection<? extends E> c)
public boolean retainAll(java.util.Collection<?> c)
public boolean removeAll(java.util.Collection<?> c)