Package ai.libs.hasco.model
Class ComponentInstance
- java.lang.Object
-
- ai.libs.hasco.model.ComponentInstance
-
public class ComponentInstance extends java.lang.Object
For a givenComponent
, aComponent Instance
defines all parameter values and the required interfaces (recursively) and thus provides a grounding of the respectiveComponent
.
-
-
Constructor Summary
Constructors Constructor Description ComponentInstance(ComponentInstance other)
ComponentInstance(Component component, java.util.Map<java.lang.String,java.lang.String> parameterValues, java.util.Map<java.lang.String,ComponentInstance> satisfactionOfRequiredInterfaces)
Constructor for creating aComponentInstance
for a particularComponent
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Component
getComponent()
java.util.Collection<Component>
getContainedComponents()
java.lang.String
getNestedComponentDescription()
java.util.Collection<Parameter>
getParametersThatHaveBeenSetExplicitly()
java.util.Collection<Parameter>
getParametersThatHaveNotBeenSetExplicitly()
java.lang.String
getParameterValue(Parameter param)
java.lang.String
getParameterValue(java.lang.String paramName)
java.util.Map<java.lang.String,java.lang.String>
getParameterValues()
java.lang.String
getPrettyPrint()
Returns the description of aComponentInstance
as a pretty print with indentation.java.util.Map<java.lang.String,ComponentInstance>
getSatisfactionOfRequiredInterfaces()
int
hashCode()
boolean
matchesPathRestriction(java.util.List<ai.libs.jaicore.basic.sets.Pair<java.lang.String,java.lang.String>> path)
This method checks, whether a path of refinements conforms the constraints for parameter refinements.boolean
matchesPathRestrictions(java.util.Collection<java.util.List<ai.libs.jaicore.basic.sets.Pair<java.lang.String,java.lang.String>>> paths)
This method checks, whether a given list of paths of refinements conforms the constraints for parameter refinements.java.lang.String
toComponentNameString()
java.lang.String
toString()
-
-
-
Constructor Detail
-
ComponentInstance
public ComponentInstance(ComponentInstance other)
-
ComponentInstance
public ComponentInstance(Component component, java.util.Map<java.lang.String,java.lang.String> parameterValues, java.util.Map<java.lang.String,ComponentInstance> satisfactionOfRequiredInterfaces)
Constructor for creating aComponentInstance
for a particularComponent
.- Parameters:
component
- The component that is grounded.parameterValues
- A map containing the parameter values of this grounding.satisfactionOfRequiredInterfaces
- The refinement of the required interfaces.
-
-
Method Detail
-
getComponent
public Component getComponent()
- Returns:
- The
Component
to thisComponentInstance
.
-
getParameterValues
public java.util.Map<java.lang.String,java.lang.String> getParameterValues()
- Returns:
- The parameters and how their values were set.
-
getParametersThatHaveBeenSetExplicitly
public java.util.Collection<Parameter> getParametersThatHaveBeenSetExplicitly()
- Returns:
- The set of parameters of which the values have been set explicitly.
-
getParametersThatHaveNotBeenSetExplicitly
public java.util.Collection<Parameter> getParametersThatHaveNotBeenSetExplicitly()
- Returns:
- The set of parameters of which the values have not been set explicitly.
-
getParameterValue
public java.lang.String getParameterValue(Parameter param)
- Parameters:
param
- The parameter for which the value shall be returned.- Returns:
- The value of the parameter.
-
getParameterValue
public java.lang.String getParameterValue(java.lang.String paramName)
- Parameters:
paramName
- The name of the parameter for which the value is requested.- Returns:
- The value of the parameter with the given name.
-
getSatisfactionOfRequiredInterfaces
public java.util.Map<java.lang.String,ComponentInstance> getSatisfactionOfRequiredInterfaces()
- Returns:
- This method returns a mapping of interface IDs to component instances.
-
getContainedComponents
public java.util.Collection<Component> getContainedComponents()
- Returns:
- A collection of all components contained (recursively) in this
ComponentInstance
.
-
matchesPathRestrictions
public boolean matchesPathRestrictions(java.util.Collection<java.util.List<ai.libs.jaicore.basic.sets.Pair<java.lang.String,java.lang.String>>> paths)
This method checks, whether a given list of paths of refinements conforms the constraints for parameter refinements.- Parameters:
paths
- A list of paths of refinements to be checked.- Returns:
- Returns true if everything is alright and false if there is an issue with the given paths.
-
matchesPathRestriction
public boolean matchesPathRestriction(java.util.List<ai.libs.jaicore.basic.sets.Pair<java.lang.String,java.lang.String>> path)
This method checks, whether a path of refinements conforms the constraints for parameter refinements.- Parameters:
path
- A path of refinements to be checked.- Returns:
- Returns true if everything is alright and false if there is an issue with the given path.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toComponentNameString
public java.lang.String toComponentNameString()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getPrettyPrint
public java.lang.String getPrettyPrint() throws java.io.IOException
Returns the description of aComponentInstance
as a pretty print with indentation.- Returns:
- A string representing this object in JSON format.
- Throws:
java.io.IOException
- An IOException is thrown if the object cannot be serialized to a String.
-
getNestedComponentDescription
public java.lang.String getNestedComponentDescription()
-
-