gpt4 book ai didi

gov.nist.javax.sdp.fields.ZoneField类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:21:10 27 4
gpt4 key购买 nike

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

ZoneField介绍

[英]Z= SDP field.
[中]Z=SDP字段。

代码示例

代码示例来源:origin: org.opentelecoms.sdp/java-sdp-nist-bridge

public TimeZoneAdjustment createTimeZoneAdjustment(Date d, int offset) {
  ZoneField z = new ZoneField();
  try {
    Hashtable<Date, Integer> t = new Hashtable<Date, Integer>(1);
    t.put(d, offset);
    z.setZoneAdjustments(t);
  }
  catch (SdpException e) {
    e.printStackTrace();
  }
  return z;
}

代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly

/** Returns a Hashtable of adjustment times, where:
 *        key = Date. This is the equivalent of the decimal NTP time value.
 *        value = Int Adjustment. This is a relative time value in seconds.
 * @param create to set
 * @throws SdpParseException
 * @return create - when true, an empty Hashtable is created, if it is null.
 */
public Hashtable getZoneAdjustments(boolean create)
  throws SdpParseException {
  Hashtable result = new Hashtable();
  SDPObjectList zoneAdjustments = getZoneAdjustments();
  ZoneAdjustment zone;
  if (zoneAdjustments == null)
    if (create)
      return new Hashtable();
    else
      return null;
  else {
    while ((zone = (ZoneAdjustment) zoneAdjustments.next()) != null) {
      Long l = Long.valueOf(zone.getTime());
      Integer time = Integer.valueOf(l.toString());
      Date date = new Date(zone.getTime());
      result.put(date, time);
    }
    return result;
  }
}

代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly

ZoneField zoneField = new ZoneField();
  zoneAdjustment.setOffset(typedTime);
  zoneField.addZoneAdjustment(zoneAdjustment);

代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly

/** Sets the Hashtable of adjustment times, where:
 *          key = Date. This is the equivalent of the decimal NTP time value.
 *          value = Int Adjustment. This is a relative time value in seconds.
 * @param map Hashtable to set
 * @throws SdpException if the parameter is null
 */
public void setZoneAdjustments(Hashtable map) throws SdpException {
  if (map == null)
    throw new SdpException("The map is null");
  else {
    for (Enumeration e = map.keys(); e.hasMoreElements();) {
      Object o = e.nextElement();
      if (o instanceof Date) {
        Date date = (Date) o;
        ZoneAdjustment zone = new ZoneAdjustment();
        zone.setTime(date.getTime());
        addZoneAdjustment(zone);
      } else
        throw new SdpException("The map is not well-formated ");
    }
  }
}

代码示例来源:origin: org.jitsi/jain-sip-ri-ossonly

if (otherZoneField != null) {
  ZoneField newPF = (ZoneField) otherZoneField.clone();
  newZAs.add(newPF);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com