}
public int getWaistSize() { }
return waistSize;
//抽象工厂 ClothesFactory.java
public abstract class ClothesFactory { }
//具体工厂
BeijingClothesFactory.java
public class BeijingClothesFactory extends ClothesFactory { }
ShanghaiClothesFactory.java
public class ShanghaiClothesFactory extends ClothesFactory {
public Trousers createTrousers(int waistSize, int height) { }
public UpperClothes createUpperClothes(int chestSize, int height) { }
return new WesternUpperClothes(\北京牌上衣\return new WesternTrousers(\北京牌裤子\public abstract UpperClothes createUpperClothes(int chestSize,int height); public abstract Trousers createTrousers(int waistSize,int height);
}
public Trousers createTrousers(int waistSize, int height) { }
public UpperClothes createUpperClothes(int chestSize, int height) { }
return new WesternUpperClothes(\上海牌上衣\return new WesternTrousers(\上海牌裤子\
相关推荐: