cz.cuni.amis.pogamut.usar2004.agent.module.datatypes
Class StateContainer

Package class diagram package StateContainer
java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,SuperState>
          extended by cz.cuni.amis.pogamut.usar2004.agent.module.datatypes.StateContainer
All Implemented Interfaces:
Serializable, Cloneable, Map<String,SuperState>

public class StateContainer
extends HashMap<String,SuperState>

Container of state particular state messages.

Author:
vejmanm
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
StateContainer()
           
 
Method Summary
 List<String> getAvailibleTypes()
          Returns list of availible state object names.
 List<SuperState> getStatesByClass(Class c)
          Iterates through local hahmap values and takes note of every SuperState object that is Instance of specified class.
 SuperState getStatesByType(String type)
          Gets state message representative from local hashmap.
 SuperState getStatesByVehicleType(VehicleType type)
          Iterates through local hashmap values and seeks match.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

StateContainer

public StateContainer()
Method Detail

getStatesByType

public SuperState getStatesByType(String type)
Gets state message representative from local hashmap. Returns null if none matches.

Parameters:
type - String representation of state type.
Returns:
Returns specific state message matching input string type

getStatesByVehicleType

public SuperState getStatesByVehicleType(VehicleType type)
Iterates through local hashmap values and seeks match. Note that every SuperState offspring has its own VehicleType property. Returns null if none matches.

Parameters:
type - VehicleType representation of state type - easier to use since we don't have to watch after propper spelling.
Returns:
Returns specific state message matching input VehicleType type

getStatesByClass

public List<SuperState> getStatesByClass(Class c)
Iterates through local hahmap values and takes note of every SuperState object that is Instance of specified class. Returns null if none matches or c is null.

Parameters:
c - c is class that the state message should extend, So when SuperState is inserted as c, it should return list of all types of vehicles that this holds data of.
Returns:
Returns list of state objects that implements class c

getAvailibleTypes

public List<String> getAvailibleTypes()
Returns list of availible state object names.

Returns:
Returns list of availible state object names.


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.