本文整理匯總了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);
}