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


Java DbIterator.close方法代码示例

本文整理汇总了Java中nxt.db.DbIterator.close方法的典型用法代码示例。如果您正苦于以下问题:Java DbIterator.close方法的具体用法?Java DbIterator.close怎么用?Java DbIterator.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nxt.db.DbIterator的用法示例。


在下文中一共展示了DbIterator.close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processRequest

import nxt.db.DbIterator; //导入方法依赖的package包/类
@Override
JSONStreamAware processRequest(HttpServletRequest req) throws ParameterException {

    long accountId = ParameterParser.getAccount(req).getId();
    long assetId = 0;
    try {
        assetId = Convert.parseUnsignedLong(req.getParameter("asset"));
    } catch (RuntimeException e) {
        // ignore
    }
    int firstIndex = ParameterParser.getFirstIndex(req);
    int lastIndex = ParameterParser.getLastIndex(req);

    DbIterator<Order.Bid> bidOrders;
    if (assetId == 0) {
        bidOrders = Order.Bid.getBidOrdersByAccount(accountId, firstIndex, lastIndex);
    } else {
        bidOrders = Order.Bid.getBidOrdersByAccountAsset(accountId, assetId, firstIndex, lastIndex);
    }
    JSONArray orderIds = new JSONArray();
    try {
        while (bidOrders.hasNext()) {
            orderIds.add(Convert.toUnsignedLong(bidOrders.next().getId()));
        }
    } finally {
        bidOrders.close();
    }
    JSONObject response = new JSONObject();
    response.put("bidOrderIds", orderIds);
    return response;
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:32,代码来源:GetAccountCurrentBidOrderIds.java

示例2: processRequest

import nxt.db.DbIterator; //导入方法依赖的package包/类
@Override
JSONStreamAware processRequest(HttpServletRequest req) throws NxtException {

    long accountId = ParameterParser.getAccount(req).getId();
    long assetId = 0;
    try {
        assetId = Convert.parseUnsignedLong(req.getParameter("asset"));
    } catch (RuntimeException e) {
        // ignore
    }
    int firstIndex = ParameterParser.getFirstIndex(req);
    int lastIndex = ParameterParser.getLastIndex(req);

    DbIterator<Order.Ask> askOrders;
    if (assetId == 0) {
        askOrders = Order.Ask.getAskOrdersByAccount(accountId, firstIndex, lastIndex);
    } else {
        askOrders = Order.Ask.getAskOrdersByAccountAsset(accountId, assetId, firstIndex, lastIndex);
    }
    JSONArray orders = new JSONArray();
    try {
        while (askOrders.hasNext()) {
            orders.add(JSONData.askOrder(askOrders.next()));
        }
    } finally {
        askOrders.close();
    }
    JSONObject response = new JSONObject();
    response.put("askOrders", orders);
    return response;
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:32,代码来源:GetAccountCurrentAskOrders.java

示例3: processRequest

import nxt.db.DbIterator; //导入方法依赖的package包/类
@Override
JSONStreamAware processRequest(HttpServletRequest req) throws ParameterException {

    long accountId = ParameterParser.getAccount(req).getId();
    long assetId = 0;
    try {
        assetId = Convert.parseUnsignedLong(req.getParameter("asset"));
    } catch (RuntimeException e) {
        // ignore
    }
    int firstIndex = ParameterParser.getFirstIndex(req);
    int lastIndex = ParameterParser.getLastIndex(req);

    DbIterator<Order.Bid> bidOrders;
    if (assetId == 0) {
        bidOrders = Order.Bid.getBidOrdersByAccount(accountId, firstIndex, lastIndex);
    } else {
        bidOrders = Order.Bid.getBidOrdersByAccountAsset(accountId, assetId, firstIndex, lastIndex);
    }
    JSONArray orders = new JSONArray();
    try {
        while (bidOrders.hasNext()) {
            orders.add(JSONData.bidOrder(bidOrders.next()));
        }
    } finally {
        bidOrders.close();
    }
    JSONObject response = new JSONObject();
    response.put("bidOrders", orders);
    return response;
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:32,代码来源:GetAccountCurrentBidOrders.java

示例4: processRequest

import nxt.db.DbIterator; //导入方法依赖的package包/类
@Override
JSONStreamAware processRequest(HttpServletRequest req) throws NxtException {

    long accountId = ParameterParser.getAccount(req).getId();
    long assetId = 0;
    try {
        assetId = Convert.parseUnsignedLong(req.getParameter("asset"));
    } catch (RuntimeException e) {
        // ignore
    }
    int firstIndex = ParameterParser.getFirstIndex(req);
    int lastIndex = ParameterParser.getLastIndex(req);

    DbIterator<Order.Ask> askOrders;
    if (assetId == 0) {
        askOrders = Order.Ask.getAskOrdersByAccount(accountId, firstIndex, lastIndex);
    } else {
        askOrders = Order.Ask.getAskOrdersByAccountAsset(accountId, assetId, firstIndex, lastIndex);
    }
    JSONArray orderIds = new JSONArray();
    try {
        while (askOrders.hasNext()) {
            orderIds.add(Convert.toUnsignedLong(askOrders.next().getId()));
        }
    } finally {
        askOrders.close();
    }
    JSONObject response = new JSONObject();
    response.put("askOrderIds", orderIds);
    return response;
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:32,代码来源:GetAccountCurrentAskOrderIds.java


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