Class ConcreteDecoratorA

java.lang.Object
Structural.Decorator.Decorator
Structural.Decorator.ConcreteDecoratorA
All Implemented Interfaces:
Component

public class ConcreteDecoratorA extends Decorator
A ConcreteDecorator that adds behavior to the Component.
  • Constructor Details

    • ConcreteDecoratorA

      public ConcreteDecoratorA(Component component)
      Constructor accepting a Component to wrap.
      Parameters:
      component - The Component to wrap.
  • Method Details

    • getDescription

      public String getDescription()
      Description copied from interface: Component
      Gets the description of the component.
      Specified by:
      getDescription in interface Component
      Overrides:
      getDescription in class Decorator
      Returns:
      A string description.
    • cost

      public double cost()
      Description copied from interface: Component
      Gets the cost of the component.
      Specified by:
      cost in interface Component
      Overrides:
      cost in class Decorator
      Returns:
      The cost as a double.