本文整理汇总了Java中net.fortuna.ical4j.model.parameter.Value.DATE属性的典型用法代码示例。如果您正苦于以下问题:Java Value.DATE属性的具体用法?Java Value.DATE怎么用?Java Value.DATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.fortuna.ical4j.model.parameter.Value
的用法示例。
在下文中一共展示了Value.DATE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRecurrenceDates
private DateList getRecurrenceDates(Component event) {
DateList l = null;
if(event==null) {
return null;
}
for (Object property : event.getProperties().getProperties(Property.RDATE)) {
RDate rdate = (RDate) property;
if(l==null) {
if(Value.DATE.equals(rdate.getParameter(Parameter.VALUE))) {
l = new DateList(Value.DATE);
}
else {
l = new DateList(Value.DATE_TIME, rdate.getDates().getTimeZone());
}
}
l.addAll(rdate.getDates());
}
return l;
}
示例2: ICalDate
/**
* Constructs an <code>ICalDate</code> from an iCalendar date.
* @param date The date.
* @throws UnknownTimeZoneException - if something is wrong this exception is thrown.
*/
public ICalDate(Date date) throws UnknownTimeZoneException {
if (date instanceof DateTime) {
value = Value.DATE_TIME;
tz = ((DateTime) date).getTimeZone();
// We only support known tzids (Olson for the most part)
if (tz != null) {
tz = tzTranslator.translateToOlsonTz(tz);
// If timezone can't be translated, then datetime will
// essentiallyi be floating.
if (tz != null) {
String id = tz.getVTimeZone().getProperties().
getProperty(Property.TZID).getValue();
tzid = new TzId(id);
}
}
} else {
value = Value.DATE;
}
this.anytime = false;
text = date.toString();
this.date = date;
}
示例3: getRecurrenceIDList
/**
* Get a List of RECURRENCE-ID by recurrence dates and EXDATEs
*
* @param recurDates
* @param exDates
* @param value decide the format of RECURRENCE-ID
* @return
*/
public ArrayList<String> getRecurrenceIDList(DateList recurDates, DateList exDates, Value value) throws ParseException{
ArrayList<String> recurIdList= new ArrayList<String>();
// Date
if( value == Value.DATE ){
fillRecurIDListbyDate(recurIdList, recurDates);
}
// DateTime
else{
fillRecurIDListbyDateTime(recurIdList, recurDates);
}
// remove the exdates
if( exDates != null ){
if( value == Value.DATE ){
removeRecurIDListbyDate(recurIdList, exDates);
}
else{
removeRecurIDListbyDateTime(recurIdList, exDates);
}
}
return recurIdList;
}
示例4: parseValue
/**
* Parses value.
* @param str The string.
*/
private void parseValue(String str) {
if (str.equals("DATE")) {
value = Value.DATE;
}
else if (str.equals("DATE-TIME")) {
value = Value.DATE_TIME;
}
else {
throw new IllegalArgumentException("Bad value " + str);
}
}
示例5: parseDates
/**
* Parses dates.
* @param str The string.
* @throws ParseException - if something is wrong this exception is thrown.
*/
private void parseDates(String str)
throws ParseException {
if (str.indexOf(',')==-1) {
date = isDate() ? new Date(str) : new DateTime(str, tz);
if(isDate() && tz != null) {
throw new ParseException("DATE cannot have timezone",0);
}
}
dates = isDate() ?
new DateList(str, Value.DATE, tz) :
new DateList(str, Value.DATE_TIME, tz);
}