|
|||||||||
| 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.EmptyList

java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.Collections.EmptyList
- All Implemented Interfaces:
- Collection, java.lang.Iterable, List, RandomAccess, java.io.Serializable
- Enclosing class:
- Collections
- private static final class Collections.EmptyList
- extends AbstractList
- implements java.io.Serializable, RandomAccess
- extends AbstractList
The implementation of Collections.EMPTY_LIST 55 . This class name is required
for compatibility with Sun's JDK serializability.
| Nested Class Summary |
| Nested classes inherited from class java.util.AbstractList |
|
| Field Summary | |
private static long |
serialVersionUID
Compatible with JDK 1.4. |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
(package private) |
Collections.EmptyList()
A private constructor adds overhead. |
| Method Summary | |
boolean |
contains(java.lang.Object o)
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 list is empty. |
java.lang.Object |
get(int index)
No matter the index, it is out of bounds. |
int |
hashCode()
The hashcode is always 1. |
int |
indexOf(java.lang.Object o)
Returns -1. |
int |
lastIndexOf(java.lang.Object o)
Returns -1. |
boolean |
remove(java.lang.Object o)
Always succeeds with false result. |
boolean |
removeAll(Collection c)
Always succeeds with false result. |
boolean |
retainAll(Collection c)
Always succeeds with false result. |
int |
size()
The size is 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.AbstractList |
add, add, addAll, clear, iterator, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
addAll, 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.List |
addAll, isEmpty |
| Field Detail |
serialVersionUID
private static final long serialVersionUID
- Compatible with JDK 1.4.
- See Also:
- Constant Field Values
| Constructor Detail |
Collections.EmptyList
Collections.EmptyList()
- A private constructor adds overhead.
| Method Detail |
size
public int size()
- The size is always 0.
- Specified by:
sizein interfaceList- Specified by:
sizein classAbstractCollection
get
public java.lang.Object get(int index)
- No matter the index, it is out of bounds. This
method never returns, throwing an exception instead.
- Specified by:
getin interfaceList- Specified by:
getin classAbstractList
contains
public boolean contains(java.lang.Object o)
- Never contains anything.
- Specified by:
containsin interfaceList- Overrides:
containsin classAbstractCollection
containsAll
public boolean containsAll(Collection c)
- This is true only if the given collection is also empty.
- Specified by:
containsAllin interfaceList- Overrides:
containsAllin classAbstractCollection
equals
public boolean equals(java.lang.Object o)
- Equal only if the other list is empty.
- Specified by:
equalsin interfaceList- Overrides:
equalsin classAbstractList
hashCode
public int hashCode()
- The hashcode is always 1.
- Specified by:
hashCodein interfaceList- Overrides:
hashCodein classAbstractList
indexOf
public int indexOf(java.lang.Object o)
- Returns -1.
- Specified by:
indexOfin interfaceList- Overrides:
indexOfin classAbstractList
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Returns -1.
- Specified by:
lastIndexOfin interfaceList- Overrides:
lastIndexOfin classAbstractList
remove
public boolean remove(java.lang.Object o)
- Always succeeds with
falseresult.- Specified by:
removein interfaceList- Overrides:
removein classAbstractCollection
removeAll
public boolean removeAll(Collection c)
- Always succeeds with
falseresult.- Specified by:
removeAllin interfaceList- Overrides:
removeAllin classAbstractCollection
retainAll
public boolean retainAll(Collection c)
- Always succeeds with
falseresult.- Specified by:
retainAllin interfaceList- Overrides:
retainAllin classAbstractCollection
toArray
public java.lang.Object[] toArray()
- The array is always empty.
- Specified by:
toArrayin interfaceList- Overrides:
toArrayin classAbstractCollection
toArray
public java.lang.Object[] toArray(java.lang.Object[] a)
- We don't even need to use reflection!
- Specified by:
toArrayin interfaceList- 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