Interface AggregateClass

  • All Superinterfaces:
    DataClass, PropertyHandler
    All Known Implementing Classes:
    AggregateClassImpl

    public interface AggregateClass
    extends DataClass
    The Aggregate Class uses the object oriented technique aggregation to combine several data classes into one class. This combination is realised with attributes that consist of a name and a corresponding data class, similar to instance variables of classes in object oriented programming languages. Arbitrary data classes can be used for the combination, especially other Aggregate Classes are possible. Thus, the modelling of deep aggregation hierarchies is possible.

    To create an aggregate class, it's necessary to edit the xml file model.xml with the super class "Aggregate" and an arbitrary name. The attributes can be defined in the inner tag. They also need a super class and a name.

    For example, a aggregate class can look like:

         <AggregateClass name="DataflowElement" superClass="Aggregate">
              <Attribute name="name" class="String" />
         </AggregateClass>
     
    Author:
    rmaximi
    • Method Detail

      • containsAttribute

        boolean containsAttribute​(String attributeName)
        Checks if the given attribute name is visible in this class.
        Parameters:
        attributeName - a String object
        Returns:
        true if the given attribute name exists in this or in one of the parent AggregateClasses.
      • getAttributeNames

        List<String> getAttributeNames()
        An array of all visible attributes should be returned. That includes all local defined attributes and all attributes from all super classes. Overriden attributes are only returned once.

        The order in the array is not fixed and can vary in each message call.

        Please note that the usage of this method does not work if the aggregate class is not finished.

        Returns:
        An array of attribute names. The result is never be null.
      • getAttributeType

        DataClass getAttributeType​(String attributeName)
        Determine the type of the specified attribute. Warning: Only works on finished classes, returns null otherwise. To determine attribute-types in unfinished classes, call getInheritedAttributeType or getLocalAttributeType.
        Parameters:
        attributeName - a String object
        Returns:
        the type of the given attribute or null, if the attribute not exist
      • getInheritedAttributeNames

        String[] getInheritedAttributeNames()
        An array of all inherited attribute names.

        The order in the array is not fixed and can vary in each message call.

        Returns:
        An array of inherited attribute names. The result is never be null.
      • getInheritedAttributeType

        DataClass getInheritedAttributeType​(String attributeName)

        getInheritedAttributeType.

        Parameters:
        attributeName - a String object
        Returns:
        the type of the given attribute or null, if the attribute not exist in one of the parents
      • getLocalAttributeNames

        String[] getLocalAttributeNames()
        An array of all local defined attribute names.

        The order in the array is not fixed and can vary in each message call.

        Returns:
        An array of local attribute names. The result is never be null.
      • getLocalAttributeType

        DataClass getLocalAttributeType​(String attributeName)

        getLocalAttributeType.

        Parameters:
        attributeName - a String object
        Returns:
        the type of the given attribute or null, if the attribute not exist
      • getNumberOfAttributes

        int getNumberOfAttributes()
        getNumberOfAttributes() == getAttributeNames().size();
        Returns:
        the number of visible attributes.
      • getNumberOfLocalAttributes

        int getNumberOfLocalAttributes()
        getNumberOfLocalAttributes() == getLocalAttributeNames().size();
        Returns:
        the number of visible attributes.
      • getOverridenAttributeNames

        String[] getOverridenAttributeNames()
        An array of all local defined attribute names that override an attribute definition from one of the super classes.

        The order in the array is not fixed and can vary in each message call.

        Returns:
        An array of overriden attribute names. The result is never be null.
      • hasAttribute

        boolean hasAttribute​(String attributeName)
        Checks if the attribute name is defined in this class or in one of the super classes
        Parameters:
        attributeName - a String object
        Returns:
        true if the given attribute name exists in this AggregateClass.
      • getAttributeProperty

        String getAttributeProperty​(String attributeName,
                                    String propertyName)
                             throws NoSuchAttributeException
        Gets the value of the given property name for the given attribute. If the property does not exists, null will be returned.
        Parameters:
        attributeName - a String object
        propertyName - a String object
        Returns:
        The value of the property or null, if the property does not exists.
        Throws:
        NoSuchAttributeException - if any.
        See Also:
        will be thrown.
      • getAttributePropertyNames

        String[] getAttributePropertyNames​(String attributeName)
                                    throws NoSuchAttributeException
        To receive all properties of an attribute that are set use this method. The result will never be null.
        Parameters:
        attributeName - a String object
        Returns:
        All properties of the specified attribute. null will be never returned.
        Throws:
        NoSuchAttributeException - if any.
        See Also:
        will be thrown.
      • removeAttributeProperty

        String removeAttributeProperty​(String attributeName,
                                       String propertyName)
                                throws NoSuchAttributeException
        A property for a given attribute can be removed by setting a null property value or by using this method. In both cases the property is removed only if the property with the name propertyName exists.
        Parameters:
        propertyName - The name of the property that should be removed.
        attributeName - a String object
        Returns:
        The value of the removed property or null if the property does not exist.
        Throws:
        NoSuchAttributeException
      • updateAttributeType

        void updateAttributeType​(String attributeName,
                                 DataClass newType)
                          throws IllegalEditException
        To change the type of the attribute call this message. If the attribute name does not exist, it will be automatically added.
        Parameters:
        attributeName - a String object
        newType - a DataClass object
        Throws:
        IllegalEditException - if any.