Package Functions | |
ComponentMap (Logger logger) | |
synchronized boolean | reserveComponent (int compHandle) |
synchronized ComponentAdapter | put (int compHandle, ComponentAdapter compAdapter) |
synchronized void | sort (int[] sortedHandles) |
synchronized ComponentAdapter | remove (int compHandle) |
synchronized ComponentAdapter | get (int compHandle) |
synchronized ComponentAdapter[] | getComponentAdapters (int[] compHandles) |
ComponentAdapter | getComponentByNameAndType (String name, String type) |
synchronized ComponentAdapter[] | getAllComponentAdapters () |
synchronized int[] | getAllHandles () |
Private Attributes | |
LinkedHashMap< Integer, ComponentAdapter > | m_map |
Logger | logger |
ComponentAdapter
s. The map entries are sorted by insertion order, or by the handle sequence given to sort(int[]).
Note that it is not sufficient to use something like Collections.synchronizedMap(new HashMap())
, since reading out the keys or values of such a map with an iterator is still backed by the original instance and therefore not thread-safe. See Collections#synchronizedMap(java.util.Map).
|
|
|
Returns the component adapter for a given component handle, or
|
|
Gets all component adapters stored in the map. Unlike Map#values(), the returned array contains a snapshot of the map contents, rather than a live view backed by the map.
Notice that
|
|
Gets all component handles, which are the keys of the map. Unlike Map#keySet(), the returned array contains a snapshot of the map contents, rather than a view backed by the map. TODO: check if it's ok to to include handles for reserved component adapters (value still null)
|
|
Gets component adapters with the specified handles out of the map. Ignores handles for which no components are stored. The order of the returned component adapters matches the order of the handles. Unlike Map#values(), the returned array contains a snapshot of the map contents, rather than a view backed by the map.
|
|
Tries to find a component with the given name and type, regardless of the handle which is the "primary key".
|
|
|
|
Removes a component adapter from the map.
|
|
Makes a reservation for a
|
|
Sorts the entries in the order given by
|
|
|
|
The map that backs this class. |