Class ComponentInstance

  • All Implemented Interfaces:
    ai.libs.jaicore.basic.IAnnotatable, IComponentInstance, java.io.Serializable

    public class ComponentInstance
    extends java.lang.Object
    implements IComponentInstance, java.io.Serializable
    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.
    See Also:
    Serialized Form
    • Constructor Detail

      • ComponentInstance

        public ComponentInstance​(IComponent component,
                                 java.util.Map<java.lang.String,​java.lang.String> parameterValues,
                                 java.util.Map<java.lang.String,​java.util.List<IComponentInstance>> 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

      • getParameterValues

        public java.util.Map<java.lang.String,​java.lang.String> getParameterValues()
        Specified by:
        getParameterValues in interface IComponentInstance
        Returns:
        The parameters and how their values were set.
      • getParameterValue

        public java.lang.String getParameterValue​(IParameter param)
        Specified by:
        getParameterValue in interface IComponentInstance
        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)
        Specified by:
        getParameterValue in interface IComponentInstance
        Parameters:
        paramName - The name of the parameter for which the value is requested.
        Returns:
        The value of the parameter with the given name.
      • 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()
      • putAnnotation

        public void putAnnotation​(java.lang.String key,
                                  java.lang.String annotation)
        Specified by:
        putAnnotation in interface ai.libs.jaicore.basic.IAnnotatable
      • getAnnotation

        public java.lang.String getAnnotation​(java.lang.String key)
        Specified by:
        getAnnotation in interface ai.libs.jaicore.basic.IAnnotatable
      • appendAnnotation

        public void appendAnnotation​(java.lang.String key,
                                     java.lang.String annotation)
        Specified by:
        appendAnnotation in interface ai.libs.jaicore.basic.IAnnotatable