Class ComponentGroup

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.List elements
      The elements of the group
    • Constructor Summary

      Constructors 
      Constructor Description
      ComponentGroup()
      Create a new group.
      ComponentGroup​(java.util.List elements)
      Create a new group with given elements.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addElement​(java.lang.Object k)
      Add an element to the group.
      boolean contains​(java.lang.Object k)
      Check if the group contains the given element.
      java.util.List getElements()
      Returns a list of the elements.
      java.lang.Object getSingelton()
      If there is only one element in the group, return this element, else null
      boolean isSingelton()
      Returns true, if there is only one one element in the group.
      java.util.Iterator iterator()
      Returns the iterator over the elements.
      void removeElement​(java.lang.Object k)
      Remove an element from the group.
      int size()
      Returns the size (number of elements) for the group.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • elements

        protected java.util.List elements
        The elements of the group
    • Constructor Detail

      • ComponentGroup

        public ComponentGroup()
        Create a new group.
      • ComponentGroup

        public ComponentGroup​(java.util.List elements)
        Create a new group with given elements.
        Parameters:
        elements - The elements of the new group.
    • Method Detail

      • addElement

        public void addElement​(java.lang.Object k)
        Add an element to the group.
        Specified by:
        addElement in interface IComponentGroup
        Parameters:
        k - The element to add.
      • removeElement

        public void removeElement​(java.lang.Object k)
        Remove an element from the group.
        Specified by:
        removeElement in interface IComponentGroup
        Parameters:
        k - The element to remove.
      • getElements

        public java.util.List getElements()
        Returns a list of the elements.
        Specified by:
        getElements in interface IComponentGroup
        Returns:
        The list of element.
      • size

        public int size()
        Returns the size (number of elements) for the group.
        Specified by:
        size in interface IComponentGroup
        Returns:
        The size of the group.
      • iterator

        public java.util.Iterator iterator()
        Returns the iterator over the elements.
        Specified by:
        iterator in interface IComponentGroup
        Returns:
        The iterator
      • contains

        public boolean contains​(java.lang.Object k)
        Check if the group contains the given element.
        Specified by:
        contains in interface IComponentGroup
        Parameters:
        k - The element to check.
        Returns:
        true if the group contains the element.
      • getSingelton

        public java.lang.Object getSingelton()
        If there is only one element in the group, return this element, else null
        Returns:
        The element if there is only one element in the group.
      • isSingelton

        public boolean isSingelton()
        Returns true, if there is only one one element in the group.
        Returns:
        true if the size of the group is one.