SHARE
TWEET

Untitled

a guest Dec 6th, 2018 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ConcreteDecorator {
  2.     decoratedVisitor: Visitor
  3.  
  4.     visitLeaf(leaf) {
  5.         // Do some stuff before
  6.         result := decoratedVisitor.visitLeaf(leaf)
  7.         // Do some stuff after
  8.         return result;
  9.     }
  10.  
  11.     visitComposite(composite) {
  12.         // Do some stuff before
  13.         result := decoratedVisitor.visitComposite(leaf)
  14.         // Do some stuff after
  15.         return result;
  16.     }
  17. }
  18.    
  19. visitor := new ConcreteVisitorA()
  20. visitor := new ConcreteDecoratorA(visitor)
  21. Visitor := new ConcreteDecoratorB(visitor)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top