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

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

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

Transfer.formatXMLTime介绍

暂无

代码示例

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

public static XMLGregorianCalendar formatXMLTime(CompactCalendar time) {
  return formatXMLTime(time, preferences.getBoolean(REDUCE_TIME_TO_SECOND_PRECISION_PREFERENCE, false));
}

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

public static ChecksumType createChecksumType(CompactCalendar lastModified, Long contentLength, String sha1) {
  ChecksumType checksumType = new ObjectFactory().createChecksumType();
  checksumType.setContentLength(contentLength);
  checksumType.setLastModified(formatXMLTime(lastModified, true));
  checksumType.setSha1(sha1);
  return checksumType;
}

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

private static ChecksumType createChecksumType(Long lastModified, Long contentLength, InputStream inputStream) throws IOException {
  ChecksumType result = new ChecksumType();
  result.setLastModified(lastModified != null ? formatXMLTime(fromMillis(lastModified), true) : null);
  result.setContentLength(contentLength);
  if (inputStream != null)
    result.setSha1(generateChecksum(inputStream));
  return result;
}

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

private ChecksumType asChecksumType(Checksum checksum) {
  if (checksum == null)
    return null;
  ChecksumType checksumType = new ObjectFactory().createChecksumType();
  checksumType.setContentLength(checksum.getContentLength());
  checksumType.setLastModified(formatXMLTime(checksum.getLastModified(), true));
  checksumType.setSha1(checksum.getSHA1());
  return checksumType;
}

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

private TrackT createTrack(TcxRoute route, int startIndex, int endIndex) {
  ObjectFactory objectFactory = new ObjectFactory();
  TrackT trackT = objectFactory.createTrackT();
  List<TrackpointT> trackpoints = trackT.getTrackpoint();
  List<Wgs84Position> positions = route.getPositions();
  Wgs84Position previous = null;
  double distance = 0.0;
  for (int i = startIndex; i < endIndex; i++) {
    Wgs84Position position = positions.get(i);
    TrackpointT trackpointT = objectFactory.createTrackpointT();
    trackpointT.setAltitudeMeters(position.getElevation());
    trackpointT.setHeartRateBpm(getHeartBeatRate(position));
    trackpointT.setPosition(createPosition(position));
    trackpointT.setTime(Transfer.formatXMLTime(position.getTime()));
    if (previous != null) {
      Double previousDistance = previous.calculateDistance(position);
      if (!isEmpty(previousDistance))
        distance += previousDistance;
    }
    previous = position;
    trackpointT.setDistanceMeters(distance);
    trackpoints.add(trackpointT);
  }
  return trackT;
}

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

private TrackT createTrack(TcxRoute route, int startIndex, int endIndex) {
  ObjectFactory objectFactory = new ObjectFactory();
  TrackT trackT = objectFactory.createTrackT();
  List<TrackpointT> trackpoints = trackT.getTrackpoint();
  List<Wgs84Position> positions = route.getPositions();
  Wgs84Position previous = null;
  double distance = 0.0;
  for (int i = startIndex; i < endIndex; i++) {
    Wgs84Position position = positions.get(i);
    TrackpointT trackpointT = objectFactory.createTrackpointT();
    trackpointT.setAltitudeMeters(position.getElevation());
    trackpointT.setHeartRateBpm(getHeartBeatRateT(position));
    trackpointT.setPosition(createPosition(position));
    trackpointT.setTime(Transfer.formatXMLTime(position.getTime()));
    if (previous != null) {
      Double previousDistance = previous.calculateDistance(position);
      if (!isEmpty(previousDistance))
        distance += previousDistance;
    }
    previous = position;
    trackpointT.setDistanceMeters(distance);
    trackpoints.add(trackpointT);
  }
  return trackT;
}

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

if (longitude != null)
  coordinatesType.setLongitude(longitude);
coordinatesType.setTimeStamp(formatXMLTime(position.getTime()));
landmarkType.setCoordinates(coordinatesType);

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

trkpt.setLat(latitude);
trkpt.setLon(longitude);
trkpt.setTime(isWriteTime() ? formatXMLTime(position.getTime()) : null);
trkpt.setEle(isWriteElevation() ? formatElevation(position.getElevation()) : null);
trkpt.setCourse(isWriteHeading() ? formatHeading(position.getHeading()) : null);

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

rtept.setLat(latitude);
rtept.setLon(longitude);
rtept.setTime(isWriteTime() ? formatXMLTime(position.getTime()) : null);
rtept.setEle(isWriteElevation() ? formatElevation(position.getElevation()) : null);
rtept.setCourse(isWriteHeading() ? formatHeading(position.getHeading()) : null);

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

wpt.setLat(latitude);
wpt.setLon(longitude);
wpt.setTime(isWriteTime() ? formatXMLTime(position.getTime()) : null);
wpt.setEle(isWriteElevation() ? formatElevation(position.getElevation()) : null);
wpt.setCourse(isWriteHeading() ? formatHeading(position.getHeading()) : null);

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

wptType.setLon(longitude);
wptType.setEle(isWriteElevation() ? formatElevation(position.getElevation()) : null);
wptType.setTime(isWriteTime() ? formatXMLTime(position.getTime()) : null);
wptType.setName(isWriteName() ? asName(position.getDescription()) : null);
wptType.setDesc(isWriteName() ? asDesc(position.getDescription(), wptType.getDesc()) : null);

相关文章