Class ComponentInstance


  • public class ComponentInstance
    extends java.lang.Object
    For a given Component, a Component Instance defines all parameter values and the required interfaces (recursively) and thus provides a grounding of the respective Component.
    • Constructor Detail

      • 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 a ComponentInstance for a particular Component.
        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 this ComponentInstance.
      • 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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toComponentNameString

        public java.lang.String toComponentNameString()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getPrettyPrint

        public java.lang.String getPrettyPrint()
                                        throws java.io.IOException
        Returns the description of a ComponentInstance 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()