1 Star 0 Fork 3

luyu/JavaDesigner

forked from serv/JavaDesigner 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
FontFactory.java 519 Bytes
一键复制 编辑 原始数据 按行查看 历史
serv 提交于 2014-04-08 11:42 +08:00 . init
/**
* A Flyweight Factory
*/
import java.util.*;
public class FontFactory {
private Hashtable charHashTable = new Hashtable();
public FontFactory() {
}
public Font GetFlyWeight(String s) {
if(charHashTable.get(s) != null) {
return (Font)charHashTable.get(s);
} else {
Font tmp = new ConcreteFont(s);
charHashTable.put(s, tmp);
return tmp;
}
}
public Hashtable GetFactory() {
return charHashTable;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/luyu/JavaDesigner.git
git@gitee.com:luyu/JavaDesigner.git
luyu
JavaDesigner
JavaDesigner
master

搜索帮助