Class CompoundInstance

    • Field Detail

      • slotValues

        private java.util.Map<java.lang.String,​java.lang.Object> slotValues
    • Constructor Detail

      • CompoundInstance

        public CompoundInstance​(CompoundTypeDescriptor type)
        Creates a compound instance and leaves it uninitialized.
        Parameters:
        type - the type
        See Also:
        #initialize(EvaluationVisitor)
    • Method Detail

      • initializeFor

        private void initializeFor​(IExpressionVisitor evaluator,
                                   CompoundTypeDescriptor type)
                            throws VilException
        Initializes this instance for the given (parent) type.
        Parameters:
        evaluator - the evaluator
        type - the type to initialize for
        Throws:
        VilException - in case that evaluating initialization expressions fails
      • getType

        public CompoundTypeDescriptor getType()
        Returns the type of this compound instance.
        Returns:
        the type
      • getSlotValue

        public java.lang.Object getSlotValue​(java.lang.String name)
                                      throws VilException
        Returns the value of the slot name.
        Parameters:
        name - the name of the slot
        Returns:
        the slot value (may be null for undefined)
        Throws:
        VilException - if there is no such slot defined
      • checkSlot

        private FieldDescriptor checkSlot​(java.lang.String name)
                                   throws VilException
        Checks whether there is a slot with given name.
        Parameters:
        name - the name of the slot
        Returns:
        the slot
        Throws:
        VilException - if there is no such slot
      • setSlotValue

        public void setSlotValue​(java.lang.String name,
                                 java.lang.Object value)
                          throws VilException
        Changes the value of slot name.
        Parameters:
        name - the name of the slot
        value - the value
        Throws:
        VilException - if there is no such slot defined
      • getStringValue

        public java.lang.String getStringValue​(IStringValueProvider.StringComparator comparator)
        Description copied from interface: IStringValueProvider
        Returns the string value of this object.
        Specified by:
        getStringValue in interface IStringValueProvider
        Parameters:
        comparator - if the sequence of elements, e.g., in case of collections, shall be ordered according to the comparator, null if the original sequence shall be returned
        Returns:
        the string value