Class ConcreteDecoratorB

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

public class ConcreteDecoratorB extends Decorator
Another ConcreteDecorator that adds behavior to the Component.
  • Constructor Details

    • ConcreteDecoratorB

      public ConcreteDecoratorB(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.