|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.util
Class Collections.EmptySet

java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
java.util.Collections.EmptySet
- All Implemented Interfaces:
- Collection, java.lang.Iterable, java.io.Serializable, Set
- Enclosing class:
- Collections
- private static final class Collections.EmptySet
- extends AbstractSet
- implements java.io.Serializable
- extends AbstractSet
The implementation of Collections.EMPTY_SET 55 . This class name is required
for compatibility with Sun's JDK serializability.
| Field Summary | |
private static long |
serialVersionUID
Compatible with JDK 1.4. |
| Constructor Summary | |
(package private) |
Collections.EmptySet()
A private constructor adds overhead. |
| Method Summary | |
boolean |
contains(java.lang.Object o)
The empty set never contains anything. |
boolean |
containsAll(Collection c)
This is true only if the given collection is also empty. |
boolean |
equals(java.lang.Object o)
Equal only if the other set is empty. |
int |
hashCode()
The hashcode is always 0. |
Iterator |
iterator()
Returns an iterator that does not iterate. |
boolean |
remove(java.lang.Object o)
Always succeeds with a false result. |
boolean |
removeAll(Collection c)
Always succeeds with a false result. |
boolean |
retainAll(Collection c)
Always succeeds with a false result. |
int |
size()
The size: always 0! |
java.lang.Object[] |
toArray()
The array is always empty. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
We don't even need to use reflection! |
java.lang.String |
toString()
The string never changes. |
| Methods inherited from class java.util.AbstractCollection |
add, addAll, clear, equals, hashCode, isEmpty, removeAllInternal, retainAllInternal |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
add, addAll, clear, isEmpty |
| Field Detail |
serialVersionUID
private static final long serialVersionUID
- Compatible with JDK 1.4.
- See Also:
- Constant Field Values
| Constructor Detail |
Collections.EmptySet
Collections.EmptySet()
- A private constructor adds overhead.
| Method Detail |
size
public int size()
- The size: always 0!
- Specified by:
sizein interfaceSet- Specified by:
sizein classAbstractCollection
iterator
public Iterator iterator()
- Returns an iterator that does not iterate.
- Specified by:
iteratorin interfaceSet- Specified by:
iteratorin classAbstractCollection
contains
public boolean contains(java.lang.Object o)
- The empty set never contains anything.
- Specified by:
containsin interfaceSet- Overrides:
containsin classAbstractCollection
containsAll
public boolean containsAll(Collection c)
- This is true only if the given collection is also empty.
- Specified by:
containsAllin interfaceSet- Overrides:
containsAllin classAbstractCollection
equals
public boolean equals(java.lang.Object o)
- Equal only if the other set is empty.
- Specified by:
equalsin interfaceSet- Overrides:
equalsin classAbstractSet
hashCode
public int hashCode()
- The hashcode is always 0.
- Specified by:
hashCodein interfaceSet- Overrides:
hashCodein classAbstractSet
remove
public boolean remove(java.lang.Object o)
- Always succeeds with a
falseresult.- Specified by:
removein interfaceSet- Overrides:
removein classAbstractCollection
removeAll
public boolean removeAll(Collection c)
- Always succeeds with a
falseresult.- Specified by:
removeAllin interfaceSet- Overrides:
removeAllin classAbstractSet
retainAll
public boolean retainAll(Collection c)
- Always succeeds with a
falseresult.- Specified by:
retainAllin interfaceSet- Overrides:
retainAllin classAbstractCollection
toArray
public java.lang.Object[] toArray()
- The array is always empty.
- Specified by:
toArrayin interfaceSet- Overrides:
toArrayin classAbstractCollection
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
- We don't even need to use reflection!
- Specified by:
toArrayin interfaceSet- Overrides:
toArrayin classAbstractCollection
toString
public java.lang.String toString()
- The string never changes.
- Overrides:
toStringin classAbstractCollection
|
|||||||||
| Home >> All >> java >> [ util overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC