java.util
Class Collections.EmptyList
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.Collections.EmptyList
- All Implemented Interfaces:
- Collection, List, RandomAccess, Serializable
- Enclosing class:
- Collections
- private static class Collections.EmptyList
- extends AbstractList
- implements RandomAccess, Serializable
- See Also:
- Serialized Form
Method Summary |
boolean |
contains(Object obj)
Returns true if this list contains the specified element.
|
Object |
get(int index)
Returns the element at the specified position in this list. |
private Object |
readResolve()
|
int |
size()
Returns the number of elements in this list. |
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
Collections.EmptyList
private Collections.EmptyList()
size
public int size()
- Description copied from interface:
List
- Returns the number of elements in this list. If this list contains
more than Integer.MAX_VALUE elements, returns
Integer.MAX_VALUE.
- Specified by:
size
in interface List
- Specified by:
size
in class AbstractCollection
- Returns:
- the number of elements in this collection.
contains
public boolean contains(Object obj)
- Description copied from interface:
List
- Returns true if this list contains the specified element.
More formally, returns true if and only if this list contains
at least one element e such that
(o==null ? e==null : o.equals(e)).
- Specified by:
contains
in interface List
- Overrides:
contains
in class AbstractCollection
- Parameters:
obj
- object to be checked for containment in this collection.
- Returns:
- true if this collection contains the specified element.
get
public Object get(int index)
- Description copied from class:
AbstractList
- Returns the element at the specified position in this list.
- Specified by:
get
in interface List
- Specified by:
get
in class AbstractList
- Parameters:
index
- index of element to return.
- Returns:
- the element at the specified position in this list.
readResolve
private Object readResolve()