ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 组件源码 ``` /** * <b>方法描述:</b> 集合删除(下标) <br/> * <b>创建者:</b> admin <br/> * <b>创建时间:</b> 2018-05-11 11:52:06 <br/> * * @param c * 入参|集合|{@link java.util.Collection} * @param index * 入参|下标|{@link int} * @return 0 失败<br/> * 1 成功<br/> */ @Component(label = "集合删除(下标)", style = "判断型", type = "同步组件", comment = "只支持List集合通过下标删除", version = "1.0.0", deprecated = false, author = "admin", date = "2018-05-11 11:52:06") @InParams(param = { @Param(name = "c", comment = "集合", type = java.util.Collection.class), @Param(name = "index", comment = "下标", type = int.class) }) @Returns(returns = { @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) public static ResultBase P_removeIndex(Collection c, int index) { if (c == null) return ResultBase.newFailureResult("TPTC1004", "组件参数输入错误,集合为Null"); if (c.isEmpty() || c.size() <= index) return ResultBase.newFailureResult("TPTC1004", "集合下标越界,size=" + c.size() + ",输入index=" + index); if (!(c instanceof List)) { return ResultBase.newFailureResult("TPTC1005", "非List集合不能下标删除"); } List list = (List) c; list.remove(index); return ResultBase.newSuccessResult(); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/c7/ba/c7bae4d95b441870d50d4ae6a8e3a58b_1867x882.png) # 参数说明及示例 ## 入口参数 集合:传入一个非空集合,示例: `__REQ__["list"]` 下标:传入一个数字,示例: `__REQ__["index"]` > 注意:IDE 中集合和数组都以 [] 表示。