Class YClass
Defined in: YClass.js.
Constructor Attributes | Constructor Name and Description |
---|---|
YClass()
class utilities Not instanciable.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
YClass.Abstract()
|
<static> |
YClass.extendPrototype(target, targetName, parentName)
|
<static> |
YClass.functionArgs(source)
get function argments name list.
|
kill()
|
|
linkEvent(target, evtDesc, functionName)
|
|
<static> |
YClass.override(childName, parentName, functionName, Function)
override function in an inherited object.
|
<static> |
YClass.xFunctions(target, sourceName)
extends functions from an inner object.
|
<static> |
YClass.xtends(target, source)
extends functions and vars from an other class.
|
Method Detail
<static>
YClass.Abstract()
<static>
YClass.extendPrototype(target, targetName, parentName)
- Parameters:
- target
- targetName
- parentName
<static>
{array}
YClass.functionArgs(source)
get function argments name list.
- Parameters:
- {function} source
- Returns:
- {array}
kill()
linkEvent(target, evtDesc, functionName)
- Parameters:
- target
- evtDesc
- functionName
<static>
YClass.override(childName, parentName, functionName, Function)
override function in an inherited object.
Must be done after object declaration
ex :
/!\be carefull about override order : any call to your overrided function made in an existing function is replaced.
Must be done after object declaration
ex :
var DoTwo=function(){};
DoTwo.prototype.countMe=function(anynum){ return anynum*2 };
var DoTen=function(){ DoTwo.call( this );}
DoTwo.prototype = new DoTwo();
YClass.override('DoTen','DoTwo','countMe',function(anynum){ return this.countMe(anynum)*5;});
//new DoTwo().countMe(anynum) will return anynum*2
//new DoTen().countMe(anynum) will return anynum*2*5
/!\be carefull about override order : any call to your overrided function made in an existing function is replaced.
- Parameters:
- {string} childName
- the child class name.
- {string} parentName
- the parent class name.
- {string} functionName
- the overrided function name.
- {function} Function
- the overriing new function.
resurrect()
<static>
YClass.xFunctions(target, sourceName)
extends functions from an inner object.
- Parameters:
- {object} target
- the owner class.
- {string} sourceName
- the inner var name of the source class instance.
<static>
YClass.xtends(target, source)
extends functions and vars from an other class.
- Parameters:
- {object} target
- {object} source