Class Capability
- java.lang.Object
-
- fi.tut.mei.capabilityQueryLib.model.Capability
-
public class Capability extends Object
Represents a capability a device can have. A capability has a name and input and output associations. Input associations define what capabilities are required to form this capability as a combined capability. Output associations define what combined capabilities this capability together with other capabilities can form. Capability has also parameters: simple parameters like payload and more complex parameter objects for example item size.- Author:
- hylli
-
-
Constructor Summary
Constructors Constructor Description Capability(String name)
Create a capability with the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addInputAssociation(CapabilityAssociation association)
Add a new input association for the capabilityvoid
addOutputAssociation(CapabilityAssociation association)
add a new output capability associationvoid
addParameterAssociationForParameter(ParameterAssociation<Parameter> paramAssoc)
Add a parameter association to the capability.void
addParameterAssociationForParameterObject(String property, ParameterAssociation<ParameterObject> paramAssoc)
Add a parameter association for a object property.String
getDescription()
Get the capability's description text.ProcessTaxonomy
getImplements()
Get the process taxonomy that this capability implements if any.Set<CapabilityAssociation>
getInputs()
get the input capability associationsString
getName()
get the capability nameSet<CapabilityAssociation>
getOutputs()
get the output capability associationsParameterAssociation<Parameter>
getParameterAssociation(Parameter param)
Get parameter association for the given parameter.ParameterAssociation<ParameterObject>
getParameterAssociation(String property)
Get parameter association for the given property.Collection<ParameterAssociation<Parameter>>
getParameterAssociationsForParameters()
Get information about simple capability parameters such as payload associated with this capability.Set<String>
getParameterObjectProperties()
Get the different properties whose value is parameter association to a parameter objectSet<Parameter>
getParameters()
Deprecated.consider usinggetParameterAssociationsForParameters()
instead.boolean
isCombinedCapability()
Tells if this capability is a combined capability ie.e it has input associations.void
setDescription(String description)
Set the capability's description.void
setImplements(ProcessTaxonomy process)
Set a process taxonomy that this capability implements.void
setName(String name)
set capability nameString
toString()
-
-
-
Constructor Detail
-
Capability
public Capability(String name)
Create a capability with the given name.- Parameters:
name
- the capability name
-
-
Method Detail
-
getName
public String getName()
get the capability name- Returns:
- the name
-
setName
public void setName(String name)
set capability name- Parameters:
name
- the name to set
-
getDescription
public String getDescription()
Get the capability's description text.- Returns:
- the description
-
setDescription
public void setDescription(String description)
Set the capability's description.- Parameters:
description
- the description to set
-
setImplements
public void setImplements(ProcessTaxonomy process)
Set a process taxonomy that this capability implements.- Parameters:
process
- a process taxonomy that this capability implements
-
getImplements
public ProcessTaxonomy getImplements()
Get the process taxonomy that this capability implements if any.- Returns:
- a process taxonomy, null if not exists.
-
getOutputs
public Set<CapabilityAssociation> getOutputs()
get the output capability associations- Returns:
- the outputs
-
getInputs
public Set<CapabilityAssociation> getInputs()
get the input capability associations- Returns:
- the inputs
-
addOutputAssociation
public void addOutputAssociation(CapabilityAssociation association)
add a new output capability association- Parameters:
association
- the output association
-
addInputAssociation
public void addInputAssociation(CapabilityAssociation association)
Add a new input association for the capability- Parameters:
association
- the input association
-
isCombinedCapability
public boolean isCombinedCapability()
Tells if this capability is a combined capability ie.e it has input associations.- Returns:
- is this a combined capability
-
getParameters
@Deprecated public Set<Parameter> getParameters()
Deprecated.consider usinggetParameterAssociationsForParameters()
instead. You get the parameters via the ParameterAssociations and cardinality information.Get the parameters associated with this capability.- Returns:
- the parameters
-
getParameterAssociationsForParameters
public Collection<ParameterAssociation<Parameter>> getParameterAssociationsForParameters()
Get information about simple capability parameters such as payload associated with this capability. The association tells how many values for the parameter a device with the capability can have.- Returns:
- parameter associations for simple parameters
-
getParameterAssociation
public ParameterAssociation<Parameter> getParameterAssociation(Parameter param)
Get parameter association for the given parameter.- Parameters:
param
- the parameter- Returns:
- the parameter association. null if the capability doesn't have this capability parameter
-
getParameterAssociation
public ParameterAssociation<ParameterObject> getParameterAssociation(String property)
Get parameter association for the given property.- Parameters:
property
- the property for example hasItemSize- Returns:
- the parameter association. null if there is no parameter for the given property
-
addParameterAssociationForParameter
public void addParameterAssociationForParameter(ParameterAssociation<Parameter> paramAssoc)
Add a parameter association to the capability. The parameter association models the relationship between the capability and a capability parameter.- Parameters:
paramAssoc
- the parameter association
-
addParameterAssociationForParameterObject
public void addParameterAssociationForParameterObject(String property, ParameterAssociation<ParameterObject> paramAssoc)
Add a parameter association for a object property.- Parameters:
property
- the property for example hasItemSizeparamAssoc
- the association. for example to an ItemSize parameter object
-
-