UML之十字圆圈连线箭头符号“包含”C…
2017-04-21 10:50
1251 查看
在UML的类图里,这个一头带个十字圆圈(注意,不是带叉的圆圈)与连线组成的形式,表示内嵌。在实际编程代码中表示嵌在内部的类,通常用来表示突然在内部需要一个匿名类(如new
Thread()或者new Runnable()的情况)。
英文介绍如下(摘自http://www.holub.com/goodies/uml/):Nesting,
Inner Class.[/b]. Identifies nesting (containment) relationships in
all diagrams. In a class diagram: an "inner" class whose definition
is nested within the "outer" class definition. Typically puts the
inner class in the name space of the outer class, but may have
additional properties.
下面举个例子:
本图所对应的Java代码为:
对应的C++代码:
Thread()或者new Runnable()的情况)。
英文介绍如下(摘自http://www.holub.com/goodies/uml/):Nesting,
Inner Class.[/b]. Identifies nesting (containment) relationships in
all diagrams. In a class diagram: an "inner" class whose definition
is nested within the "outer" class definition. Typically puts the
inner class in the name space of the outer class, but may have
additional properties.
下面举个例子:
本图所对应的Java代码为:
public class SimpleClass { private Integer num = 3; private Boolean isGood; public Boolean isGoodEnough(Integer goodrange) { return null; } public Integer getNum() { return null; } public class InnerClass { private Integer coolNum; public Integer getCoolNum() { return null; } } } |
#ifndef SIMPLECLASS_H_H #define SIMPLECLASS_H_H class SimpleClass{ public: class InnerClass{ public: Integer getCoolNum( ); private: Integer coolNum; }; Integer getNum( ); Boolean isGoodEnough( Integer goodrange ); private: Boolean isGood; Integer num; }; #endif |
#include "SimpleClass.h" Integer SimpleClass::InnerClass::getCoolNum( ){ } Boolean SimpleClass::isGoodEnough( Integer goodrange ){ } Integer SimpleClass::getNum( ){ } |
相关文章推荐
- 关于UML箭头符号的意义!
- MathJax 支持的 Latex 符号总结(各种箭头符号)
- 在传参时,url参数中包含+、空格、=、%、&、#等特殊符号的处理
- 解决URL路径包含+等特殊符号,编码也无效的办法
- Mac 快捷键符号 斜箭头
- UML元素和UML关系图符号简介
- latex 集合相关符号:实数集,整数集,并,包含
- UML中箭头的含义
- UML符号含义
- UML用例图之泛化(generalization)、扩展(extend)和包含(include)关系--UML一波流系列讲解
- 判断一无符号整数的二进制形式中是否包含偶数个1
- MOS管符号箭头指向问题
- UML符号解释及相互关系
- UML图 符号的含义
- 关于 请求参数 传递时 参数字符串里面包含 特殊符号的 解决~
- UITextField 计算输入的字符个数(包含中英文数字特殊符号)
- css小技巧,如何制作一个箭头符号
- UML设计中的箭头详解
- UML用例图中包含(include)、扩展(extend)和泛化(generalization)三种关系详解
- UML中一些符号的意义, 写出来加强记忆