Class DynamicStateFilteredMap
- java.lang.Object
-
- fr.univ_artois.lgi2a.similar.microkernel.libs.tools.engine.DynamicStateFilteredMap
-
- All Implemented Interfaces:
IPublicDynamicStateMap
public final class DynamicStateFilteredMap extends Object implements IPublicDynamicStateMap
This class defines a sub set of a dynamic state map.Usage
This map is used to facilitate the creation of the map used as an argument of the perception and natural methods of the agents and the environment. It avoids the duplication of the map data.
- Author:
- Yoann Kubera
-
-
Constructor Summary
Constructors Constructor Description DynamicStateFilteredMap(IPublicDynamicStateMap parent, Set<LevelIdentifier> filter)
Builds a sub set of an existing map of dynamic states.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeParent(IPublicDynamicStateMap parent)
Changes the over map of this map.IPublicLocalDynamicState
get(LevelIdentifier level)
Gets the dynamic state of a level contained in this filtered map.Set<LevelIdentifier>
keySet()
Gets the levels which dynamic state is contained in this filtered map.void
put(IPublicLocalDynamicState state)
This operation is not supported in this class.
-
-
-
Constructor Detail
-
DynamicStateFilteredMap
public DynamicStateFilteredMap(IPublicDynamicStateMap parent, Set<LevelIdentifier> filter)
Builds a sub set of an existing map of dynamic states.- Parameters:
parent
- The over map of this map.filter
- The set of keys to include in this map.- Throws:
IllegalArgumentException
- If an argument isnull
or if the filter is not a subset of the keys of the parent.
-
-
Method Detail
-
changeParent
public void changeParent(IPublicDynamicStateMap parent)
Changes the over map of this map.- Parameters:
parent
- The over map of this map.- Throws:
IllegalArgumentException
- If an argument isnull
or if the filter is not a subset of the keys of the parent.
-
keySet
public Set<LevelIdentifier> keySet()
Gets the levels which dynamic state is contained in this filtered map.- Specified by:
keySet
in interfaceIPublicDynamicStateMap
- Returns:
- The identifier of the levels contained in this filtered map.
-
get
public IPublicLocalDynamicState get(LevelIdentifier level)
Gets the dynamic state of a level contained in this filtered map.- Specified by:
get
in interfaceIPublicDynamicStateMap
- Parameters:
level
- The level of the dynamic state.- Returns:
- The dynamic state of the level.
- Throws:
IllegalArgumentException
- If the argument isnull
.NoSuchElementException
- If thelevel
level is not in this filtered map.
-
put
public void put(IPublicLocalDynamicState state)
This operation is not supported in this class.- Specified by:
put
in interfaceIPublicDynamicStateMap
- Parameters:
state
- The public local dynamic state of to add to this map.
-
-