1、模式定义
迭代器模式(Iterator Pattern) :提供一种方法来访问聚合对象,而不用暴露这个对象的内部表示,其别名为游标(Cursor)。迭代器模式是一种对象行为型模式。
2、模式结构
迭代器模式包含如下角色:
Iterator: 抽象迭代器
ConcreteIterator: 具体迭代器
Aggregate: 抽象聚合类
ConcreteAggregate: 具体聚合...
分类:
其他好文 时间:
2014-11-19 01:28:50
阅读次数:
164
获取手机通讯录是Android最常用的小功能,今天自学到了,记下来,主要是通过系统自带的内容提供者提供的数据,我们使用内容接收者获取相应的数据到cursor中,然后获取对应data表中的字段,相关字段代表什么含义,只能自己去查了。
下面是手机通讯录列表的代码,仅供参考:
package com.andy.phonecontact;
import java.util.ArrayList;
im...
分类:
移动开发 时间:
2014-11-19 01:07:50
阅读次数:
199
Lambda表达式的语法格式:参数列表 => 语句或语句块“Lambda表达式”是委托的实现方法,所以必须遵循以下规则:1)“Lambda表达式”的参数数量必须和“委托”的参数数量相同;2)如果“委托”的参数中包括有ref或out修饰符,则“Lambda表达式”的参数列中也必须包括有修饰符;3)如果...
分类:
其他好文 时间:
2014-11-18 23:53:05
阅读次数:
277
//实现类似QQ停靠桌面上边缘隐藏的效果! private void timer1_Tick(object sender, EventArgs e) { System.Drawing.Point pp = new Point(Cursor.Posi...
1 .ui-datepicker-trigger{ 2 background-position-x:-32px; 3 background-position-y:-176px; 4 height:30px;width:34px; 5 cursor:pointer; ...
分类:
Web程序 时间:
2014-11-18 23:12:03
阅读次数:
230
Event类是所有事件类的基类/** * Base class of all kinds of events. */class Event : public Ref{public: enum class Type { TOUCH, KEYBOARD, ...
分类:
其他好文 时间:
2014-11-18 23:07:45
阅读次数:
180
//添加引用using System.Data;/// /// 导出数据到Excel /// /// 查询条件 /// /// public bool ExportOrderToExcel(string strWhere, ref string retur...
1 using System; 2 using System.Collections.Generic; 3 using System.Text; 4 using System.Data; 5 using System.Data.SqlClient; 6 using System.Ref...
分类:
数据库 时间:
2014-11-17 22:31:53
阅读次数:
361
create or replace procedure drop_all as cursor cur_obj is select uo.OBJECT_NAME, uo.OBJECT_TYPE from user_objects uo where uo.OBJECT_NAM...
分类:
数据库 时间:
2014-11-17 19:23:23
阅读次数:
276
1 declare @backup nvarchar(500) 2 declare @file nvarchar(500) 3 declare @DeleteFile nvarchar(500) 4 declare datebak cursor for 5 select [bak]='backup....
分类:
数据库 时间:
2014-11-17 17:20:10
阅读次数:
196