FDT Pixlib template Singleton

<?xml version="1.0" encoding="UTF-8"?><templates><template autoinsert="true" context="com.pf.fdt.ui.editor.template.actionscript" deleted="false" description="Creates complete Singleton" enabled="true" id="com.pf.fdt.ui.editor.template.singleton" name="singleton">import com.bourre.log.PixlibStringifier;
/**
 * @author ${user}
 */
class ${enclosing_package_and_type} 
{
	private static var _oI : ${enclosing_type};
 
	/**
	 * @return singleton instance of ${enclosing_type}
	 */
	public static function getInstance() : ${enclosing_type} 
	{
		if (!_oI) _oI = new ${enclosing_type}();
		return _oI;
	}
 
	private function ${enclosing_type}()
	{
		//${cursor}
	}
 
	/**
	 * Returns the string representation of this instance.
	 * @return the string representation of this instance
	 */
	public function toString() : String 
	{
		return PixlibStringifier.stringify( this );
	}
}</template></templates>

Discussion

Enter your comment
 
 
projects/pixlib/fdt_template/singleton.txt · Last modified: 2007/02/16 12:19 (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki