EA画UML活动图中变量动作的示例分析

免费建站   2024年05月10日 7:09  

小编给大家分享一下EA画UML活动图中变量动作的示例分析,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

16.9.1 Summary(概要)

VariableActions support the reading and writing of Variables.

变量动作支持变量的读写操作。

16.9.2 Abstract Syntax(抽象语法)

16.9.3 Semantics(语义)

16.9.3.1 Variable Action(变量动作)

A VariableAction operates on a statically-specified Variable. The Variable must be one that is defined either by an Activity (see sub clause 15.2) or a StructuredActivityNode (see sub clause 16.11) containing the VariableAction.

变量动作对静态定义的变量进行操作。变量必须是被活动定义或者是包含变量动作的结构化活动节点定义的。

16.9.3.2 Read Variable Actions(读变量动作)

A ReadVariableAction is a VariableAction that retrieves the values of a Variable and places them on its result OutputPin.If the Variable is ordered, then the values are placed on the OutputPin in order. If there are no retrieved values (that is,the Variable is empty), then a ReadVariableAction produces a single null token on its result OutputPin.

读变量动作取得变量的值并将其放置到result输出引脚。如果变量是有序的,那么值也会被有序地放置到输出引脚。如果没有可以取得的值(也就是变量为空),那么读变量动作在输出引脚上生成一个空令牌。

The type and ordering of the result OutputPin are the same as those of the Variable. The multiplicity of the Variable must be compatible with the multiplicity of the result OutputPin, but does not have to be the same. For example, the modeler can set the multiplicity of this OutputPin to support multiple values even when the Variable only allows a single value (this way, the ReadVariableAction as modeled will be unaffected by changes in the multiplicity of the Variable).

result输出引脚的类型/顺序和变量的类型/顺序一致。变量的多重度必须和result输出引脚的多重都兼容,但是不必相同。例如,建模者可以设定输出引脚的多重都来支持多个参数值,哪怕变量只允许单值(这样,建模得到的读变量动作就不会受到变量多重度变化的影响)。

16.9.3.3 Add Variable Value Action(增加变量值动作)

An AddVariableValueAction is a VariableAction for adding a value to a Variable. The value to be added is given on the value InputPin, which is required. This InputPin has the same type as the Variable and a multiplicity of 1..1 (that is, a single value is added).

增加变量值动作向变量增加一个值。将要增加的值被放置到value输入引脚上。作为要求,这个输入引脚应该和变量有相同的类型而且多重度为1..1(也就是说,增加的是一个值)。

If isReplaceAll is true, then the existing values of the Variable are removed before the new value is added, except if the Variable already contains the new value, in which case it is not removed under this option. The Variable always has a single value when the Action completes, even if the lower multiplicity of the Variable is greater than 1. If isReplaceAll is false and the Variable is unordered and unique, then adding a value that is already contained in the Variable has no effect.

如果isReplaceAll为真,那么变量中已经存在的值会在新值增加之前被移除,除非变量已经包含新值。在这种情况下,新值不会受这个选项的影响而被移除。当动作结束的时候变量总是保有一个单独的值,哪怕变量多重度的下限大于1。如果isReplaceAll为假而且变量是(值)无序和(值)唯一的,那么向变量增加一个已经存在的值不会对变量产生影响。

Adding a value to an ordered Variable requires an insertion point for the new value using the insertAt InputPin, which is required for ordered Variable when isReplaceAll is false and omitted for unordered Variable (values of a Variable may be ordered or unordered, even if the multiplicity upper bound is 1.) If the insertAt InputPin is present, it has type UnlimitedNatural and multiplicity 1..1. An insertion point that is a positive integer less than or equal to the currentnumber of values means to insert the new value at that position in the sequence of existing values, with the integer 1 meaning the new value will be first in the sequence. A value of unlimited (“*”) for the insertion point means to insert the new value at the end of the sequence. The semantics are undefined for a value of 0 or an integer greater than the number of existing values. Reinserting an existing value at a new position in an ordered, unique Variable moves the value to that position (this works because such Variable values are ordered sets). The insertion point is ignored if it is used when isReplaceAll=true.

向一个有序变量增加值需要一个使用insertAt输入引脚提供的插入点。这个输入引脚在变量为有序变量且isReplaceAll为假时有效,变量为无序变量时被忽略。(变量的值可能是有序的或无序的,即使多重度上线为1。)如果存在insertAt引脚,(那么)它的类型为无限自然数,多重度为1..1。一个小于等于变量值数量的正整数类型的插入点意味着在已有值序列中插入新值,插入点为1意味着新值会被放在序列的第一个位置。插入点为无限值 (“*”)意味着在序列的最后插入值。0和大于已有变量值数的整数的插入点的意义没有被定义。向(值)有序,(值)唯一的变量重新插入一个已经存在的值的结果是将值移动到插入点(操纵可以产生效果是因为这样的变量值是有序集合)。如果在isReplaceAll为真的时候使用,插入点会被忽略。

The semantics are undefined for adding a value that violates the upper multiplicity of the Variable.

违反变量多重度的上限向变量增加值的语义没有被定义。

16.9.3.4 Remove Variable Value Actions(移除变量值动作)

A RemoveVariableValueAction is a VariableAction for removing a value from a Variable.

移除变量值动作移除某个变量的值。

The value to be removed is given on the value InputPin, which has the same type as the Variable and a multiplicity of 1..1. The value is removed even when this results in a violation of the lower multiplicity of the Variable. Attempting toremove a value that is not contained in the Variable has no effect. The isRemoveDuplicates option indicates whether to remove all duplicates of the specified value in non-unique Variables.

移除的值通过value输入引脚提供,它的类型和变量一样而且多重度为1..1。变量值会被(无条件)移除,哪怕结果会导致变量违反多重度下限。isRemoveDulicates选项表明是否从一个(值)非唯一的变量中移除所有的重复值。

If isRemoveDuplicates is false and the Variable is ordered and non-unique, then there is no value InputPin, and the value to be removed is specified by giving its position on the removeAt InputPin, which has type UnlimitedNatural and a multiplicity of 1..1. A removal position that is a positive integer less than or equal to the current number of values means to remove the value at that position in the sequence of existing values, with the integer 1 meaning the first value in the sequence. The semantics are undefined for 0, an integer greater than the number of existing values, and unlimited (“*”).

如果isRemoveDulicates为假,而且变量是(值)有序和(值)非唯一的,那么就不需要value输入引脚,这时将要被移除的值是通过来自removeAt输入引脚的位置决定的,它的类型为无限自然数,多重度为1..1。一个小于等于参数值数量的正整数删除位置意味着从已有值序列中删除变量值。整数1表示序列中的第一个位置。0,大于参数值数量的整数,无限("*")的语义未定义。

16.9.3.5 Clear Variable Actions(清除变量动作)

A ClearVariableAction is a VariableAction that removes all values of a Variable, even if the lower multiplicity of the Variable is greater than 0. The action has no effect if the Variable has no values.

清除变量动作移除变量的所有变量值,哪怕变量多重度的下限为0。如果变量没有变量值则动作对变量不产生影响。

看完了这篇文章,相信你对“EA画UML活动图中变量动作的示例分析”有了一定的了解,如果想了解更多相关知识,欢迎关注行业资讯频道,感谢各位的阅读!

域名注册
购买VPS主机

您或许对下面这些文章有兴趣:                    本月吐槽辛苦排行榜

看贴要回贴有N种理由!看帖不回贴的后果你懂得的!


评论内容 (*必填):
(Ctrl + Enter提交)   

部落快速搜索栏

各类专题梳理

网站导航栏

X
返回顶部