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

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

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

Transfer.parseDouble介绍

暂无

代码示例

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

private Double parseDegrees(Object objectValue, String stringValue, String replaceAll) {
  if (objectValue == null || objectValue instanceof Double)
    return (Double) objectValue;
  if (replaceAll != null && stringValue != null)
    stringValue = stringValue.replaceAll(replaceAll, "");
  return parseDouble(stringValue);
}

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

static Double parseHeading(String description) {
  if (description != null) {
    Matcher qstartzPattern = QSTARTZ_SPEED_PATTERN.matcher(description);
    if (qstartzPattern.matches())
      return parseDouble(qstartzPattern.group(3));
  }
  return null;
}

代码示例来源: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 latitude = lineMatcher.group(1);
  String longitude = lineMatcher.group(2);
  String elevation = lineMatcher.group(3);
  return new Wgs84Position(parseDouble(longitude), parseDouble(latitude), parseDouble(elevation), null, null, null);
}

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

public static List<NavigationPosition> parseExtensionPositions(String listOfCoordinates) {
    List<NavigationPosition> result = new ArrayList<>();
    Matcher matcher = EXTENSION_POSITION_PATTERN.matcher(listOfCoordinates);
    while (matcher.find()) {
      String longitude = matcher.group(1);
      String latitude = matcher.group(2);
      String elevation = matcher.group(3);
      result.add(new SimpleNavigationPosition(parseDouble(longitude), parseDouble(latitude), parseDouble(elevation), null));
    }
    return result;
  }
}

代码示例来源: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 description = lineMatcher.group(2);
  Double longitude = parseDouble(lineMatcher.group(4));
  Double latitude = parseDouble(lineMatcher.group(5));
  return asWgs84Position(longitude, latitude, description);
}

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

public static NavigationPosition parsePosition(String coordinates, String description) {
  Matcher matcher = POSITION_PATTERN.matcher(coordinates);
  if (!matcher.matches())
    throw new IllegalArgumentException("'" + coordinates + "' does not match");
  String longitude = matcher.group(1);
  String latitude = matcher.group(2);
  String elevation = matcher.group(3);
  if(elevation != null && elevation.startsWith(","))
    elevation = elevation.substring(1);
  return new SimpleNavigationPosition(parseDouble(longitude), parseDouble(latitude), parseDouble(elevation), 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 latitude = lineMatcher.group(1);
  String longitude = lineMatcher.group(2);
  String altitude = lineMatcher.group(3);
  String time = lineMatcher.group(4);
  return new Wgs84Position(parseDouble(longitude), parseDouble(latitude),
      parseDouble(altitude), 0.0, parseTime(time), null);
}

代码示例来源: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 latitude = lineMatcher.group(1);
  String longitude = lineMatcher.group(2);
  String elevation = lineMatcher.group(3);
  String date = lineMatcher.group(4);
  String time = lineMatcher.group(5);
  return new Wgs84Position(parseDouble(longitude), parseDouble(latitude),
      parseDouble(elevation), null, parseDateAndTime(date, time), null);
}

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

GkPosition parsePosition(String line) {
  Matcher lineMatcher = POSITION_PATTERN.matcher(line);
  if (!lineMatcher.matches())
    throw new IllegalArgumentException("'" + line + "' does not match");
  Double right = parseDouble(lineMatcher.group(1));
  Double height = parseDouble(lineMatcher.group(2));
  String description = trim(lineMatcher.group(3));
  return new GkPosition(right, height, 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 longitude = lineMatcher.group(1);
  String latitude = lineMatcher.group(2);
  String description = trim(lineMatcher.group(3));
  if (description != null)
    description = description.replaceAll("\\p{Cntrl}", "");
  return asWgs84Position(parseDouble(longitude), parseDouble(latitude), description);
}

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

Wgs84Position parseCommentPosition(String position) {
  Matcher matcher = COMMENT_POSITION_PATTERN.matcher(position);
  if (!matcher.matches())
    throw new IllegalArgumentException("'" + position + "' does not match");
  String comment = trim(matcher.group(1));
  Double latitude = parseDouble(matcher.group(3));
  Double longitude = parseDouble(matcher.group(4));
  return asWgs84Position(longitude, latitude, comment);
}

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

protected Integer getCurrentZoom() {
  try {
    Double zoom = parseDouble(executeScriptWithResult("getZoom();"));
    if (zoom != null)
      return zoom.intValue();
  } catch (NumberFormatException e) {
    // intentionally left empty
  }
  return null;
}

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

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

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

private Double extractValue(StartElement startElement, String attributeName) {
  Attribute attribute = startElement.getAttributeByName(new QName(attributeName));
  if (attribute == null)
    return null;
  return parseDouble(attribute.getValue());
}

代码示例来源: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 longitude = lineMatcher.group(1);
  String latitude = lineMatcher.group(2);
  String description = toMixedCase(trim(lineMatcher.group(3)));
  return asWgs84Position(parseDouble(longitude), parseDouble(latitude), description);
}

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

protected NmnPosition parsePosition(String line, ParserContext context) {
  Matcher lineMatcher = LINE_PATTERN.matcher(line);
  if (!lineMatcher.matches())
    throw new IllegalArgumentException("'" + line + "' does not match");
  String city = parseForNmn5(lineMatcher.group(1));
  String street = parseForNmn5(lineMatcher.group(2));
  String number = parseForNmn5(lineMatcher.group(3));
  String longitude = lineMatcher.group(4);
  String latitude = lineMatcher.group(5);
  return new NmnPosition(parseDouble(longitude), parseDouble(latitude), null, city, street, number);
}

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

protected NmnPosition parsePosition(String line, ParserContext context) {
  Matcher lineMatcher = POSITION_PATTERN.matcher(line);
  if (!lineMatcher.matches())
    throw new IllegalArgumentException("'" + line + "' does not match");
  String city = trim(lineMatcher.group(1));
  String longitude = lineMatcher.group(2);
  String latitude = lineMatcher.group(3);
  String street = trim(lineMatcher.group(4));
  String description = toMixedCase(city != null ? city + (street != null ? ", " + street : "") : "");
  return new NmnPosition(parseDouble(longitude), parseDouble(latitude), (Double) null, null, null, trim(description));
}

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

private NavigationPosition parsePosition(String latitudeString, String longitudeString) {
  Double longitude = parseDouble(longitudeString);
  Double latitude = parseDouble(latitudeString);
  if (longitude != null && latitude != null && isFixMap(longitude, latitude)) {
    double[] delta = delta(latitude, longitude);
    longitude -= delta[1];
    latitude -= delta[0];
  }
  return new SimpleNavigationPosition(longitude, latitude);
}

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

private List<DistanceAndTime> parseDistanceAndTimeParameters(String parameters) {
  List<DistanceAndTime> result = new ArrayList<>();
  StringTokenizer tokenizer = new StringTokenizer(parameters, "/");
  while (tokenizer.hasMoreTokens()) {
    String distance = trim(tokenizer.nextToken());
    if (tokenizer.hasMoreTokens()) {
      String time = trim(tokenizer.nextToken());
      result.add(new DistanceAndTime(parseDouble(distance), parseLong(time)));
    }
  }
  return result;
}

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

private Double parseDoubleAndAssertNotNull(String aDouble) {
  Double result = parseDouble(aDouble);
  assertNotNull(result);
  return result;
}

相关文章