slash.common.io.Transfer.parseInt()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中slash.common.io.Transfer.parseInt()方法的一些代码示例,展示了Transfer.parseInt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transfer.parseInt()方法的具体详情如下:
包路径:slash.common.io.Transfer
类名称:Transfer
方法名:parseInt

Transfer.parseInt介绍

暂无

代码示例

代码示例来源:origin: cpesch/RouteConverter

BcrPosition parsePosition(String client, String coordinate, String description) {
  Matcher coordinateMatcher = COORDINATES_VALUE_PATTERN.matcher(coordinate);
  if (!coordinateMatcher.matches())
    throw new IllegalArgumentException("'" + coordinate + "' does not match coordinates pattern");
  String x = coordinateMatcher.group(1);
  String y = coordinateMatcher.group(2);
  long altitude = NO_ALTITUDE_DEFINED;
  Matcher clientMatcher = ALTITUDE_VALUE_PATTERN.matcher(client);
  if (!clientMatcher.matches())
    log.info("'" + client + "' does not match client station pattern; ignoring it");
  else {
    String string = clientMatcher.group(2);
    try {
      Long aLong = parseLong(string);
      if (aLong != null)
        altitude = aLong;
    }
    catch (NumberFormatException e) {
      log.info("'" + string + "' is not a valid altitude; ignoring it");
    }
  }
  return new BcrPosition(parseInt(x), parseInt(y), altitude, trim(description));
}

代码示例来源:origin: cpesch/RouteConverter

boolean processCallback(String callback) {
  Matcher insertPositionAtMatcher = ADD_POSITION_AT_PATTERN.matcher(callback);
  if (insertPositionAtMatcher.matches()) {
    final int row = parseInt(insertPositionAtMatcher.group(1)) + 1;
    final NavigationPosition position = parsePosition(insertPositionAtMatcher.group(2), insertPositionAtMatcher.group(3));
    invokeLater(new Runnable() {
    final int row = getMoveRow(parseInt(movePositionMatcher.group(1)));
    final NavigationPosition position = parsePosition(movePositionMatcher.group(2), movePositionMatcher.group(3));
    invokeLater(new Runnable() {
    int port = parseInt(callbackPortMatcher.group(1));
    fireReceivedCallback(port);
    return true;
    Integer generation = parseInt(directionsLoadMatcher.group(1));
    if (generation != generationId) {
      log.warning("Got directions load from generation id: " + generation + ", current: " + generationId);
    } else {
      Integer generationIndex = parseInt(directionsLoadMatcher.group(2));
      List<DistanceAndTime> distanceAndTimes = parseDistanceAndTimeParameters(directionsLoadMatcher.group(3));
      directionsLoadCallback(generationIndex, distanceAndTimes);

代码示例来源:origin: cpesch/RouteConverter

parseDouble(orthometricHeight), null, null, parseTime(time), null);
position.setHdop(parseDouble(hdop));
position.setSatellites(parseInt(svs));
return position;

代码示例来源:origin: cpesch/RouteConverter

void processLines(List<String> lines, int port) {
  boolean hasValidCallbackNumber = false;
  for (String line : lines) {
    Matcher matcher = CALLBACK_REQUEST_PATTERN.matcher(line);
    if (matcher.matches()) {
      int callbackNumber = parseInt(matcher.group(2));
      if (lastCallbackNumber >= callbackNumber) {
        log.info("Ignoring callback number: " + callbackNumber + " last callback number is: " + lastCallbackNumber + " port is: " + port);
        break;
      }
      lastCallbackNumber = callbackNumber;
      hasValidCallbackNumber = true;
      String callback = matcher.group(3);
      if (processCallback(callback)) {
        log.info("Processed " + matcher.group(1) + " callback " + callback + " with number: " + callbackNumber + " from port: " + port);
        break;
      }
    }
    // process body of POST requests
    if (hasValidCallbackNumber && processCallback(line)) {
      log.info("Processed POST callback " + line + " with number: " + lastCallbackNumber + " from port: " + port);
      break;
    }
  }
}

相关文章