Interface IFeature

All Known Implementing Classes:
Feature

public interface IFeature
Interface to be implemented by all the feature classes. Feature is an aspect of some class's behavior. Features are convenient tool to develop classes with multiple aspects of functionality because:
  • They motivate the developer to separate different aspects from each other and minimize the dependencies between them
  • They allow to apply the same aspect of functionality to the different classes
The classes containing features are feature containers and must implement IFeatureContainer interface.
Author:
Andrey Malykhanov
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final IFeature
    A singleton object indicating that there is no some feature
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a copy of this feature.
    default Class<?>
    Returns the closest non-anonymous class of this feature in its hierarchy
    void
    Initializes the feature.
  • Field Details

    • NO_FEATURE

      static final IFeature NO_FEATURE
      A singleton object indicating that there is no some feature
  • Method Details

    • initialize

      void initialize()
      Initializes the feature. This method can often be used to search for other features that are present in the feature container that this feature belongs to.
    • copy

      IFeature copy()
      Returns a copy of this feature. If null is returned, then this feature is not included into a copy of the feature container created by FeatureContainer.copy() method.
      Returns:
      copy of this feature
    • featureClass

      default Class<?> featureClass()
      Returns the closest non-anonymous class of this feature in its hierarchy
      Returns:
      the closest non-anonymous class of this feature