Class Leaf

java.lang.Object
Structural.Composite.Leaf
All Implemented Interfaces:
Component

public class Leaf extends Object implements Component
Represents the Leaf object in the Composite pattern. A Leaf has no children and defines behavior for primitive objects.
  • Constructor Details

    • Leaf

      public Leaf(String name)
      Constructor for the Leaf.
      Parameters:
      name - The name of the Leaf.
  • Method Details

    • operation

      public void operation()
      Performs the operation specific to the Leaf.
      Specified by:
      operation in interface Component