Class IndividualDevice
- java.lang.Object
-
- fi.tut.mei.capabilityQueryLib.model.Device
-
- fi.tut.mei.capabilityQueryLib.model.IndividualDevice
-
public class IndividualDevice extends Device
Class representing an individual device. An individual device is based on a blueprint from which it gets its capabilities and parameters.- Author:
- hylli
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fi.tut.mei.capabilityQueryLib.model.Device
Device.Type
-
-
Constructor Summary
Constructors Constructor Description IndividualDevice(String name)
Create a device with the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCapability(Capability capability)
Add capability to the device's blueprint.void
addParameterObject(String property, ParameterObjectValue value, Capability capability)
This has not yet been implemented for this subclass.void
addParameterValue(Parameter param, Object value, Capability capability)
This has not yet been implemented for this subclass.void
addResourceCapability(ResourceCapability capability)
Not yet implemented for this.ParameterObjectValue
getBasicInformation()
Get the basic information of this device which is the basic information of the blueprint of this device.Blueprint
getBlueprint()
Get the blueprint the individual device is based on.Set<Capability>
getCapabilities()
Get the capabilities this device hasCollection<String>
getCapabilityParameterObjectProperties(Capability capability)
Get property names that connect the given capability to its ParameterObjectValues.String
getDescription()
Get the description of the individual device.Set<ParameterObjectValue>
getParameterObjectValue(Capability capability, String property)
Get ParameterObjectValues related to a capability via the given property.Collection<ParameterValue>
getParameters()
Gets parameters from the device's blueprint.Set<ParameterValue>
getParameterValuesForCapability(Capability capability)
Gets parameter values from the blueprint.Collection<ResourceCapability>
getResourceCapabilities()
Get the resource capabilities of the device.ResourceCapability
getResourceCapability(Capability capability)
Get a ResourceCapability of this device for the given capability.void
setBlueprint(Blueprint blueprint)
Set the blueprint the device is based on.-
Methods inherited from class fi.tut.mei.capabilityQueryLib.model.Device
getDescriptionAsPlainText, getDevices, getName, getRdID, getRdURL, getType, setDescription, setRdID, setRdURL, toString
-
-
-
-
Constructor Detail
-
IndividualDevice
public IndividualDevice(String name)
Create a device with the given name.- Parameters:
name
- device name
-
-
Method Detail
-
getBlueprint
public Blueprint getBlueprint()
Get the blueprint the individual device is based on.- Overrides:
getBlueprint
in classDevice
- Returns:
- the blueprint
-
getBasicInformation
public ParameterObjectValue getBasicInformation()
Get the basic information of this device which is the basic information of the blueprint of this device.- Overrides:
getBasicInformation
in classDevice
- Returns:
- basic information of the device's blueprint. null if no basic information available.
-
setBlueprint
public void setBlueprint(Blueprint blueprint)
Set the blueprint the device is based on.- Parameters:
blueprint
- the blueprint to set
-
getCapabilities
public Set<Capability> getCapabilities()
Description copied from class:Device
Get the capabilities this device has- Specified by:
getCapabilities
in classDevice
- Returns:
- the capabilities
-
getResourceCapabilities
public Collection<ResourceCapability> getResourceCapabilities()
Description copied from class:Device
Get the resource capabilities of the device. A resource capability contains parameter values for a device capability. The Device class also contains methods for working with the parameters. So you can work with capability parameters through them or directly with the resource capability.- Specified by:
getResourceCapabilities
in classDevice
- Returns:
- all resource capabilities of the device
-
getResourceCapability
public ResourceCapability getResourceCapability(Capability capability)
Description copied from class:Device
Get a ResourceCapability of this device for the given capability.- Specified by:
getResourceCapability
in classDevice
- Parameters:
capability
- a capability- Returns:
- ResourceCapability for the capability. Null if this device doesn't have the given capability.
-
addCapability
public void addCapability(Capability capability)
Add capability to the device's blueprint.- Specified by:
addCapability
in classDevice
- Parameters:
capability
- The capability to be added.- See Also:
Device.addCapability(fi.tut.mei.capabilityQueryLib.model.Capability)
-
addResourceCapability
public void addResourceCapability(ResourceCapability capability)
Not yet implemented for this.- Specified by:
addResourceCapability
in classDevice
- Parameters:
capability
- the resource capability- See Also:
Device.addResourceCapability(fi.tut.mei.capabilityQueryLib.model.ResourceCapability)
-
getDescription
public String getDescription()
Get the description of the individual device. If the device doesn't have its own description returns the description of the blueprint.- Overrides:
getDescription
in classDevice
- Returns:
- the description.
-
addParameterValue
public void addParameterValue(Parameter param, Object value, Capability capability)
This has not yet been implemented for this subclass.- Specified by:
addParameterValue
in classDevice
- Parameters:
param
- the parameter whose value is setvalue
- the parameter valuecapability
- the capability to which this parameter value is related to- See Also:
Device.addParameterValue(fi.tut.mei.capabilityQueryLib.model.Parameter, java.lang.Object, fi.tut.mei.capabilityQueryLib.model.Capability)
-
getParameters
public Collection<ParameterValue> getParameters()
Gets parameters from the device's blueprint.- Specified by:
getParameters
in classDevice
- Returns:
- The parameter values.
- See Also:
Device.getParameters()
-
getParameterValuesForCapability
public Set<ParameterValue> getParameterValuesForCapability(Capability capability)
Gets parameter values from the blueprint.- Specified by:
getParameterValuesForCapability
in classDevice
- Parameters:
capability
- Capability whose parameter values will be returned.- Returns:
- Set of parameter values. Null if there are no parameters for the capability.
- See Also:
Device.getParameterValuesForCapability(fi.tut.mei.capabilityQueryLib.model.Capability)
-
addParameterObject
public void addParameterObject(String property, ParameterObjectValue value, Capability capability)
This has not yet been implemented for this subclass.- Specified by:
addParameterObject
in classDevice
- Parameters:
property
- The property name that connects a device capability and the valuevalue
- The parameter object valuecapability
- capability the value is related to
-
getCapabilityParameterObjectProperties
public Collection<String> getCapabilityParameterObjectProperties(Capability capability)
Description copied from class:Device
Get property names that connect the given capability to its ParameterObjectValues. Note this is not necessariliy the same as capability.getParameterObjectProperties since the device might not have ParameterObjectValues for all of the properties.- Specified by:
getCapabilityParameterObjectProperties
in classDevice
- Parameters:
capability
- a capability- Returns:
- property names that the device has ParameterObjectValues for
-
getParameterObjectValue
public Set<ParameterObjectValue> getParameterObjectValue(Capability capability, String property)
Description copied from class:Device
Get ParameterObjectValues related to a capability via the given property. For example the capability could be Moving and property "hasLinearMovementRanges"- Specified by:
getParameterObjectValue
in classDevice
- Parameters:
capability
- a capabilityproperty
- a property name- Returns:
- ParameterObjectValues
-
-