java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
freemarker.template.utility.Collections12.SingletonList
- All Implemented Interfaces:
- java.util.Collection, java.lang.Iterable, java.util.List, java.io.Serializable
- Enclosing class:
- Collections12
- private static class Collections12.SingletonList
- extends java.util.AbstractList
- implements java.io.Serializable
Method Summary |
boolean |
contains(java.lang.Object obj)
Test whether this list contains a given object as one of its elements. |
java.lang.Object |
get(int index)
Returns the elements at the specified position in the list. |
int |
size()
Get 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 |
element
private final java.lang.Object element
Collections12.SingletonList
Collections12.SingletonList(java.lang.Object obj)
size
public int size()
- Description copied from interface:
java.util.List
- Get the number of elements in this list. If the list contains more
than Integer.MAX_VALUE elements, return Integer.MAX_VALUE.
- Specified by:
size
in interface java.util.List
contains
public boolean contains(java.lang.Object obj)
- Description copied from interface:
java.util.List
- Test whether this list contains a given object as one of its elements.
This is defined as the existence of an element e such that
o == null ? e == null : o.equals(e)
.
- Specified by:
contains
in interface java.util.List
get
public java.lang.Object get(int index)
- Description copied from class:
java.util.AbstractList
- Returns the elements at the specified position in the list.
- Specified by:
get
in interface java.util.List