您好,登錄后才能下訂單哦!
小編給大家分享一下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.
變量動作對靜態(tài)定義的變量進行操作。變量必須是被活動定義或者是包含變量動作的結(jié)構(gòu)化活動節(jié)點定義的。
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輸出引腳的多重都兼容,但是不必相同。例如,建模者可以設(shè)定輸出引腳的多重都來支持多個參數(shù)值,哪怕變量只允許單值(這樣,建模得到的讀變量動作就不會受到變量多重度變化的影響)。
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輸入引腳上。作為要求,這個輸入引腳應(yīng)該和變量有相同的類型而且多重度為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為真,那么變量中已經(jīng)存在的值會在新值增加之前被移除,除非變量已經(jīng)包含新值。在這種情況下,新值不會受這個選項的影響而被移除。當動作結(jié)束的時候變量總是保有一個單獨的值,哪怕變量多重度的下限大于1。如果isReplaceAll為假而且變量是(值)無序和(值)唯一的,那么向變量增加一個已經(jīng)存在的值不會對變量產(chǎn)生影響。
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 current
number 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引腳,(那么)它的類型為無限自然數(shù),多重度為1..1。一個小于等于變量值數(shù)量的正整數(shù)類型的插入點意味著在已有值序列中插入新值,插入點為1意味著新值會被放在序列的第一個位置。插入點為無限值 (“*”)意味著在序列的最后插入值。0和大于已有變量值數(shù)的整數(shù)的插入點的意義沒有被定義。向(值)有序,(值)唯一的變量重新插入一個已經(jīng)存在的值的結(jié)果是將值移動到插入點(操縱可以產(chǎn)生效果是因為這樣的變量值是有序集合)。如果在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 to
remove 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。變量值會被(無條件)移除,哪怕結(jié)果會導(dǎo)致變量違反多重度下限。isRemoveDulicates選項表明是否從一個(值)非唯一的變量中移除所有的重復(fù)值。
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輸入引腳的位置決定的,它的類型為無限自然數(shù),多重度為1..1。一個小于等于參數(shù)值數(shù)量的正整數(shù)刪除位置意味著從已有值序列中刪除變量值。整數(shù)1表示序列中的第一個位置。0,大于參數(shù)值數(shù)量的整數(shù),無限("*")的語義未定義。
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。如果變量沒有變量值則動作對變量不產(chǎn)生影響。
看完了這篇文章,相信你對“EA畫UML活動圖中變量動作的示例分析”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。