本文整理汇总了Java中com.tictactec.ta.lib.meta.annotation.OptInputParameterInfo.type方法的典型用法代码示例。如果您正苦于以下问题:Java OptInputParameterInfo.type方法的具体用法?Java OptInputParameterInfo.type怎么用?Java OptInputParameterInfo.type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tictactec.ta.lib.meta.annotation.OptInputParameterInfo
的用法示例。
在下文中一共展示了OptInputParameterInfo.type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOptInputParamInteger
import com.tictactec.ta.lib.meta.annotation.OptInputParameterInfo; //导入方法依赖的package包/类
/**
* Assigns an <b>int</b> value to an optional input parameter
* which is expected to be assignment compatible to <b>int</b>.
*
* @param paramIndex is the n-th optional input parameter
* @param value is the <b>int</b> value
* @throws IllegalArgumentException
*/
public void setOptInputParamInteger(final int paramIndex, final int value) throws IllegalArgumentException {
OptInputParameterInfo param = getOptInputParameterInfo(paramIndex);
if (param==null) throw new InternalError(CONTACT_DEVELOPERS);
if (param.type()==OptInputParameterType.TA_OptInput_IntegerList) {
IntegerList list = getOptInputIntegerList(paramIndex);
for (int entry : list.value()) {
if (value==entry) {
if (callOptInputParams==null) callOptInputParams = new Object[getFuncInfo().nbOptInput()];
callOptInputParams[paramIndex] = value;
return;
}
}
} else if (param.type()==OptInputParameterType.TA_OptInput_IntegerRange) {
IntegerRange range = getOptInputIntegerRange(paramIndex);
if ((value >= range.min())&&(value <= range.max())) {
if (callOptInputParams==null) callOptInputParams = new Object[getFuncInfo().nbOptInput()];
callOptInputParams[paramIndex] = value;
return;
}
}
throw new InternalError(CONTACT_DEVELOPERS);
}
示例2: setOptInputParamReal
import com.tictactec.ta.lib.meta.annotation.OptInputParameterInfo; //导入方法依赖的package包/类
/**
* Assigns an <b>double</b> value to an optional input parameter
* which is expected to be assignment compatible to <b>double</b>.
*
* @param paramIndex is the n-th optional input parameter
* @param value is the <b>double</b> value
* @throws IllegalArgumentException
*/
public void setOptInputParamReal(final int paramIndex, final double value) throws IllegalArgumentException {
OptInputParameterInfo param = getOptInputParameterInfo(paramIndex);
if (param.type()==OptInputParameterType.TA_OptInput_RealList) {
RealList list = getOptInputRealList(paramIndex);
for (double entry : list.value()) {
if (value==entry) {
if (callOptInputParams==null) callOptInputParams = new Object[getFuncInfo().nbOptInput()];
callOptInputParams[paramIndex] = value;
return;
}
}
} else if (param.type()==OptInputParameterType.TA_OptInput_RealRange) {
RealRange range = getOptInputRealRange(paramIndex);
if ((value >= range.min())&&(value <= range.max())) {
if (callOptInputParams==null) callOptInputParams = new Object[getFuncInfo().nbOptInput()];
callOptInputParams[paramIndex] = value;
return;
}
}
throw new InternalError(CONTACT_DEVELOPERS);
}