当前位置: 首页 > news >正文

申报课题所需的网站怎么做wordpress返回顶部图标

申报课题所需的网站怎么做,wordpress返回顶部图标,第三方公司做网站价格,天津网站建设信息科技有限公司文章目录 1. 概念1.1 角色1.2 类图 2. 代码示例2.1 需求2.2 代码2.3 类图 1. 概念 迭代器#xff08;Iterator#xff09;能够在不暴露聚合体内部表示的情况下#xff0c;向客户端提供遍历聚合元素的方法。 1.1 角色 InterfaceAggregate#xff08;抽象聚合#xff09;… 文章目录 1. 概念1.1 角色1.2 类图 2. 代码示例2.1 需求2.2 代码2.3 类图 1. 概念 迭代器Iterator能够在不暴露聚合体内部表示的情况下向客户端提供遍历聚合元素的方法。 1.1 角色 InterfaceAggregate抽象聚合定义存储、添加、删除聚合元素以及创建迭代器对象的接口ConcreteAggregate具体聚合实现抽象聚合类。它的方法可以返回一个具体迭代器的实例Iterator抽象迭代器定义访问和遍历聚合元素的接口通常包含 hasNext()、next() 等方法Concretelterator具体迭代器实现抽象迭代器接口中所定义的方法完成对聚合对象的遍历记录遍历的当前位置。 1.2 类图 #mermaid-svg-80tUvmPRCgZrLjMc {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-80tUvmPRCgZrLjMc .error-icon{fill:#552222;}#mermaid-svg-80tUvmPRCgZrLjMc .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-80tUvmPRCgZrLjMc .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-80tUvmPRCgZrLjMc .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-80tUvmPRCgZrLjMc .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-80tUvmPRCgZrLjMc .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-80tUvmPRCgZrLjMc .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-80tUvmPRCgZrLjMc .marker{fill:#333333;stroke:#333333;}#mermaid-svg-80tUvmPRCgZrLjMc .marker.cross{stroke:#333333;}#mermaid-svg-80tUvmPRCgZrLjMc svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-80tUvmPRCgZrLjMc g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-80tUvmPRCgZrLjMc g.classGroup text .title{font-weight:bolder;}#mermaid-svg-80tUvmPRCgZrLjMc .nodeLabel,#mermaid-svg-80tUvmPRCgZrLjMc .edgeLabel{color:#131300;}#mermaid-svg-80tUvmPRCgZrLjMc .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-80tUvmPRCgZrLjMc .label text{fill:#131300;}#mermaid-svg-80tUvmPRCgZrLjMc .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-80tUvmPRCgZrLjMc .classTitle{font-weight:bolder;}#mermaid-svg-80tUvmPRCgZrLjMc .node rect,#mermaid-svg-80tUvmPRCgZrLjMc .node circle,#mermaid-svg-80tUvmPRCgZrLjMc .node ellipse,#mermaid-svg-80tUvmPRCgZrLjMc .node polygon,#mermaid-svg-80tUvmPRCgZrLjMc .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-80tUvmPRCgZrLjMc .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-80tUvmPRCgZrLjMc g.clickable{cursor:pointer;}#mermaid-svg-80tUvmPRCgZrLjMc g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-80tUvmPRCgZrLjMc g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-80tUvmPRCgZrLjMc .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-80tUvmPRCgZrLjMc .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-80tUvmPRCgZrLjMc .dashed-line{stroke-dasharray:3;}#mermaid-svg-80tUvmPRCgZrLjMc #compositionStart,#mermaid-svg-80tUvmPRCgZrLjMc .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc #compositionEnd,#mermaid-svg-80tUvmPRCgZrLjMc .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc #dependencyStart,#mermaid-svg-80tUvmPRCgZrLjMc .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc #dependencyStart,#mermaid-svg-80tUvmPRCgZrLjMc .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc #extensionStart,#mermaid-svg-80tUvmPRCgZrLjMc .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc #extensionEnd,#mermaid-svg-80tUvmPRCgZrLjMc .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc #aggregationStart,#mermaid-svg-80tUvmPRCgZrLjMc .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc #aggregationEnd,#mermaid-svg-80tUvmPRCgZrLjMc .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-80tUvmPRCgZrLjMc .edgeTerminals{font-size:11px;}#mermaid-svg-80tUvmPRCgZrLjMc :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Client «interface» Iterator HasNext() : bool First() IsDone() Next() : interface CurrentItem() «interface» Aggregate CreateIterator() : Iterator ConcreteIterator HasNext() : bool First() IsDone() Next() : interface CurrentItem() ConcreteAggregate CreateIterator() : Iterator 2. 代码示例 2.1 需求 实例化一个具体聚合创建一个迭代器实例用迭代器遍历这个聚合。 迭代器通常还会有查看首元素、尾元素、指针位置等方法有兴趣可以自己试一下这个简单示例里不写了。 2.2 代码 代码 package mainimport fmt// 定义抽象迭代器 type Iterator interface {HasNext() boolNext() interface{} }// 定义具体迭代器 type ConcreteIterator struct {//它关联具体聚合aggregate *ConcreteAggregateindex int }// 定义方法查看迭代是否结束 func (i *ConcreteIterator) HasNext() bool {return i.index len(i.aggregate.items) }// 定义方法返回下一个节点 func (i *ConcreteIterator) Next() interface{} {if i.HasNext() {item : i.aggregate.items[i.index]i.indexreturn item}return nil }// 定义抽象聚合 type Aggregate interface {CreateIterator() IteratorAddItem(item interface{}) }// 定义具体聚合 type ConcreteAggregate struct {items []interface{} }// 定义方法创建迭代器 func (a *ConcreteAggregate) CreateIterator() Iterator {return ConcreteIterator{aggregate: a} }// 定义方法添加item为了测试方便和迭代器方法无关 func (a *ConcreteAggregate) AddItem(item interface{}) {a.items append(a.items, item) }func main() {//实例化一个聚合加入三个Item他们的类型可以不同var aggregate Aggregateaggregate ConcreteAggregate{}aggregate.AddItem(Item 1)aggregate.AddItem(2)aggregate.AddItem(Item 3)//实例化一个迭代器iterator : aggregate.CreateIterator()//验证结果for iterator.HasNext() {item : iterator.Next()fmt.Println(item)} }输出 Item 1 2 Item 32.3 类图 #mermaid-svg-gvVKNcs2TFexEK71 {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-gvVKNcs2TFexEK71 .error-icon{fill:#552222;}#mermaid-svg-gvVKNcs2TFexEK71 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-gvVKNcs2TFexEK71 .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-gvVKNcs2TFexEK71 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-gvVKNcs2TFexEK71 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-gvVKNcs2TFexEK71 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-gvVKNcs2TFexEK71 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-gvVKNcs2TFexEK71 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-gvVKNcs2TFexEK71 .marker.cross{stroke:#333333;}#mermaid-svg-gvVKNcs2TFexEK71 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-gvVKNcs2TFexEK71 g.classGroup text{fill:#9370DB;fill:#131300;stroke:none;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:10px;}#mermaid-svg-gvVKNcs2TFexEK71 g.classGroup text .title{font-weight:bolder;}#mermaid-svg-gvVKNcs2TFexEK71 .nodeLabel,#mermaid-svg-gvVKNcs2TFexEK71 .edgeLabel{color:#131300;}#mermaid-svg-gvVKNcs2TFexEK71 .edgeLabel .label rect{fill:#ECECFF;}#mermaid-svg-gvVKNcs2TFexEK71 .label text{fill:#131300;}#mermaid-svg-gvVKNcs2TFexEK71 .edgeLabel .label span{background:#ECECFF;}#mermaid-svg-gvVKNcs2TFexEK71 .classTitle{font-weight:bolder;}#mermaid-svg-gvVKNcs2TFexEK71 .node rect,#mermaid-svg-gvVKNcs2TFexEK71 .node circle,#mermaid-svg-gvVKNcs2TFexEK71 .node ellipse,#mermaid-svg-gvVKNcs2TFexEK71 .node polygon,#mermaid-svg-gvVKNcs2TFexEK71 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-gvVKNcs2TFexEK71 .divider{stroke:#9370DB;stroke:1;}#mermaid-svg-gvVKNcs2TFexEK71 g.clickable{cursor:pointer;}#mermaid-svg-gvVKNcs2TFexEK71 g.classGroup rect{fill:#ECECFF;stroke:#9370DB;}#mermaid-svg-gvVKNcs2TFexEK71 g.classGroup line{stroke:#9370DB;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5;}#mermaid-svg-gvVKNcs2TFexEK71 .classLabel .label{fill:#9370DB;font-size:10px;}#mermaid-svg-gvVKNcs2TFexEK71 .relation{stroke:#333333;stroke-width:1;fill:none;}#mermaid-svg-gvVKNcs2TFexEK71 .dashed-line{stroke-dasharray:3;}#mermaid-svg-gvVKNcs2TFexEK71 #compositionStart,#mermaid-svg-gvVKNcs2TFexEK71 .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 #compositionEnd,#mermaid-svg-gvVKNcs2TFexEK71 .composition{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 #dependencyStart,#mermaid-svg-gvVKNcs2TFexEK71 .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 #dependencyStart,#mermaid-svg-gvVKNcs2TFexEK71 .dependency{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 #extensionStart,#mermaid-svg-gvVKNcs2TFexEK71 .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 #extensionEnd,#mermaid-svg-gvVKNcs2TFexEK71 .extension{fill:#333333!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 #aggregationStart,#mermaid-svg-gvVKNcs2TFexEK71 .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 #aggregationEnd,#mermaid-svg-gvVKNcs2TFexEK71 .aggregation{fill:#ECECFF!important;stroke:#333333!important;stroke-width:1;}#mermaid-svg-gvVKNcs2TFexEK71 .edgeTerminals{font-size:11px;}#mermaid-svg-gvVKNcs2TFexEK71 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} Client «interface» Iterator HasNext() : bool Next() : interface «interface» Aggregate CreateIterator() : Iterator AddItem(item:interface) ConcreteIterator *ConcreteAggregate aggregate Int index HasNext() : bool Next() : interface ConcreteAggregate []interface items CreateIterator() : Iterator GetItem(index int) : interface AddItem(item interface)
http://www.hkea.cn/news/14497897/

相关文章:

  • 扬州工程建设信息 网站广州微网站建设信息
  • pageadmin仿站教程网站建设总体需求分析
  • 企业网站制作怎么做大冶市城乡建设局网站
  • 哪家公司做企业网站稳定优惠app的后台和网站的后台差别
  • 做一个学校网站怎么做成都装饰公司前十强是哪几个
  • 宿迁做网站大公司达令的网站建设
  • 怎么建立自己的个人网站php网站开发程序
  • 百度网站排名 查询wordpress inc文件夹
  • 网站管理员登陆不了竞价托管网站建设
  • 网站建设与管理心得体会100个免费推广网站下载
  • 店名注册查询关键词排名优化顾问
  • 网站导航栏下拉菜单国家专业分类目录
  • 的网站制作设计网页的心得体会
  • 苏州手机网站建设服务推荐家居企业网站建设
  • 张家界旅游网站精品网站建设费用 磐石网络
  • 网站升级维护需要多久wordpress 图片旋转代码
  • 济南网站建设方案详细wordpress 获取分类描述
  • 项目商业网站建设方案网站建设课件
  • 移动网站建设服务商怎么在百度推广
  • 网站建设可行性分析报告模板校园网站建设意见
  • 创建网站容易吗设计网装修
  • 网上做代卖的网站网站如何做视频教程
  • 北京欢迎你网站建设17.zwd一起做网站池尾站
  • 微信网站后期运营怎么做我要学电脑哪里有短期培训班
  • 网站建设前端需要看什么书设计logo怎么设计
  • 漳州市网站建设费用wordpress分类产品
  • 天津网站建设座机号定制网络教研系统
  • 网站换代理深圳网站建设最专业的
  • 动态链接做网站外链图免费网站模板制作
  • 网站后台管理图片水印怎么做手游做网站推广应该怎么做