本文整理了Java中gov.nist.javax.sdp.fields.ZoneField
类的一些代码示例,展示了ZoneField
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneField
类的具体详情如下:
包路径:gov.nist.javax.sdp.fields.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);
内容来源于网络,如有侵权,请联系作者删除!