home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / Beez.swf / scripts / org / puremvc / as3 / patterns / observer / Notification.as next >
Encoding:
Text File  |  2008-09-03  |  1.2 KB  |  56 lines

  1. package org.puremvc.as3.patterns.observer
  2. {
  3.    import org.puremvc.as3.interfaces.*;
  4.    
  5.    public class Notification implements INotification
  6.    {
  7.        
  8.       
  9.       private var body:Object;
  10.       
  11.       private var name:String;
  12.       
  13.       private var type:String;
  14.       
  15.       public function Notification(name:String, body:Object = null, type:String = null)
  16.       {
  17.          super();
  18.          this.name = name;
  19.          this.body = body;
  20.          this.type = type;
  21.       }
  22.       
  23.       public function setBody(body:Object) : void
  24.       {
  25.          this.body = body;
  26.       }
  27.       
  28.       public function getName() : String
  29.       {
  30.          return name;
  31.       }
  32.       
  33.       public function toString() : String
  34.       {
  35.          var msg:String = "Notification Name: " + getName();
  36.          msg += "\nBody:" + (body == null ? "null" : body.toString());
  37.          return msg + ("\nType:" + (type == null ? "null" : type));
  38.       }
  39.       
  40.       public function getType() : String
  41.       {
  42.          return type;
  43.       }
  44.       
  45.       public function setType(type:String) : void
  46.       {
  47.          this.type = type;
  48.       }
  49.       
  50.       public function getBody() : Object
  51.       {
  52.          return body;
  53.       }
  54.    }
  55. }
  56.