use of hry.trade.comparator.AscBigDecimalComparator in project benchmark by seelunzi.
the class TradeRedis method getMatchkeys.
/* */
/* */
public static List<BigDecimal> getMatchkeys(EntrustTrade exEntrust) {
/* 584 */
String key = getHeaderMatch(exEntrust);
/* 585 */
RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
/* 586 */
Set<String> keys = redisTradeService.noPerkeys(key + ":");
/* 587 */
if (null == keys) {
/* 588 */
return null;
/* */
}
/* 590 */
List<BigDecimal> list2 = new ArrayList();
/* 591 */
Iterator<String> iterator = keys.iterator();
/* 592 */
while (iterator.hasNext()) {
/* 593 */
String keystr = (String) iterator.next();
/* 594 */
BigDecimal ks = new BigDecimal(keystr.split(":")[2]);
/* 595 */
list2.add(ks);
/* */
}
/* 597 */
if (exEntrust.getType().equals(Integer.valueOf(1))) {
/* 598 */
Collections.sort(list2, new AscBigDecimalComparator());
/* */
} else {
/* 600 */
Collections.sort(list2, new DescBigDecimalComparator());
/* */
}
/* 602 */
return list2;
/* */
}
use of hry.trade.comparator.AscBigDecimalComparator in project benchmark by seelunzi.
the class TradeRedis method getSelfkeys.
/* */
/* */
public static List<BigDecimal> getSelfkeys(EntrustTrade exEntrust) {
/* 562 */
String key = getHeader(exEntrust);
/* 563 */
RedisTradeService redisTradeService = (RedisTradeService) ContextUtil.getBean("redisTradeService");
/* 564 */
Set<String> keys = redisTradeService.noPerkeys(key + ":");
/* 565 */
if (null == keys) {
/* 566 */
return null;
/* */
}
/* 568 */
List<BigDecimal> list2 = new ArrayList();
/* 569 */
Iterator<String> iterator = keys.iterator();
/* 570 */
while (iterator.hasNext()) {
/* 571 */
String keystr = (String) iterator.next();
/* 572 */
BigDecimal ks = new BigDecimal(keystr.split(":")[2]);
/* 573 */
list2.add(ks);
/* */
}
/* 575 */
if (exEntrust.getType().equals(Integer.valueOf(2))) {
/* 576 */
Collections.sort(list2, new AscBigDecimalComparator());
/* */
} else {
/* 578 */
Collections.sort(list2, new DescBigDecimalComparator());
/* */
}
/* 580 */
return list2;
/* */
}
Aggregations