Class CompoundDecorator

  • All Implemented Interfaces:
    PrintDecorator

    public class CompoundDecorator
    extends java.lang.Object
    implements PrintDecorator
    Decorates prints with multiple decorators.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Print decorate​(Print target)
      Wraps the target in a decoration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompoundDecorator

        public CompoundDecorator​(PrintDecorator[] decorators)
        Constructs a CompoundDecorator.
        Parameters:
        decorators - the decorators, in order from innermost to outermost.
    • Method Detail

      • decorate

        public Print decorate​(Print target)
        Description copied from interface: PrintDecorator
        Wraps the target in a decoration. The decoration depends on the runtime class of the decorator.
        Specified by:
        decorate in interface PrintDecorator
        Parameters:
        target - the print to wrap with a decoration.
        Returns:
        the target wrapped in a decoration.