Methods Summary |
---|
public void | add(int index, java.lang.Object element)
if (immutable)
throw new UnsupportedOperationException() ;
delegate.add(index, element) ;
|
public boolean | equals(java.lang.Object obj)
if (obj == null)
return false ;
if (!(obj instanceof FreezableList))
return false ;
FreezableList other = (FreezableList)obj ;
return delegate.equals( other.delegate ) &&
(immutable == other.immutable) ;
|
public java.lang.Object | get(int index)
return delegate.get(index) ;
|
public int | hashCode()
return delegate.hashCode() ;
|
public boolean | isImmutable()
return immutable ;
|
public void | makeElementsImmutable()
Iterator iter = iterator() ;
while (iter.hasNext()) {
Object obj = iter.next() ;
if (obj instanceof MakeImmutable) {
MakeImmutable element = (MakeImmutable)obj ;
element.makeImmutable() ;
}
}
|
public void | makeImmutable()
immutable = true ;
|
public java.lang.Object | remove(int index)
if (immutable)
throw new UnsupportedOperationException() ;
return delegate.remove(index) ;
|
public java.lang.Object | set(int index, java.lang.Object element)
if (immutable)
throw new UnsupportedOperationException() ;
return delegate.set(index, element) ;
|
public int | size()
return delegate.size() ;
|
public java.util.List | subList(int fromIndex, int toIndex)
List list = delegate.subList(fromIndex, toIndex) ;
List result = new FreezableList( list, immutable ) ;
return result ;
|