jTransfo, 0.14

org.jtransfo.internal
Class LockableList<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<T>
              extended by org.jtransfo.internal.LockableList<T>
Type Parameters:
T - list entry type
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess

public class LockableList<T>
extends ArrayList<T>

A list which can be locked to prevent further modifications.

See Also:
Serialized Form

Constructor Summary
LockableList()
           
 
Method Summary
 void add(int i, T t)
           
 boolean add(T t)
           
 boolean addAll(Collection<? extends T> ts)
           
 boolean addAll(int i, Collection<? extends T> ts)
           
 void clear()
           
 void lock()
          Set read-only status for list.
 T remove(int i)
           
 boolean remove(Object o)
           
 T set(int i, T t)
           
 
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

LockableList

public LockableList()
Method Detail

lock

public void lock()
Set read-only status for list. Once this is called, modifications to the list are no longer allowed.


set

public T set(int i,
             T t)
Specified by:
set in interface List<T>
Overrides:
set in class ArrayList<T>

add

public boolean add(T t)
Specified by:
add in interface Collection<T>
Specified by:
add in interface List<T>
Overrides:
add in class ArrayList<T>

add

public void add(int i,
                T t)
Specified by:
add in interface List<T>
Overrides:
add in class ArrayList<T>

remove

public T remove(int i)
Specified by:
remove in interface List<T>
Overrides:
remove in class ArrayList<T>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<T>
Specified by:
remove in interface List<T>
Overrides:
remove in class ArrayList<T>

clear

public void clear()
Specified by:
clear in interface Collection<T>
Specified by:
clear in interface List<T>
Overrides:
clear in class ArrayList<T>

addAll

public boolean addAll(Collection<? extends T> ts)
Specified by:
addAll in interface Collection<T>
Specified by:
addAll in interface List<T>
Overrides:
addAll in class ArrayList<T>

addAll

public boolean addAll(int i,
                      Collection<? extends T> ts)
Specified by:
addAll in interface List<T>
Overrides:
addAll in class ArrayList<T>

jTransfo, 0.14

Copyright © 2014. All rights reserved.