#107 Improvements for Multiton JavaDoc
This commit is contained in:
parent
e8c8e26c8b
commit
952ebc638f
@ -6,14 +6,18 @@ package com.iluwatar.multiton;
|
|||||||
* accessible object the Multiton pattern defines many globally
|
* accessible object the Multiton pattern defines many globally
|
||||||
* accessible objects. The client asks for the correct instance
|
* accessible objects. The client asks for the correct instance
|
||||||
* from the Multiton by passing an enumeration as parameter.
|
* from the Multiton by passing an enumeration as parameter.
|
||||||
*
|
* <p>
|
||||||
* In this example Nazgul is the Multiton and we can ask single
|
* In this example {@link Nazgul} is the Multiton and we can ask single
|
||||||
* Nazgul from it using NazgulName. The Nazguls are statically
|
* {@link Nazgul} from it using {@link NazgulName}. The {@link Nazgul}s are statically
|
||||||
* initialized and stored in concurrent hash map.
|
* initialized and stored in concurrent hash map.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class App {
|
public class App {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Program entry point
|
||||||
|
* @param args command line args
|
||||||
|
*/
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
System.out.println("KHAMUL=" + Nazgul.getInstance(NazgulName.KHAMUL));
|
System.out.println("KHAMUL=" + Nazgul.getInstance(NazgulName.KHAMUL));
|
||||||
System.out.println("MURAZOR=" + Nazgul.getInstance(NazgulName.MURAZOR));
|
System.out.println("MURAZOR=" + Nazgul.getInstance(NazgulName.MURAZOR));
|
||||||
|
@ -6,7 +6,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Nazgul is a Multiton class. Nazgul instances can be queried
|
* Nazgul is a Multiton class. Nazgul instances can be queried
|
||||||
* using getInstance() method.
|
* using {@link #getInstance} method.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class Nazgul {
|
public class Nazgul {
|
||||||
|
@ -2,7 +2,7 @@ package com.iluwatar.multiton;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Each Nazgul has different NazgulName.
|
* Each Nazgul has different {@link NazgulName}.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum NazgulName {
|
public enum NazgulName {
|
||||||
|
@ -4,6 +4,11 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import com.iluwatar.multiton.App;
|
import com.iluwatar.multiton.App;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Application test
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class AppTest {
|
public class AppTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user