Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Singleton/ActionScript/singleton.as
Normal file
20
Task/Singleton/ActionScript/singleton.as
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package
|
||||
{
|
||||
public class Singleton
|
||||
{
|
||||
|
||||
private static var instance:Singleton;
|
||||
|
||||
// ActionScript does not allow private or protected constructors.
|
||||
public function Singleton(enforcer:SingletonEnforcer) {
|
||||
|
||||
}
|
||||
|
||||
public static function getInstance():Singleton {
|
||||
if (instance == null) instance = new Singleton(new SingletonEnforcer());
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class SingletonEnforcer {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue