Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.project.runtime
Class MTJRuntimeList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<MTJRuntime>
              extended by org.eclipse.mtj.core.project.runtime.MTJRuntimeList
All Implemented Interfaces:
Serializable, Cloneable, Iterable<MTJRuntime>, Collection<MTJRuntime>, List<MTJRuntime>, RandomAccess

public class MTJRuntimeList
extends ArrayList<MTJRuntime>

This class is used to maintains configurations for Midlet project. Each Midlet project have one instance of this class. We retrieve the instance by IMidletSuiteProject#getConfigurations().

Since:
1.0
See Also:
MTJRuntime, Serialized Form
Restriction:
This class is not intended to be subclassed by clients.
Restriction:
This class is not intended to be instantiated by clients.

Field Summary
static String ELEM_CONFIGURATION
          The configuration element name the meta data xml file.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MTJRuntimeList()
          The constructor used for create Configuration for a Midlet project that have not yet configurations.
MTJRuntimeList(Element configsElement)
          Construct Configuration from meta data XML file.
 
Method Summary
 boolean add(MTJRuntime config)
           
 boolean addAll(Collection<? extends MTJRuntime> configs)
           
 void addMTJRuntimeListChangeListener(IMTJRuntimeListChangeListener listener)
           
 MTJRuntime getActiveMTJRuntime()
          Get the active configuration.
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> configs)
           
 void removeMTJRuntimeListChangeListener(IMTJRuntimeListChangeListener listener)
          Note:Since instance of Configuration have a long life cycle (as long as the Midlet project), so we should remove listener manually when it no longer used.
 void switchActiveMTJRuntime(MTJRuntime configuration)
          Switch the current active configuration.
 
Methods inherited from class java.util.ArrayList
add, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, 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, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, retainAll, subList
 

Field Detail

ELEM_CONFIGURATION

public static final String ELEM_CONFIGURATION
The configuration element name the meta data xml file.

See Also:
Constant Field Values
Constructor Detail

MTJRuntimeList

public MTJRuntimeList()
The constructor used for create Configuration for a Midlet project that have not yet configurations.


MTJRuntimeList

public MTJRuntimeList(Element configsElement)
               throws PersistenceException
Construct Configuration from meta data XML file.

Parameters:
configsElement - - The <configurations> xml element.
Throws:
PersistenceException
Method Detail

add

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

addAll

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

addMTJRuntimeListChangeListener

public void addMTJRuntimeListChangeListener(IMTJRuntimeListChangeListener listener)

getActiveMTJRuntime

public MTJRuntime getActiveMTJRuntime()
Get the active configuration. If no active one, will return null.

Returns:

remove

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

removeAll

public boolean removeAll(Collection<?> configs)
Specified by:
removeAll in interface Collection<MTJRuntime>
Specified by:
removeAll in interface List<MTJRuntime>
Overrides:
removeAll in class AbstractCollection<MTJRuntime>

removeMTJRuntimeListChangeListener

public void removeMTJRuntimeListChangeListener(IMTJRuntimeListChangeListener listener)
Note:Since instance of Configuration have a long life cycle (as long as the Midlet project), so we should remove listener manually when it no longer used.

Parameters:
listener -

switchActiveMTJRuntime

public void switchActiveMTJRuntime(MTJRuntime configuration)
Switch the current active configuration.

Parameters:
configuration - - configuration to be set as active one.

Mobile Tools for Java
Release 1.0