FileDocCategorySizeDatePackage
ExtendedSingleton.javaAPI DocExample1949Sun Dec 14 22:47:42 GMT 2003oreilly.hcj.finalstory

ExtendedSingleton

public class ExtendedSingleton extends Singleton
A demonstration of an extensible extention of the Singleton class.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.3 $

Fields Summary
private static final int
DEFAULT_VALUE
The default for the value property.
private final int
value
some value_
Constructors Summary
protected ExtendedSingleton(String[] params, int value)
Creates a new ExtendedSingleton object.

param
params parameters to the singleton.
param
value value to be managed in the singleton.


	                     	 
	       
		super(params);
		this.value = value;
	
Methods Summary
public static voidinit(java.lang.String[] params)
An initializer for our demo singleton that uses the default value.

param
params Parameters to the singleton.

		instance = new ExtendedSingleton(params, DEFAULT_VALUE);
	
public static voidinit(java.lang.String[] params, int value)
An initializer for our demo singleton that uses the custom value.

param
params Parameters to the singleton.
param
value A value for the singleton.

		instance = new ExtendedSingleton(params, value);
	
protected voidsupress()
Used just to supress eclipse warnings of unused local variables; irrelevant to the example.

		new Integer(this.value);