Package Structural.Decorator
Class ConcreteDecoratorA
java.lang.Object
Structural.Decorator.Decorator
Structural.Decorator.ConcreteDecoratorA
- All Implemented Interfaces:
Component
A ConcreteDecorator that adds behavior to the Component.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConcreteDecoratorA(Component component) Constructor accepting a Component to wrap. -
Method Summary
Modifier and TypeMethodDescriptiondoublecost()Gets the cost of the component.Gets the description of the component.
-
Constructor Details
-
ConcreteDecoratorA
Constructor accepting a Component to wrap.- Parameters:
component- The Component to wrap.
-
-
Method Details
-
getDescription
Description copied from interface:ComponentGets the description of the component.- Specified by:
getDescriptionin interfaceComponent- Overrides:
getDescriptionin classDecorator- Returns:
- A string description.
-
cost
public double cost()Description copied from interface:ComponentGets the cost of the component.
-