Interface CollectionClass

All Superinterfaces:
DataClass, PropertyHandler
All Known Subinterfaces:
ListClass, SetClass
All Known Implementing Classes:
CollectionClassImpl, ListClassImpl, SetClassImpl

public interface CollectionClass extends DataClass
The Collection Classes SetClass and ListClass are both containers that can store each kind of data objects. Typical restrictions are the maximum and minimum number of elements and the base data class of whom the element objects must be instances. The difference between List and Set is that a List stores the elements in a fixed order, whereby a Set uses an arbitrary order.

Properties of collection classes:

Data Class Equal Element Types? Elements Ordered? Duplicates Possible? Element Access Number of Elements
SetClass yes no no iterator variable
ListClass yes yes yes iterator variable
Properties of collection classes
Author:
rmaximi
See Also:
  • Field Details

  • Method Details

    • getElementClass

      DataClass getElementClass()
      Each collection can contain elements of one special type. This type can be received with this method.

      If several DataClasses should be used as type, you must summarize these classes in an UnionClass.

      Returns:
      The DataClass of the elements.
    • setElementClass

      void setElementClass(DataClass elementClass) throws IllegalEditException
      Each collection can contain elements of one special type. This type can be received with this method.

      If several DataClasses should be used as type, you must summarize these classes in an UnionClass.

      Parameters:
      elementClass - The DataClass of the collection elements.
      Throws:
      IllegalEditException - if any.
    • getMaxCardinality

      int getMaxCardinality()

      getMaxCardinality.

      Returns:
      the maximum number of elements that are allowed in the CollectionObject
    • setMaxCardinality

      void setMaxCardinality(int maxCardinality) throws IllegalEditException

      setMaxCardinality.

      Parameters:
      maxCardinality - The maximum number of elements that are allowed in the CollectionObject.
      Throws:
      IllegalEditException - is thrown if the class is not editable, e.g., the class is already declared as finished.
    • getMinCardinality

      int getMinCardinality()

      getMinCardinality.

      Returns:
      the minimum number of elements that are required in the CollectionObject
    • setMinCardinality

      void setMinCardinality(int minCardinality) throws IllegalEditException

      setMinCardinality.

      Parameters:
      minCardinality - The minimum number of elements that are required in the CollectionObject.
      Throws:
      IllegalEditException - is thrown if the class is not editable, e.g., the class is already declared as finished.