cz.cuni.amis.pogamut.usar2004.agent.module.master
Class ModuleInstanceProvider

Package class diagram package ModuleInstanceProvider
java.lang.Object
  extended by cz.cuni.amis.pogamut.usar2004.agent.module.master.ModuleInstanceProvider

public abstract class ModuleInstanceProvider
extends Object

Abstract class that uses static methods to offer instances of objects specified by input variables.

Author:
vejmanm

Constructor Summary
ModuleInstanceProvider()
           
 
Method Summary
static SuperConfiguration getConfigInstanceByType(String type)
          Asks ConfigType enum if it knows ConfigType represented by string type.
static SuperGeometry getGeometryInstanceByType(String type)
          Asks GeometryType enum if it knows GeometryType represented by string type.
static SuperResponse getResponseInstanceByType(String type)
          Asks ResponseType enum if it knows ResponseType represented by string type.
static SuperSensor getSensorInstanceByClass(Class clazz)
          Class should be valid Sensor representative - SuperSensor offspring.
static SuperSensor getSensorInstanceByType(String type)
          Asks SensorType enum if it knows SensorType represented by string type.
static SuperState getStateInstanceByType(String type)
          Asks VehicleType (enum) if it knows VehicleType represented by string type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleInstanceProvider

public ModuleInstanceProvider()
Method Detail

getSensorInstanceByClass

public static SuperSensor getSensorInstanceByClass(Class clazz)
Class should be valid Sensor representative - SuperSensor offspring. Such class gets particular ctor and creates new instance which is returned.

Parameters:
clazz - Class representing possible valid Sensor
Returns:
Returns Class instance relevant to input Class

getSensorInstanceByType

public static SuperSensor getSensorInstanceByType(String type)
Asks SensorType enum if it knows SensorType represented by string type. If it does, it also contains Class reference. This reference is then instantiated and returned. If it does not, it returns instance of base class SuperSensor which is represented by SensorType.UNKNOWN_SENSOR.

Parameters:
type - String representing possible valid SensorType.
Returns:
Returns Class instance relevant to input String.

getGeometryInstanceByType

public static SuperGeometry getGeometryInstanceByType(String type)
Asks GeometryType enum if it knows GeometryType represented by string type. If it does, it also contains Class reference. This reference is then instantiated and returned. If it does not, it returns instance of base class SuperGeometry which is represented by GeometryType.SENSOR_EFFECTER.

Parameters:
type - String representing possible valid GeometryType.
Returns:
Returns Class instance relevant to input String.

getConfigInstanceByType

public static SuperConfiguration getConfigInstanceByType(String type)
Asks ConfigType enum if it knows ConfigType represented by string type. If it does, it also contains Class reference. This reference is then instantiated and returned. If it does not, it returns instance of base class SuperConfiguration which is represented by ConfigType.SENSOR.

Parameters:
type - String representing possible valid ConfigType.
Returns:
Returns Class instance relevant to input String.

getResponseInstanceByType

public static SuperResponse getResponseInstanceByType(String type)
Asks ResponseType enum if it knows ResponseType represented by string type. If it does, it also contains Class reference. This reference is then instantiated and returned. If it does not, it returns instance of ResponseSensorEffecter which is represented by ResponseType.SENSOR_EFFECTER.

Parameters:
type - String representing possible valid ResponseType.
Returns:
Returns Class instance relevant to input String.

getStateInstanceByType

public static SuperState getStateInstanceByType(String type)
Asks VehicleType (enum) if it knows VehicleType represented by string type. If it does, it also contains Class reference. This reference is then instantiated and returned. If it does not, it returns instance of SuperState which is represented by VehicleType.UNKNOW.

Parameters:
type - String representing possible valid VehicleType.
Returns:
Returns Class instance relevant to input String.


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