E
- any Object typepublic class NonStoringCollection<E> extends Object implements Collection<E>
Constructor and Description |
---|
NonStoringCollection() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object e)
Always returns
false . |
boolean |
addAll(Collection c)
Always returns
false . |
void |
clear() |
boolean |
contains(Object o)
Since no objects are stored in this collection this method will always return
false . |
boolean |
containsAll(Collection c)
Since no objects are stored in this collection this method will always return
false . |
boolean |
isEmpty()
Since no objects are stored in this collection this method will always return
true . |
Iterator |
iterator()
Since no objects are stored in this collection this method will always return an empty iterator.
|
boolean |
remove(Object o)
Since no objects are stored in this collection, no objects can be removed.
|
boolean |
removeAll(Collection c)
Since no objects are stored in this collection, no objects can be removed.
|
boolean |
retainAll(Collection c)
Since no objects are stored in this collection, no objects can be removed.
|
int |
size()
Since no objects are stored in this collection its size will always be 0.
|
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public NonStoringCollection()
public boolean add(Object e)
false
. The object will not be stored.add
in interface Collection<E>
false
public boolean addAll(Collection c)
false
. The object in the collection will not be stored.addAll
in interface Collection<E>
false
public void clear()
clear
in interface Collection<E>
public boolean contains(Object o)
false
.contains
in interface Collection<E>
false
public boolean containsAll(Collection c)
false
.containsAll
in interface Collection<E>
false
public boolean isEmpty()
true
.isEmpty
in interface Collection<E>
true
public Iterator iterator()
public boolean remove(Object o)
false
.remove
in interface Collection<E>
false
public boolean removeAll(Collection c)
false
.removeAll
in interface Collection<E>
false
public boolean retainAll(Collection c)
false
.retainAll
in interface Collection<E>
false
public int size()
size
in interface Collection<E>
public Object[] toArray()
toArray
in interface Collection<E>