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 voidaddCapability(Capability capability)Add capability to the device's blueprint.voidaddParameterObject(String property, ParameterObjectValue value, Capability capability)This has not yet been implemented for this subclass.voidaddParameterValue(Parameter param, Object value, Capability capability)This has not yet been implemented for this subclass.voidaddResourceCapability(ResourceCapability capability)Not yet implemented for this.ParameterObjectValuegetBasicInformation()Get the basic information of this device which is the basic information of the blueprint of this device.BlueprintgetBlueprint()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.StringgetDescription()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.ResourceCapabilitygetResourceCapability(Capability capability)Get a ResourceCapability of this device for the given capability.voidsetBlueprint(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:
getBlueprintin 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:
getBasicInformationin 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:DeviceGet the capabilities this device has- Specified by:
getCapabilitiesin classDevice- Returns:
- the capabilities
-
getResourceCapabilities
public Collection<ResourceCapability> getResourceCapabilities()
Description copied from class:DeviceGet 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:
getResourceCapabilitiesin classDevice- Returns:
- all resource capabilities of the device
-
getResourceCapability
public ResourceCapability getResourceCapability(Capability capability)
Description copied from class:DeviceGet a ResourceCapability of this device for the given capability.- Specified by:
getResourceCapabilityin 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:
addCapabilityin 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:
addResourceCapabilityin 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:
getDescriptionin 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:
addParameterValuein 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:
getParametersin classDevice- Returns:
- The parameter values.
- See Also:
Device.getParameters()
-
getParameterValuesForCapability
public Set<ParameterValue> getParameterValuesForCapability(Capability capability)
Gets parameter values from the blueprint.- Specified by:
getParameterValuesForCapabilityin 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:
addParameterObjectin 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:DeviceGet 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:
getCapabilityParameterObjectPropertiesin 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:DeviceGet ParameterObjectValues related to a capability via the given property. For example the capability could be Moving and property "hasLinearMovementRanges"- Specified by:
getParameterObjectValuein classDevice- Parameters:
capability- a capabilityproperty- a property name- Returns:
- ParameterObjectValues
-
-