blob: 1319e36888d5776a9d3723c53e5102a6c42b83ab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/*****************************************************************************
* Copyright (c) 2012 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.moka.fuml.standardlibrary.library.list;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.papyrus.moka.fuml.Semantics.Classes.Kernel.Value;
import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.OpaqueBehaviorExecution;
import org.eclipse.papyrus.moka.fuml.Semantics.CommonBehaviors.BasicBehaviors.ParameterValue;
import org.eclipse.papyrus.moka.fuml.debug.Debug;
public class ListConcat extends OpaqueBehaviorExecution {
@Override
public void doBody(List<ParameterValue> inputParameters, List<ParameterValue> outputParameters) {
try {
List<Value> list1 = inputParameters.get(0).values;
List<Value> list2 = inputParameters.get(1).values;
List<Value> result = new ArrayList<Value>();
result.addAll(list1) ;
result.addAll(list2) ;
outputParameters.get(0).values = result;
} catch (Exception e) {
Debug.println("An error occured during the execution of ListConcat " + e.getMessage());
}
}
@Override
public Value new_() {
return new ListConcat();
}
}
|