当前位置: 首页>>代码示例>>Java>>正文


Java DtStamp类代码示例

本文整理汇总了Java中net.fortuna.ical4j.model.property.DtStamp的典型用法代码示例。如果您正苦于以下问题:Java DtStamp类的具体用法?Java DtStamp怎么用?Java DtStamp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DtStamp类属于net.fortuna.ical4j.model.property包,在下文中一共展示了DtStamp类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadWorkEffort

import net.fortuna.ical4j.model.property.DtStamp; //导入依赖的package包/类
protected static void loadWorkEffort(PropertyList componentProps, GenericValue workEffort) {
    replaceProperty(componentProps, new DtStamp()); // iCalendar object created date/time
    replaceProperty(componentProps, toClazz(workEffort.getString("scopeEnumId")));
    replaceProperty(componentProps, toCreated(workEffort.getTimestamp("createdDate")));
    replaceProperty(componentProps, toDescription(workEffort.getString("description")));
    replaceProperty(componentProps, toDtStart(workEffort.getTimestamp("estimatedStartDate")));
    replaceProperty(componentProps, toLastModified(workEffort.getTimestamp("lastModifiedDate")));
    replaceProperty(componentProps, toPriority(workEffort.getLong("priority")));
    replaceProperty(componentProps, toLocation(workEffort.getString("locationDesc")));
    replaceProperty(componentProps, toStatus(workEffort.getString("currentStatusId")));
    replaceProperty(componentProps, toSummary(workEffort.getString("workEffortName")));
    Property uid = componentProps.getProperty(Uid.UID);
    if (uid == null) {
        // Don't overwrite UIDs created by calendar clients
        replaceProperty(componentProps, toUid(workEffort.getString("workEffortId")));
    }
    replaceProperty(componentProps, toXProperty(workEffortIdXPropName, workEffort.getString("workEffortId")));
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:19,代码来源:ICalConverter.java

示例2: resolve

import net.fortuna.ical4j.model.property.DtStamp; //导入依赖的package包/类
public static VEvent resolve(Cursor c) {
    PropertyList properties = new PropertyList();
    GoogleVEventWrapper wrapperInstance = GoogleVEventWrapper.getInstance();
    for (String key : keys) {
        IGoogleWrapper wrapper = wrapperInstance.getGoogleWrapper(key);
        wrapper.wrap(properties, c);
    }

    VEvent vevent = new VEvent(properties);
    vevent.getProperties().add(new DtStamp());
    Log.d(TAG, "VEvent resolved from cursor");
    return vevent;
}
 
开发者ID:gillesB,项目名称:ical-import-export,代码行数:14,代码来源:VEventWrapper.java

示例3: fillSingleComponent

import net.fortuna.ical4j.model.property.DtStamp; //导入依赖的package包/类
/**
 * Creates a copy of a component which doesn't contain the original component's
 * recurrence information.
 * 
 * @param component
 *            - the component to be filled
 * @param date
 *            - the startDate that will be assigned to the component
 * @param duration
 *            - the duration (only relevant for events)
 */
private void fillSingleComponent(Component component, Date date,
		long duration) {

	// copy all the properties from the original component
	PropertyList list = getPropertyList(component);

	// if the component is an event perform event-specific actions
	if (component instanceof VEvent) {

		// the new endDate of this single event will
		// be the previously calculated duration in combination
		// with the current startDate
		Date newEndDate = new DateTime(date.getTime() + duration);

		// add new dates to the property list
		list.add(new DtStart(date));
		list.add(new DtEnd(newEndDate));

		// create a new event with the properties of the property list
		// and add it to the temporalDataSet
		VEvent singleEvent = new VEvent(list);
		fillEvent(singleEvent);

	} else if (component instanceof VJournal) { // otherwise perfom
												// journal-specific actions

		// set the time stamp of the new journal
		// to the current nextDate (occurrence)
		list.add(new DtStamp((DateTime) date));

		// create a new journal with the properties
		// and add it to the temporalDataSet
		VJournal singleJournal = new VJournal(list);
		fillJournal(singleJournal);
	}
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:48,代码来源:ICalenderTemporalDatasetReader.java

示例4: createTestCalendar

import net.fortuna.ical4j.model.property.DtStamp; //导入依赖的package包/类
/**
 * Creates test calendar instance.
 * 
 * @return ICal calendar object.
 */
protected Calendar createTestCalendar() throws ParseException {
 // Create a TimeZone
    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
    TimeZone timezone = registry.getTimeZone("America/New_York");
    VTimeZone tz = timezone.getVTimeZone();

     // Start Date is on: April 1, 2013, 9:00 am
    java.util.Calendar startDate = new GregorianCalendar();
    startDate.setTimeZone(timezone);
    startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
    startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
    startDate.set(java.util.Calendar.YEAR, 2013);
    startDate.set(java.util.Calendar.HOUR_OF_DAY, 17);
    startDate.set(java.util.Calendar.MINUTE, 0);
    startDate.set(java.util.Calendar.SECOND, 0);

     // End Date is on: April 1, 2013, 13:00
    java.util.Calendar endDate = new GregorianCalendar();
    endDate.setTimeZone(timezone);
    endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
    endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
    endDate.set(java.util.Calendar.YEAR, 2013);
    endDate.set(java.util.Calendar.HOUR_OF_DAY, 21);
    endDate.set(java.util.Calendar.MINUTE, 0);  
    endDate.set(java.util.Calendar.SECOND, 0);

    // Create the event
    PropertyList propertyList = new PropertyList();
    propertyList.add(new DtStamp("20130324T180000Z"));
    propertyList.add(new DtStart(new DateTime(startDate.getTime())));
    propertyList.add(new DtEnd(new DateTime(endDate.getTime())));
    propertyList.add(new Summary("Progress Meeting"));
    VEvent meeting = new VEvent(propertyList);

    // add timezone info..
    meeting.getProperties().add(tz.getTimeZoneId());

    // generate unique identifier..
    meeting.getProperties().add(new Uid("00000000"));

    // add attendees..
    Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
    dev1.getParameters().add(Role.REQ_PARTICIPANT);
    dev1.getParameters().add(new Cn("Developer 1"));
    meeting.getProperties().add(dev1);

    Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
    dev2.getParameters().add(Role.OPT_PARTICIPANT);
    dev2.getParameters().add(new Cn("Developer 2"));
    meeting.getProperties().add(dev2);

    // Create a calendar
    net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
    icsCalendar.getProperties().add(Version.VERSION_2_0);
    icsCalendar.getProperties().add(new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
    icsCalendar.getProperties().add(CalScale.GREGORIAN);

    // Add the event and print
    icsCalendar.getComponents().add(meeting);
    return icsCalendar;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:67,代码来源:ICalDataFormatTest.java

示例5: createTestCalendar

import net.fortuna.ical4j.model.property.DtStamp; //导入依赖的package包/类
private Calendar createTestCalendar() throws ParseException {
    // Create a TimeZone
    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
    TimeZone timezone = registry.getTimeZone("America/New_York");
    VTimeZone tz = timezone.getVTimeZone();

    // Start Date is on: April 1, 2013, 9:00 am
    java.util.Calendar startDate = new GregorianCalendar();
    startDate.setTimeZone(timezone);
    startDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
    startDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
    startDate.set(java.util.Calendar.YEAR, 2013);
    startDate.set(java.util.Calendar.HOUR_OF_DAY, 17);
    startDate.set(java.util.Calendar.MINUTE, 0);
    startDate.set(java.util.Calendar.SECOND, 0);

    // End Date is on: April 1, 2013, 13:00
    java.util.Calendar endDate = new GregorianCalendar();
    endDate.setTimeZone(timezone);
    endDate.set(java.util.Calendar.MONTH, java.util.Calendar.APRIL);
    endDate.set(java.util.Calendar.DAY_OF_MONTH, 1);
    endDate.set(java.util.Calendar.YEAR, 2013);
    endDate.set(java.util.Calendar.HOUR_OF_DAY, 21);
    endDate.set(java.util.Calendar.MINUTE, 0);
    endDate.set(java.util.Calendar.SECOND, 0);

    // Create the event
    PropertyList propertyList = new PropertyList();
    propertyList.add(new DtStamp("20130324T180000Z"));
    propertyList.add(new DtStart(new DateTime(startDate.getTime())));
    propertyList.add(new DtEnd(new DateTime(endDate.getTime())));
    propertyList.add(new Summary("Progress Meeting"));
    VEvent meeting = new VEvent(propertyList);

    // add timezone info..
    meeting.getProperties().add(tz.getTimeZoneId());

    // generate unique identifier..
    meeting.getProperties().add(new Uid("00000000"));

    // add attendees..
    Attendee dev1 = new Attendee(URI.create("mailto:[email protected]"));
    dev1.getParameters().add(Role.REQ_PARTICIPANT);
    dev1.getParameters().add(new Cn("Developer 1"));
    meeting.getProperties().add(dev1);

    Attendee dev2 = new Attendee(URI.create("mailto:[email protected]"));
    dev2.getParameters().add(Role.OPT_PARTICIPANT);
    dev2.getParameters().add(new Cn("Developer 2"));
    meeting.getProperties().add(dev2);

    // Create a calendar
    net.fortuna.ical4j.model.Calendar icsCalendar = new net.fortuna.ical4j.model.Calendar();
    icsCalendar.getProperties().add(Version.VERSION_2_0);
    icsCalendar.getProperties().add(new ProdId("-//Events Calendar//iCal4j 1.0//EN"));
    icsCalendar.getProperties().add(CalScale.GREGORIAN);

    // Add the event and print
    icsCalendar.getComponents().add(meeting);
    return icsCalendar;
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:62,代码来源:ICalFormatTest.java


注:本文中的net.fortuna.ical4j.model.property.DtStamp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。