org.wilmascope.patterns
Class Singleton

java.lang.Object
  extended by org.wilmascope.patterns.Singleton

public class Singleton
extends java.lang.Object

Use Singleton.instance(String) to access a given instance by name.


Constructor Summary
protected Singleton()
          The constructor could be made private to prevent others from instatiating this class.
 
Method Summary
static Singleton instance(java.lang.String byname)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Singleton

protected Singleton()
The constructor could be made private to prevent others from instatiating this class. But this would also make it impossible to create instances of Singleton subclasses.

Method Detail

instance

public static Singleton instance(java.lang.String byname)
Returns:
The unique instance of the specified class.