• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VAlarm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addDefaultReminders

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
private void addDefaultReminders(VEvent vEvent, EventEntity event) {
    VAlarm oneWeekBefore = new VAlarm(new Dur(-7, 0, 0, 0));

    VAlarm oneDayBefore = new VAlarm(new Dur(-1, 0, 0, 0));

    VAlarm oneHourBefore = new VAlarm(new Dur(0, -1, 0, 0));
    oneHourBefore.getProperties().add(new Repeat(4));
    oneHourBefore.getProperties().add(new Duration(new Dur(0, 0, 15, 0)));

    addDisplayAction(event, oneWeekBefore);
    addDisplayAction(event, oneDayBefore);
    addDisplayAction(event, oneHourBefore);
    
    vEvent.getAlarms().add(oneWeekBefore);
    vEvent.getAlarms().add(oneDayBefore);
    vEvent.getAlarms().add(oneHourBefore);
}
 
开发者ID:adrobisch,项目名称:putput,代码行数:18,代码来源:EventsResource.java


示例2: evaluate

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Evaluates.
 * @param comps The component list.
 * @param filter The time range filter.
 * @return the result.
 */
private boolean evaluate(ComponentList comps, TimeRangeFilter filter) {
    
    Component comp = (Component) comps.get(0);
    
    if(comp instanceof VEvent) {
        return evaluateVEventTimeRange(comps, filter);
    }
    else if(comp instanceof VToDo) {
        return evaulateVToDoTimeRange(comps, filter);
    }
    else if(comp instanceof VJournal) {
        return evaluateVJournalTimeRange((VJournal) comp, filter);
    }
    else if(comp instanceof VAlarm) {
        return evaluateVAlarmTimeRange(comps, filter);
    }
    else {
        return false;
    }
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:27,代码来源:CalendarFilterEvaluater.java


示例3: getDisplayAlarm

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Find and return the first DISPLAY VALARM in a comoponent
 * @param component VEVENT or VTODO
 * @return first DISPLAY VALARM, null if there is none
 */
public static VAlarm getDisplayAlarm(Component component) {
    ComponentList<VAlarm> alarms = null;
    
    if(component instanceof VEvent) {
        alarms = ((VEvent) component).getAlarms();
    }
    else if(component instanceof VToDo) {
        alarms = ((VToDo) component).getAlarms();
    }
    
    if(alarms==null || alarms.size()==0) {
        return null;
    }
    
    for(Iterator<VAlarm> it = alarms.iterator();it.hasNext();) {
        VAlarm alarm = it.next();
        if(Action.DISPLAY.equals(alarm.getAction())) {
            return alarm;
        }
    }
    
    return null;   
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:29,代码来源:ICalendarUtils.java


示例4: evaluate

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Evaluates.
 * @param comps The component list.
 * @param filter The time range filter.
 * @return the result.
 */
private boolean evaluate(ComponentList<? extends Component> comps, TimeRangeFilter filter) {
    
    Component comp = (Component) comps.get(0);
    
    if(comp instanceof VEvent) {
        return evaluateVEventTimeRange(comps, filter);
    }
    else if(comp instanceof VFreeBusy) {
        return evaulateVFreeBusyTimeRange((VFreeBusy) comp, filter);
    }
    else if(comp instanceof VToDo) {
        return evaulateVToDoTimeRange(comps, filter);
    }
    else if(comp instanceof VJournal) {
        return evaluateVJournalTimeRange((VJournal) comp, filter);
    }
    else if(comp instanceof VAlarm) {
        return evaluateVAlarmTimeRange(comps, filter);
    }
    else {
        return false;
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:30,代码来源:CalendarFilterEvaluater.java


示例5: setDisplayAlarmTrigger

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public void setDisplayAlarmTrigger(Trigger newTrigger) {
    VAlarm alarm = getDisplayAlarm();
    if(alarm==null) {
        return;
    }
    
    Trigger oldTrigger = (Trigger) alarm.getProperties().getProperty(
            Property.TRIGGER);
    if (oldTrigger != null) {
        alarm.getProperties().remove(oldTrigger);
    }

    if(newTrigger!=null) {
        alarm.getProperties().add(newTrigger);
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:17,代码来源:HibBaseEventStamp.java


示例6: setDisplayAlarmTriggerDate

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public void setDisplayAlarmTriggerDate(DateTime triggerDate) {
    VAlarm alarm = getDisplayAlarm();
    if(alarm==null) {
        return;
    }

    Trigger oldTrigger = (Trigger) alarm.getProperties().getProperty(
            Property.TRIGGER);
    if (oldTrigger != null) {
        alarm.getProperties().remove(oldTrigger);
    }
    
    Trigger newTrigger = new Trigger();
    newTrigger.getParameters().add(Value.DATE_TIME);
    newTrigger.setDateTime(triggerDate);
    
    alarm.getProperties().add(newTrigger);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:19,代码来源:HibBaseEventStamp.java


示例7: removeDisplayAlarm

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Removes display alarm.
 */
public void removeDisplayAlarm() {
    VEvent event = getEvent();
    
    if (event == null) {
        return;
    }
     
    for(@SuppressWarnings("rawtypes")
    Iterator it = event.getAlarms().iterator();it.hasNext();) {
        VAlarm alarm = (VAlarm) it.next();
        if (alarm.getProperties().getProperty(Property.ACTION).equals(
                Action.DISPLAY)) {
            it.remove();
        }
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:MockBaseEventStamp.java


示例8: getDisplayAlarmDescription

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Gets display alarm description.
 * @return The alarm description.
 */
public String getDisplayAlarmDescription() {
    VAlarm alarm = getDisplayAlarm();
    if (alarm == null) {
        return null;
    }
    
    Description description = (Description) alarm.getProperties()
            .getProperty(Property.DESCRIPTION);
    
    if (description == null) {
        return null;
    }
    
    return description.getValue();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:MockBaseEventStamp.java


示例9: setDisplayAlarmTrigger

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Sets display alarm trigger.
 * @param newTrigger The new trigger.
 */
public void setDisplayAlarmTrigger(Trigger newTrigger) {
    VAlarm alarm = getDisplayAlarm();
    if (alarm == null) {
        return;
    }
    
    Trigger oldTrigger = (Trigger) alarm.getProperties().getProperty(Property.TRIGGER);
    if (oldTrigger != null) {
        alarm.getProperties().remove(oldTrigger);
    }

    if (newTrigger != null) {
        alarm.getProperties().add(newTrigger);
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:20,代码来源:MockBaseEventStamp.java


示例10: setDisplayAlarmTriggerDate

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Sets display alarm trigger date.
 * @param triggerDate The trigger date.
 */
public void setDisplayAlarmTriggerDate(DateTime triggerDate) {
    VAlarm alarm = getDisplayAlarm();
    if (alarm == null) {
        return;
    }
    Trigger oldTrigger = (Trigger) alarm.getProperties().getProperty(Property.TRIGGER);
    if (oldTrigger != null) {
        alarm.getProperties().remove(oldTrigger);
    }
    
    Trigger newTrigger = new Trigger();
    newTrigger.getParameters().add(Value.DATE_TIME);
    newTrigger.setDateTime(triggerDate);
    
    alarm.getProperties().add(newTrigger);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:21,代码来源:MockBaseEventStamp.java


示例11: parseAndSaveItems

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public void parseAndSaveItems(Calendar calendar) {

if (calendar == null) {
    return;
}

LinkedList<String> newTaskList = new LinkedList<String>();

for (@SuppressWarnings("rawtypes") // Compiler warning suppression
Iterator i = calendar.getComponents().iterator(); i.hasNext();) {
    VEvent newTask = (VEvent) i.next();
    readTaskProperties(newTask);

    VAlarm newReminder = (VAlarm) newTask.getAlarms().getComponent(Component.VALARM);
    readReminderProperties(newReminder);	  	    

    addItemToList(newTaskList);
}

controller.mutexAdd(newTaskList);
   }
 
开发者ID:MohitShridhar,项目名称:TASCA,代码行数:22,代码来源:Importer.java


示例12: getTriggerDates

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * Return the list of dates that an alarm will trigger.
 * @param alarm alarm component
 * @param parent parent compoennt (VEvent,VToDo)
 * @return dates that alarm is configured to trigger
 */
public static List<Date> getTriggerDates(VAlarm alarm, Component parent) {
    ArrayList<Date> dates = new ArrayList<Date>();
    Trigger trigger = alarm.getTrigger();
    if(trigger==null) {
        return dates;
    }
    
    Date initialTriggerDate = getTriggerDate(trigger, parent);
    if(initialTriggerDate==null) {
        return dates;
    }
    
    dates.add(initialTriggerDate);
    
    Duration dur = alarm.getDuration();
    if(dur==null) {
        return dates;
    }
    Repeat repeat = alarm.getRepeat(); 
    if(repeat==null) {
        return dates;
    }
    
    Date nextTriggerDate = initialTriggerDate;
    for(int i=0;i<repeat.getCount();i++) {
        nextTriggerDate = Dates.getInstance(dur.getDuration().getTime(nextTriggerDate), nextTriggerDate);
        dates.add(nextTriggerDate);
    }
    
    return dates;
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:38,代码来源:ICalendarUtils.java


示例13: AND

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * A VALARM component is said to overlap a given time range if the
    following condition holds:

       (start <= trigger-time) AND (end > trigger-time)

   A VALARM component can be defined such that it triggers repeatedly.
   Such a VALARM component is said to overlap a given time range if at
   least one of its triggers overlaps the time range.
   @param comps The component list.
   @param filter The time range filter.
   @return The result.
 */
        
private boolean evaluateVAlarmTimeRange(ComponentList comps, TimeRangeFilter filter) {
    
    // VALARAM must have parent VEVENT or VTODO
    Component parent = stack.peek();
    if(parent==null) {
        return false;
    }
   
    // See if trigger-time overlaps the time range for each VALARM
    for(Iterator<Component> it=comps.iterator();it.hasNext();) {
        VAlarm alarm = (VAlarm) it.next();
        Trigger trigger = alarm.getTrigger();
        if(trigger==null) {
            continue;
        }
        
        List<Date> triggerDates = ICalendarUtils.getTriggerDates(alarm, parent);
        
        for(Date triggerDate: triggerDates) {
            if(filter.getPeriod().getStart().compareTo(triggerDate)<=0 &&
               filter.getPeriod().getEnd().after(triggerDate)) {
               return true;
            }
        }
    }
    
    return false;
}
 
开发者ID:ksokol,项目名称:carldav,代码行数:43,代码来源:CalendarFilterEvaluater.java


示例14: AND

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
/**
 * A VALARM component is said to overlap a given time range if the
    following condition holds:

       (start <= trigger-time) AND (end > trigger-time)

   A VALARM component can be defined such that it triggers repeatedly.
   Such a VALARM component is said to overlap a given time range if at
   least one of its triggers overlaps the time range.
   @param comps The component list.
   @param filter The time range filter.
   @return The result.
 */
        
private boolean evaluateVAlarmTimeRange(ComponentList<? extends Component> comps, TimeRangeFilter filter) {
    
    // VALARAM must have parent VEVENT or VTODO
    Component parent = stack.peek();
    if(parent==null) {
        return false;
    }
   
    // See if trigger-time overlaps the time range for each VALARM
    for(Component component : comps) {
        if (!(component instanceof VAlarm)) {
            continue;
        }
        VAlarm alarm = (VAlarm) component;
        Trigger trigger = alarm.getTrigger();
        if(trigger==null) {
            continue;
        }
        
        List<Date> triggerDates = ICalendarUtils.getTriggerDates(alarm, parent);
        
        for(Date triggerDate: triggerDates) {
            if(filter.getPeriod().getStart().compareTo(triggerDate)<=0 &&
               filter.getPeriod().getEnd().after(triggerDate)) {
               return true;
            }
        }
    }
    
    return false;
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:46,代码来源:CalendarFilterEvaluater.java


示例15: getDisplayAlarm

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public VAlarm getDisplayAlarm() {
    VEvent event = getEvent();
   
    if(event==null) {
        return null;
    }
    
    return getDisplayAlarm(event);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:10,代码来源:HibBaseEventStamp.java


示例16: removeDisplayAlarm

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public void removeDisplayAlarm() {
    VEvent event = getEvent();
    
    if(event==null) {
        return;
    }
     
    ComponentList<VAlarm> alarmsList = event.getAlarms();
    for(VAlarm alarm: alarmsList) {
        if (alarm.getProperties().getProperty(Property.ACTION).equals(
                Action.DISPLAY)) {
            alarmsList.remove(alarm);
        }
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:16,代码来源:HibBaseEventStamp.java


示例17: getDisplayAlarmDescription

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public String getDisplayAlarmDescription() {
    VAlarm alarm = getDisplayAlarm();
    if(alarm==null) {
        return null;
    }
    
    Description description = (Description) alarm.getProperties()
            .getProperty(Property.DESCRIPTION);
    
    if(description==null) {
        return null;
    }
    
    return description.getValue();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:16,代码来源:HibBaseEventStamp.java


示例18: getDisplayAlarmTrigger

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public Trigger getDisplayAlarmTrigger() {
    VAlarm alarm = getDisplayAlarm();
    if(alarm==null) {
        return null;
    }
    
    return (Trigger) alarm.getProperties().getProperty(Property.TRIGGER);
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:9,代码来源:HibBaseEventStamp.java


示例19: getDisplayAlarmDuration

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public Dur getDisplayAlarmDuration() {
    VAlarm alarm = getDisplayAlarm();
    if(alarm==null) {
        return null;
    }
    
    Duration dur =  (Duration) alarm.getProperties().getProperty(Property.DURATION);
    if(dur!=null) {
        return dur.getDuration();
    }
    else {
        return null;
    }
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:15,代码来源:HibBaseEventStamp.java


示例20: getDisplayAlarmRepeat

import net.fortuna.ical4j.model.component.VAlarm; //导入依赖的package包/类
public Integer getDisplayAlarmRepeat() {
    VAlarm alarm = getDisplayAlarm();
    if(alarm==null) {
        return null;
    }
    
    Repeat repeat = (Repeat) alarm.getProperties().getProperty(Property.REPEAT);
    
    if(repeat==null) {
        return null;
    }
    
    return repeat.getCount();
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:15,代码来源:HibBaseEventStamp.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ODataJPAContext类代码示例发布时间:2022-05-22
下一篇:
Java HtmlTextArea类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap