Class Capabilities

    • Field Detail

      • m_Capabilities

        protected Set<Capability> m_Capabilities
        the capabilities.
      • m_DependentCapabilities

        protected Set<Capability> m_DependentCapabilities
        the dependent capabilities.
      • m_MinRows

        protected int m_MinRows
        the minimum number of columns (-1 is undefined).
      • m_MaxRows

        protected int m_MaxRows
        the maximum number of columns (-1 is undefined).
      • m_MinColumns

        protected int m_MinColumns
        the minimum number of columns (-1 is undefined).
      • m_MaxColumns

        protected int m_MaxColumns
        the maximum number of columns (-1 is undefined).
      • m_MinClassColumns

        protected int m_MinClassColumns
        the minimum number of class attributes (-1 is undefined).
      • m_MaxClassColumns

        protected int m_MaxClassColumns
        the maximum number of class attributes (-1 is undefined).
    • Constructor Detail

      • Capabilities

        public Capabilities()
        Initializes the capabilities with no owner.
      • Capabilities

        public Capabilities​(CapabilitiesHandler owner)
        Initializes the capabilities.
        Parameters:
        owner - the owner
    • Method Detail

      • reset

        protected void reset()
        Resets the capabilities.
      • setOwner

        public void setOwner​(CapabilitiesHandler value)
        Sets the owner of these capabilities.
        Parameters:
        value - the owner
      • getOwner

        public CapabilitiesHandler getOwner()
        Returns the owner of these capabilities.
        Returns:
        the owner
      • clone

        public Capabilities clone()
        Creates a clone of itself.
        Overrides:
        clone in class Object
        Returns:
        the clone
      • assign

        public void assign​(Capabilities other)
        Uses the capabilities from the provided capabilities object.
        Parameters:
        other - the capabilities to use instead
      • widen

        protected int widen​(int current,
                            int proposed,
                            boolean up)
        Widens the min/max values.
        Parameters:
        current - the current value
        proposed - the proposed value
        up - whether a maximum (= true) or minimum (= false)
        Returns:
        the new value
      • mergeWith

        public void mergeWith​(Capabilities other)
        Merges with the capabilities from the provided capabilities object. Min/Max properties get widened, if necessary, to accommodate both capabilities. Capabilities and dependent ones simply get added.
        Specified by:
        mergeWith in interface Mergeable<Capabilities>
        Parameters:
        other - the capabilities to merge with
      • capabilities

        public Set<Capability> capabilities()
        Returns the capabilities.
        Returns:
        the capabilities
      • dependentCapabilities

        public Set<Capability> dependentCapabilities()
        Returns the dependent capabilities.
        Returns:
        the capabilities
      • enable

        public void enable​(Capability cap)
        Enables the capability.
        Parameters:
        cap - the capability to enable
      • disable

        public void disable​(Capability cap)
        Disables the capability.
        Parameters:
        cap - the capability to disable
      • enableAll

        public void enableAll​(Collection<Capability> caps)
        Enables all capabilities.
        Parameters:
        caps - the capabilities to enable
      • disableAll

        public void disableAll​(Collection<Capability> caps)
        Disables all capabilities.
        Parameters:
        caps - the capabilities to disable
      • enableAll

        public void enableAll()
        Enables all capabilities.
      • disableAll

        public void disableAll()
        Disables all capabilities.
      • enableAllClass

        public void enableAllClass()
        Enables all class capabilities.
      • disableAllClass

        public void disableAllClass()
        Disables all class capabilities.
      • isEnabled

        public boolean isEnabled​(Capability cap)
        Returns whether the specified capability is enabled, i.e., supported.
        Parameters:
        cap - the capability to check
        Returns:
        true if enabled
      • enableDependent

        public void enableDependent​(Capability cap)
        Enables the dependent capability.
        Parameters:
        cap - the capability to enable
      • disableDependent

        public void disableDependent​(Capability cap)
        Disables the dependent capability.
        Parameters:
        cap - the capability to disable
      • enableAllDependent

        public void enableAllDependent​(Collection<Capability> caps)
        Enables the dependent capabilities.
        Parameters:
        caps - the capabilities to enable
      • disableAllDependent

        public void disableAllDependent​(Collection<Capability> caps)
        Disables the dependent capabilities.
        Parameters:
        caps - the capabilities to disable
      • enableAllDependent

        public void enableAllDependent()
        Enables the dependent capabilities for all currently set capabilities.
      • disableAllDependent

        public void disableAllDependent()
        Disables all the dependent capabilities.
      • isDependentEnabled

        public boolean isDependentEnabled​(Capability cap)
        Returns whether the specified dependent capability is enabled, i.e., supported.
        Parameters:
        cap - the capability to check
        Returns:
        true if enabled
      • setMinRows

        public void setMinRows​(int value)
        Sets the minimum number of required columns.
        Parameters:
        value - the minimum, -1 for undefined
      • getMinRows

        public int getMinRows()
        Returns the minimum number of required columns.
        Returns:
        the minimum, -1 if undefined
      • setMaxRows

        public void setMaxRows​(int value)
        Sets the maximum number of required columns.
        Parameters:
        value - the maximum, -1 for undefined
      • getMaxRows

        public int getMaxRows()
        Returns the maximum number of required columns.
        Returns:
        the maximum, -1 if undefined
      • setMinColumns

        public void setMinColumns​(int value)
        Sets the minimum number of required columns.
        Parameters:
        value - the minimum, -1 for undefined
      • getMinColumns

        public int getMinColumns()
        Returns the minimum number of required columns.
        Returns:
        the minimum, -1 if undefined
      • setMaxColumns

        public void setMaxColumns​(int value)
        Sets the maximum number of required columns.
        Parameters:
        value - the maximum, -1 for undefined
      • getMaxColumns

        public int getMaxColumns()
        Returns the maximum number of required columns.
        Returns:
        the maximum, -1 if undefined
      • setMinClassColumns

        public void setMinClassColumns​(int value)
        Sets the minimum number of required class columns.
        Parameters:
        value - the minimum, -1 for undefined
      • getMinClassColumns

        public int getMinClassColumns()
        Returns the minimum number of required class columns.
        Returns:
        the minimum, -1 if undefined
      • setMaxClassColumns

        public void setMaxClassColumns​(int value)
        Sets the maximum number of required class columns.
        Parameters:
        value - the maximum, -1 for undefined
      • getMaxClassColumns

        public int getMaxClassColumns()
        Returns the maximum number of required class columns.
        Returns:
        the maximum, -1 if undefined
      • toString

        public String toString()
        Returns a short description of itself.
        Overrides:
        toString in class Object
        Returns:
        the description