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

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

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

Transfer.parseInteger介绍

暂无

代码示例

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

public static int parseInt(String string) {
  Integer integer = parseInteger(string);
  return integer != null ? integer : -1;
}

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

protected boolean isPosition(String line) {
  Matcher matcher = LINE_PATTERN.matcher(line);
  if (!matcher.matches())
    return false;
  Integer satellites = parseInteger(matcher.group(7));
  return satellites != null && satellites > 0;
}

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

TomTomPosition parsePosition(String line) {
  Matcher lineMatcher = POSITION_PATTERN.matcher(line);
  if (!lineMatcher.matches())
    throw new IllegalArgumentException("'" + line + "' does not match");
  String longitude = lineMatcher.group(1);
  String latitude = lineMatcher.group(2);
  String description = lineMatcher.group(3);
  return new TomTomPosition(parseInteger(longitude), parseInteger(latitude), trim(description));
}

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

private Integer getElevationFor(String uri, double longitude, double latitude, Integer nullValue) throws IOException {
  String result = execute(uri + "?lat=" + latitude + "&lng=" + longitude, uri); // could be up to 20 points
  if (result != null) {
    try {
      Integer elevation = parseInteger(result);
      if (elevation != null && !elevation.equals(nullValue))
        return elevation;
    } catch (NumberFormatException e) {
      throw new IOException("Cannot unmarshall " + result + ": " + e, e);
    }
  }
  return null;
}

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

private Integer parseSatellites(TiffDirectory directory) throws ImageReadException {
  String satellites = (String) directory.getFieldValue(GPS_TAG_GPS_SATELLITES);
  return satellites != null ? parseInteger(satellites) : null;
}

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

private int extractPositionInList(TourPosition position) {
  Integer integer = parseInteger(position.get(POSITION_IN_LIST));
  return integer != null ? integer : position.hashCode();
}

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

Wgs84Position parsePosition(Map<String, String> map) {
  Integer latitude = parseInteger(map.get(LATITUDE));
  Integer longitude = parseInteger(map.get(LONGITUDE));
  String state = trim(map.get(STATE));
  String zip = trim(map.get(ZIP));
  String city = trim(map.get(CITY));
  String county = trim(map.get(COUNTY));
  String address = trim(map.get(ADDRESS));
  String description = (state != null ? state + (zip != null ? "-" : " ") : "") +
      (zip != null ? zip + " " : "") + (city != null ? city : "") +
      (county != null ? ", " + county : "") + (address != null ? ", " + address : "");
  return new Wgs84Position(longitude != null ? longitude / INTEGER_FACTOR : null,
      latitude != null ? latitude / INTEGER_FACTOR : null,
      null, null, null, trim(description));
}

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

protected Wgs84Position parsePosition(String line, ParserContext context) {
  Matcher lineMatcher = LINE_PATTERN.matcher(line);
  if (!lineMatcher.matches())
    throw new IllegalArgumentException("'" + line + "' does not match");
  String date = lineMatcher.group(3);
  String time = lineMatcher.group(4);
  Double latitude = parseDouble(lineMatcher.group(6));
  String northOrSouth = lineMatcher.group(7);
  if ("S".equals(northOrSouth) && latitude != null)
    latitude = -latitude;
  Double longitude = parseDouble(lineMatcher.group(8));
  String westOrEasth = lineMatcher.group(9);
  if ("W".equals(westOrEasth) && longitude != null)
    longitude = -longitude;
  String height = lineMatcher.group(10);
  String speed = lineMatcher.group(11);
  String hdop = lineMatcher.group(12);
  String satellites = lineMatcher.group(13);
  Wgs84Position position = new Wgs84Position(longitude, latitude, parseDouble(height), parseDouble(speed),
      parseDateAndTime(date, time), null);
  position.setHdop(parseDouble(hdop));
  position.setSatellites(parseInteger(satellites));
  return position;
}

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

protected Wgs84Position parsePosition(String line, ParserContext context) {
  Matcher lineMatcher = LINE_PATTERN.matcher(line);
  if (!lineMatcher.matches())
    throw new IllegalArgumentException("'" + line + "' does not match");
  String time = lineMatcher.group(1);
  String longitude = lineMatcher.group(2);
  String latitude = lineMatcher.group(3);
  String heading = lineMatcher.group(4);
  String speed = lineMatcher.group(5);
  String hdop = lineMatcher.group(6);
  String satellites = lineMatcher.group(7);
  String date = trim(lineMatcher.group(8));
  Wgs84Position position = new Wgs84Position(parseDouble(longitude), parseDouble(latitude),
      null, parseDouble(speed), parseDateAndTime(date, time), null);
  if (date == null)
    position.setStartDate(context.getStartDate());
  position.setHeading(parseDouble(heading));
  position.setHdop(parseDouble(hdop));
  position.setSatellites(parseInteger(satellites));
  return position;
}

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

Integer zoom = parseInteger(zoomChangedMatcher.group(1));
zoomChanged(zoom);
return true;
Integer key = parseInteger(insertWaypointsMatcher.group(2));
List<String> parameters = parsePositionParameters(insertWaypointsMatcher.group(3));
insertWaypointsCallback(key, parameters);

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

NmeaPosition position = new NmeaPosition(parseDouble(longitude), westOrEast, parseDouble(latitude), northOrSouth,
    parseDouble(altitude), null, null, parseTime(time), null);
position.setSatellites(parseInteger(satellites));
return position;

相关文章