本文整理汇总了Java中com.tictactec.ta.lib.meta.annotation.OptInputParameterType.TA_OptInput_IntegerList方法的典型用法代码示例。如果您正苦于以下问题:Java OptInputParameterType.TA_OptInput_IntegerList方法的具体用法?Java OptInputParameterType.TA_OptInput_IntegerList怎么用?Java OptInputParameterType.TA_OptInput_IntegerList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tictactec.ta.lib.meta.annotation.OptInputParameterType
的用法示例。
在下文中一共展示了OptInputParameterType.TA_OptInput_IntegerList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOptInputParamInteger
import com.tictactec.ta.lib.meta.annotation.OptInputParameterType; //导入方法依赖的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: movingAverage
import com.tictactec.ta.lib.meta.annotation.OptInputParameterType; //导入方法依赖的package包/类
@FuncInfo(
name = "MA",
group = "Overlap Studies",
flags = 16777216,
nbInput = 1,
nbOptInput = 2,
nbOutput = 1
)
public RetCode movingAverage(
int startIdx,
int endIdx,
@InputParameterInfo(
paramName = "inReal",
flags = 0,
type = InputParameterType.TA_Input_Real
)
double inReal[],
@OptInputParameterInfo(
paramName = "optInTimePeriod",
displayName = "Time Period",
flags = 0,
type = OptInputParameterType.TA_OptInput_IntegerRange,
dataSet = com.tictactec.ta.lib.meta.annotation.IntegerRange.class
)
@IntegerRange(
paramName = "optInTimePeriod",
defaultValue = 30,
min = 1,
max = 100000,
suggested_start = 1,
suggested_end = 200,
suggested_increment = 1
)
int optInTimePeriod,
@OptInputParameterInfo(
paramName = "optInMAType",
displayName = "MA Type",
flags = 0,
type = OptInputParameterType.TA_OptInput_IntegerList,
dataSet = com.tictactec.ta.lib.meta.annotation.IntegerList.class
)
@IntegerList(
paramName = "optInMAType",
defaultValue = 0,
value = { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
string = { "SMA", "EMA", "WMA", "DEMA", "TEMA", "TRIMA", "KAMA", "MAMA", "T3" }
)
MAType optInMAType,
MInteger outBegIdx,
MInteger outNBElement,
@OutputParameterInfo(
paramName = "outReal",
flags = 1,
type = OutputParameterType.TA_Output_Real
)
double outReal[]
) {
return super.movingAverage (
startIdx,
endIdx,
inReal,
optInTimePeriod,
optInMAType,
outBegIdx,
outNBElement,
outReal
); }