迭代器模式(iterator pattern) 扩展 详解本文地址: http://blog.csdn.net/caroline_wendy参考迭代器模式-Java迭代器: http://blog.csdn.net/caroline_wendy/article/details/35268931扩展迭代器模式, 添加一个Hashtable存储的类.具体方法:1. Hashtable的类, 包含创建v...
分类:
其他好文 时间:
2014-06-28 08:52:07
阅读次数:
245
迭代器模式(iterator pattern) 详解本文地址: http://blog.csdn.net/caroline_wendy迭代器模式(iterator pattern) : 提供一种方法顺序访问一个聚合对象中的各个元素, 而又不暴露其内部的表示;建立迭代器接口(iterator interface), 包含hasNext()方法和next()方法;不同聚合对象的具体的迭代器(concr...
分类:
其他好文 时间:
2014-06-28 07:43:35
阅读次数:
306
importjava.util.Arrays;importjava.util.List;importjava.util.regex.Pattern;publicclassValidator{/***是否必须有值<功能详细描述>**@paramvalue*@returnboolean*@see[类、类#方法、类#成员]*/publicstaticbooleanisRequired(Stringvalue){booleanisFieldValid=false;..
分类:
其他好文 时间:
2014-06-28 06:52:28
阅读次数:
239
迭代器模式(iterator pattern) Java 迭代器(Iterator) 详解本文地址: http://blog.csdn.net/caroline_wendy参考迭代器模式(iterator pattern): http://blog.csdn.net/caroline_wendy/article/details/35254643Java的标准库(util)中包含迭代器接口(iter...
分类:
编程语言 时间:
2014-06-27 23:26:42
阅读次数:
323
??????简单工厂模式解释: 简单工厂模式(Simple Factory Pattern)属于类的创新型模式,又叫静态工厂方法模式(Static FactoryMethod Pattern),是通过专门定义一个类来负责创建其它类的实例,被创建的实例通常都具有共同的父类。简单工厂模式的UML图: 简...
分类:
其他好文 时间:
2014-06-27 18:29:49
阅读次数:
195
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font ...
分类:
其他好文 时间:
2014-06-27 12:40:25
阅读次数:
187
开始以为是core文件太大,设置ulimit -c unlimited 以后,再次访问,显示./a.out Segmentation fault (core dumped)但是却找不到这个文件的地方,最后sysctl kernel.core_patternkernel.core_pattern = ...
分类:
其他好文 时间:
2014-06-26 17:21:12
阅读次数:
188
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2014-06-26 14:42:23
阅读次数:
164
This post introduces how to use the module pattern to limit the access scope of the methods of object or constructor in the module.
分类:
编程语言 时间:
2014-06-26 12:19:06
阅读次数:
231
这个设计模式感觉非常简单,我们平时写程序的时候也是经常需要调用iterator的,C++和Java都是。
所以感觉没什么特别的,就是需要模仿C++或者Java的iterator类的功能吧。
这里简单写个,使用C++模仿Java的iterator一些功能,呵呵。
首先我们有一个集合类,而这个集合类包含了其他类,当我们需要遍历这个集合类包含的类的时候,就好使用iterator功能了。
比如有一...
分类:
其他好文 时间:
2014-06-26 10:20:36
阅读次数:
254