本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}