bb.util
Class Unmodifiables.UnmodifiableList<E>

java.lang.Object
  extended by bb.util.Unmodifiables.UnmodifiableCollection<E>
      extended by bb.util.Unmodifiables.UnmodifiableList<E>
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>
Direct Known Subclasses:
Unmodifiables.UnmodifiableRandomAccessList
Enclosing class:
Unmodifiables

static class Unmodifiables.UnmodifiableList<E>
extends Unmodifiables.UnmodifiableCollection<E>
implements List<E>

See Also:
Serialized Form

Field Summary
(package private)  List<? extends E> list
           
(package private) static long serialVersionUID
           
 
Fields inherited from class bb.util.Unmodifiables.UnmodifiableCollection
c
 
Constructor Summary
Unmodifiables.UnmodifiableList(List<? extends E> list)
           
 
Method Summary
 void add(int index, E element)
           
 boolean addAll(int index, Collection<? extends E> c)
           
 boolean equals(Object o)
           
 E get(int index)
           
 int hashCode()
           
 int indexOf(Object o)
           
 int lastIndexOf(Object o)
           
 ListIterator<E> listIterator()
           
 ListIterator<E> listIterator(int index)
           
private  Object readResolve()
          UnmodifiableRandomAccessList instances are serialized as UnmodifiableList instances to allow them to be deserialized in pre-1.4 JREs (which do not have UnmodifiableRandomAccessList).
 E remove(int index)
           
 E set(int index, E element)
           
 List<E> subList(int fromIndex, int toIndex)
           
 
Methods inherited from class bb.util.Unmodifiables.UnmodifiableCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

list

final List<? extends E> list
Constructor Detail

Unmodifiables.UnmodifiableList

Unmodifiables.UnmodifiableList(List<? extends E> list)
Method Detail

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<E>
Specified by:
equals in interface List<E>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<E>
Specified by:
hashCode in interface List<E>
Overrides:
hashCode in class Object

get

public E get(int index)
Specified by:
get in interface List<E>

set

public E set(int index,
             E element)
Specified by:
set in interface List<E>

add

public void add(int index,
                E element)
Specified by:
add in interface List<E>

remove

public E remove(int index)
Specified by:
remove in interface List<E>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<E>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<E>

addAll

public boolean addAll(int index,
                      Collection<? extends E> c)
Specified by:
addAll in interface List<E>

listIterator

public ListIterator<E> listIterator()
Specified by:
listIterator in interface List<E>

listIterator

public ListIterator<E> listIterator(int index)
Specified by:
listIterator in interface List<E>

subList

public List<E> subList(int fromIndex,
                       int toIndex)
Specified by:
subList in interface List<E>

readResolve

private Object readResolve()
UnmodifiableRandomAccessList instances are serialized as UnmodifiableList instances to allow them to be deserialized in pre-1.4 JREs (which do not have UnmodifiableRandomAccessList). This method inverts the transformation. As a beneficial side-effect, it also grafts the RandomAccess marker onto UnmodifiableList instances that were serialized in pre-1.4 JREs. Note: Unfortunately, UnmodifiableRandomAccessList instances serialized in 1.4.1 and deserialized in 1.4 will become UnmodifiableList instances, as this method was missing in 1.4.