#107 JavaDoc improvements for Abstract Factory example
This commit is contained in:
parent
0d2df99013
commit
fd85a2f848
@ -3,20 +3,28 @@ package com.iluwatar.abstractfactory;
|
||||
/**
|
||||
*
|
||||
* The essence of the Abstract Factory pattern is a factory interface
|
||||
* (KingdomFactory) and its implementations (ElfKingdomFactory,
|
||||
* OrcKingdomFactory).
|
||||
*
|
||||
* ({@link KingdomFactory}) and its implementations ({@link ElfKingdomFactory},
|
||||
* {@link OrcKingdomFactory}).
|
||||
* <p>
|
||||
* The example uses both concrete implementations to create a king, a castle and
|
||||
* an army.
|
||||
*
|
||||
*/
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Program entry point
|
||||
* @param args command line arguments
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
createKingdom(new ElfKingdomFactory());
|
||||
createKingdom(new OrcKingdomFactory());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates kingdom
|
||||
* @param factory
|
||||
*/
|
||||
public static void createKingdom(KingdomFactory factory) {
|
||||
King king = factory.createKing();
|
||||
Castle castle = factory.createCastle();
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Army interface
|
||||
*
|
||||
*/
|
||||
public interface Army {
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Castle interface
|
||||
*
|
||||
*/
|
||||
public interface Castle {
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* ElfArmy
|
||||
*
|
||||
*/
|
||||
public class ElfArmy implements Army {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* ElfCastle
|
||||
*
|
||||
*/
|
||||
public class ElfCastle implements Castle {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* ElfKing
|
||||
*
|
||||
*/
|
||||
public class ElfKing implements King {
|
||||
|
||||
@Override
|
||||
|
@ -2,7 +2,7 @@ package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Concrete factory.
|
||||
* ElfKingdomFactory concrete factory.
|
||||
*
|
||||
*/
|
||||
public class ElfKingdomFactory implements KingdomFactory {
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* King interface
|
||||
*
|
||||
*/
|
||||
public interface King {
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* The factory interface.
|
||||
* KingdomFactory factory interface.
|
||||
*
|
||||
*/
|
||||
public interface KingdomFactory {
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* OrcArmy
|
||||
*
|
||||
*/
|
||||
public class OrcArmy implements Army {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* OrcCastle
|
||||
*
|
||||
*/
|
||||
public class OrcCastle implements Castle {
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* OrcKing
|
||||
*
|
||||
*/
|
||||
public class OrcKing implements King {
|
||||
|
||||
@Override
|
||||
|
@ -2,7 +2,7 @@ package com.iluwatar.abstractfactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* Concrete factory.
|
||||
* OrcKingdomFactory concrete factory.
|
||||
*
|
||||
*/
|
||||
public class OrcKingdomFactory implements KingdomFactory {
|
||||
|
Loading…
x
Reference in New Issue
Block a user