com.perisic.shadow.example.mains
Class Redefine

java.lang.Object
  extended by com.perisic.shadow.example.mains.Redefine

public class Redefine
extends java.lang.Object

This example shows how a shadow can be used to to redefine the behaviour of an object. Fabian smiles differently the second time then the first time becaues the SmileShadow redefines smiling.

public class Redefine {

 public static void main(String [] args) {
       NiceFellow fabian = new NiceFellow("Fabian");

       fabian.call("smile",1);
       fabian.addShadow(new SmileShadow());
       fabian.call("smile", 1); 
       fabian.call("printMood"); 
       }

 }


Constructor Summary
Redefine()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Redefine

public Redefine()
Method Detail

main

public static void main(java.lang.String[] args)