1  /**
     2   * com.sekati.core.CoreObject
     3   * @version 1.1.0
     4   * @author jason m horwitz | sekati.com
     5   * Copyright (C) 2007  jason m horwitz, Sekat LLC. All Rights Reserved.
     6   * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
     7   */
     8  
     9  import com.sekati.core.CoreInterface;
    10  import com.sekati.core.KeyFactory;
    11  import com.sekati.reflect.Stringifier;
    12  
    13  /**
    14   * The core mixin object in the SASAPI framework.
    15   */
    16  class com.sekati.core.CoreObject extends Object implements CoreInterface {
    17  
    18  	/**
    19  	 * CoreObject Constructor calls superclass, links _this and injects a 
    20  	 * {@link com.sekati.crypt.RUID} via {@link com.sekati.core.KeyFactory}.
    21  	 * @return Void
    22  	 */
    23  	public function CoreObject() {
    24  		super( );
    25  		KeyFactory.inject( this );
    26  	}
    27  
    28  	/**
    29  	 * Clean and destroy object instance contents/self for garbage collection.
    30  	 * Always call destroy() before deleting last object pointer.
    31  	 * @return Void
    32  	 */		
    33  	public function destroy():Void {
    34  		/*		 
    35  		 * VERY DANGEROUS BUGS CAN OCCUR WHEN EXTENDING 
    36  		 * COREOBJECT WITH THIS LOOP INCLUDED!
    37  		for(var i in this){
    38  		delete this[i];	
    39  		}
    40  		 */
    41  		delete this;
    42  	}
    43  
    44  	/**
    45  	 * Return the Fully Qualified Class Name string representation of
    46  	 * the instance object via {@link com.sekati.reflect.Stringifier}.
    47  	 * @return String
    48  	 */		
    49  	public function toString():String {
    50  		return Stringifier.stringify( this );	
    51  	}	
    52  }