java setvalue函数,Java IDecisionVariable.setValue方法代碼示例
import net.ssehub.easy.varModel.confModel.IDecisionVariable; //導入方法依賴的package包/類
/**
* Sets a reference value on slotName
of var
, e.g., for initializing a configuration
* appropriately.
*
* @param var the variable to modify
* @param slotName the slot name within var
to modify
* @param availableSlotName the name of the slot in var
containing valid resources
* @param elementName the name of the element to select, else the first value in availableSlotName
* shall be taken
*/
protected void setReference(IDecisionVariable var, String slotName, String availableSlotName,
String elementName) {
try {
IDecisionVariable slot = var.getNestedElement(slotName);
IDecisionVariable availables = var.getNestedElement(availableSlotName);
Value value = null;
if (null != slot && null != availables) {
if (null == elementName) {
if (availables.getNestedElementsCount() > 0) {
value = availables.getNestedElement(0).getValue();
}
} else {
for (int n = 0; null == value && n < availables.getNestedElementsCount(); n++) {
IDecisionVariable nested = availables.getNestedElement(n);
IDecisionVariable deref = Configuration.dereference(nested);
if (elementName.equals(VariableHelper.getName(deref))) {
value = nested.getValue(); // yes, nested - take the reference
}
}
}
}
if (null != value) {
slot.setValue(value, AssignmentState.ASSIGNED);
} else {
Assert.fail("cannot set value '" + elementName + "' for " + slotName
+ " as related variable does not exist");
}
} catch (ConfigurationException e) {
Assert.fail("cannot set value for " + slotName + ": " + e.getMessage());
}
}
java setvalue函数,Java IDecisionVariable.setValue方法代碼示例相关推荐
- java版本的getorcreate_Java ContainerUtil.getOrCreate方法代碼示例
本文整理匯總了Java中com.intellij.util.containers.ContainerUtil.getOrCreate方法的典型用法代碼示例.如果您正苦於以下問題:Java Contai ...
- java document to xml_Java Document.asXML方法代碼示例
本文整理匯總了Java中org.dom4j.Document.asXML方法的典型用法代碼示例.如果您正苦於以下問題:Java Document.asXML方法的具體用法?Java Document. ...
- python unescape函数_Python escape.url_unescape方法代碼示例
本文整理匯總了Python中tornado.escape.url_unescape方法的典型用法代碼示例.如果您正苦於以下問題:Python escape.url_unescape方法的具體用法?Py ...
- python linspace函数_Python torch.linspace方法代碼示例
本文整理匯總了Python中torch.linspace方法的典型用法代碼示例.如果您正苦於以下問題:Python torch.linspace方法的具體用法?Python torch.linspac ...
- java getchildren用法_Java ZkClient.getChildren方法代碼示例
import org.apache.helix.manager.zk.ZkClient; //導入方法依賴的package包/類 private static void zkCopy(ZkClient ...
- java text to speech_Java TextToSpeech.speak方法代碼示例
import android.speech.tts.TextToSpeech; //導入方法依賴的package包/類 @Override protected void onCreate(Bundle ...
- java drawrect负数_Java Graphics.drawRect方法代碼示例
import javax.microedition.lcdui.Graphics; //導入方法依賴的package包/類 /** * Draws the item. * * @param g Gra ...
- java中setid(),Java Process.setId方法代碼示例
本文整理匯總了Java中org.activiti.bpmn.model.Process.setId方法的典型用法代碼示例.如果您正苦於以下問題:Java Process.setId方法的具體用法?Ja ...
- java getselecteditem_Java JComboBox.getSelectedItem方法代碼示例
本文整理匯總了Java中javax.swing.JComboBox.getSelectedItem方法的典型用法代碼示例.如果您正苦於以下問題:Java JComboBox.getSelectedIt ...
- java中elements_Java Element.elements方法代碼示例
本文整理匯總了Java中org.dom4j.Element.elements方法的典型用法代碼示例.如果您正苦於以下問題:Java Element.elements方法的具體用法?Java Eleme ...
最新文章
- mysql定义条件和处理_MySQL定义条件和处理程序
- unittest 框架学习
- 从白盒测试到单元测试基础原理
- 零基础可以学python吗-Python编程语言好学吗?零基础转行能学Python吗?
- oracle 主键自增函数_oracle 实现主键自增
- 学Python可以用来干什么?就业情况究竟怎么样?
- 使用Web API和React创建用户注册和登录
- MongoDB - 分片管理
- java正向最大匹配算法_java中文分词之正向最大匹配法实例代码
- mySql 修改字段自增
- STK Component Insight3D控件-WPF方式
- Unity3D开发:向Unity3D中导入外部模型
- 阿里云达摩院视觉AI介绍
- 李沐动手学深度学习第四章-4.9.环境和分布偏移
- 《数据结构》实验报告二:顺序表 链表
- java 中的poi_Java中使用POI操作ExceL的读与
- 安装npm时报-4048错误的解决方案
- 023递归:这帮小兔崽子
- 批量修改txt(或其他)文件编码为utf-8
- 图像增强实例操作(含matlab代码)