当前位置: 首页>>代码示例>>Java>>正文


Java OptInputParameterType.TA_OptInput_IntegerList方法代码示例

本文整理汇总了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);
}
 
开发者ID:BYVoid,项目名称:TA-Lib,代码行数:31,代码来源:CoreMetaData.java

示例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
); }
 
开发者ID:BYVoid,项目名称:TA-Lib,代码行数:68,代码来源:CoreAnnotated.java


注:本文中的com.tictactec.ta.lib.meta.annotation.OptInputParameterType.TA_OptInput_IntegerList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。