本文整理汇总了Java中javax.xml.datatype.XMLGregorianCalendar.clone方法的典型用法代码示例。如果您正苦于以下问题:Java XMLGregorianCalendar.clone方法的具体用法?Java XMLGregorianCalendar.clone怎么用?Java XMLGregorianCalendar.clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.datatype.XMLGregorianCalendar
的用法示例。
在下文中一共展示了XMLGregorianCalendar.clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OutageAnalysisWorker
import javax.xml.datatype.XMLGregorianCalendar; //导入方法依赖的package包/类
public OutageAnalysisWorker(Set<Outage> hiddenOutages, Set<Outage> radializedButNotDisconnectedEquipment, XMLGregorianCalendar startDate, XMLGregorianCalendar endDate, Map<String,Map<String,OutageResourceNode>> originalRadialEquipment, Map<String,Map<String,OutageResourceNode>> originalDisconnectedEquipment) {
log.info("Establish the model for analysis");
rdfModel = RdfGraph.initialize();
RdfGraph.connect(rdfModel);
this.originalRadialEquipment = originalRadialEquipment;
this.originalDisconnectedEquipment = originalDisconnectedEquipment;
this.hiddenOutages = hiddenOutages;
this.radializedButNotDisconnectedEquipment = radializedButNotDisconnectedEquipment;
this.startDate = (XMLGregorianCalendar)startDate.clone();
this.endDate = (XMLGregorianCalendar)endDate.clone();
}
示例2: checkAddDays
import javax.xml.datatype.XMLGregorianCalendar; //导入方法依赖的package包/类
@Test(dataProvider = "data-for-add")
public void checkAddDays(String cal1, String cal2, String dur) {
XMLGregorianCalendar calendar1 = datatypeFactory.newXMLGregorianCalendar(cal1);
XMLGregorianCalendar calendar2 = datatypeFactory.newXMLGregorianCalendar(cal2);
Duration duration = datatypeFactory.newDuration(dur);
XMLGregorianCalendar calendar1Clone = (XMLGregorianCalendar)calendar1.clone();
calendar1Clone.add(duration);
assertEquals(calendar1Clone, calendar2);
calendar2.add(duration.negate());
assertEquals(calendar2, calendar1);
}