|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.DummySet<E>
E
- public final class DummySet<E>
The DummySet can be used to remove the space consuming behavior
and retain the checking behavior of a set.
It will accept all elements of Type E but will never store anything.
Every return value is fixed to a default value:
Constructor Summary | |
---|---|
DummySet()
Creates a new DummySet instance. |
Method Summary | ||
---|---|---|
boolean |
add(E e)
This Method does not store anything but will return true for each e. |
|
boolean |
addAll(java.util.Collection<? extends E> c)
This Method does not store anything but will return true for each Collection c. |
|
void |
clear()
This Method does nothing. |
|
boolean |
contains(java.lang.Object o)
This Method does not check anything but will return false for each Object o. |
|
boolean |
containsAll(java.util.Collection<?> c)
This Method does not check anything but will return true for each Collection c. |
|
boolean |
isEmpty()
This Method will always return false because the set is always empty. |
|
java.util.Iterator<E> |
iterator()
This Method will always return an empty iterator because the set is always empty. |
|
boolean |
remove(java.lang.Object o)
This Method does not remove anything but will return true for each Object o. |
|
boolean |
removeAll(java.util.Collection<?> c)
This Method does not remove anything but will return true for each Object o. |
|
boolean |
retainAll(java.util.Collection<?> c)
This Method does not retain anything but will return true for each Collection c. |
|
int |
size()
This Method will always return 0 because the set is always empty. |
|
java.lang.Object[] |
toArray()
This Method will always return an empty array. |
|
|
toArray(T[] a)
This Method will always return null. |
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 |
Constructor Detail |
---|
public DummySet()
Method Detail |
---|
public final boolean add(E e)
add
in interface java.util.Collection<E>
add
in interface java.util.Set<E>
Set.add(java.lang.Object)
public final boolean addAll(java.util.Collection<? extends E> c)
addAll
in interface java.util.Collection<E>
addAll
in interface java.util.Set<E>
Set.addAll(java.util.Collection)
public final void clear()
clear
in interface java.util.Collection<E>
clear
in interface java.util.Set<E>
Set.clear()
public final boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
contains
in interface java.util.Set<E>
Set.contains(java.lang.Object)
public final boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<E>
containsAll
in interface java.util.Set<E>
Set.containsAll(java.util.Collection)
public final boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
isEmpty
in interface java.util.Set<E>
Set.isEmpty()
public final java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.Set<E>
Set.iterator()
public final boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
remove
in interface java.util.Set<E>
Set.remove(java.lang.Object)
public final boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<E>
removeAll
in interface java.util.Set<E>
Set.removeAll(java.util.Collection)
public final boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<E>
retainAll
in interface java.util.Set<E>
Set.retainAll(java.util.Collection)
public final int size()
size
in interface java.util.Collection<E>
size
in interface java.util.Set<E>
Set.size()
public final java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.Set<E>
Set.toArray()
public final <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.Set<E>
Set.toArray(java.lang.Object[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |