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


Java CalendarDate.getYear方法代码示例

本文整理汇总了Java中net.sf.memoranda.date.CalendarDate.getYear方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarDate.getYear方法的具体用法?Java CalendarDate.getYear怎么用?Java CalendarDate.getYear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.memoranda.date.CalendarDate的用法示例。


在下文中一共展示了CalendarDate.getYear方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNotesForPeriod

import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
public Collection getNotesForPeriod(CalendarDate startDate, CalendarDate endDate) {
    Vector v = new Vector();
    Elements yrs = _root.getChildElements("year");
    for (int yi = 0; yi < yrs.size(); yi++) {
        Year y = new Year(yrs.get(yi));
        if ((y.getValue() >= startDate.getYear()) && (y.getValue() <= endDate.getYear())) {
            Vector months = y.getMonths();
            for (int mi = 0; mi < months.size(); mi++) {
                Month m = (Month) months.get(mi);
                if (!((y.getValue() == startDate.getYear()) && (m.getValue() < startDate.getMonth()))
                    || !((y.getValue() == endDate.getYear()) && (m.getValue() > endDate.getMonth()))) {
                    Vector days = m.getDays();
                    for (int di = 0; di < days.size(); di++) {
                        Day d = (Day) days.get(di);
                        if (!((m.getValue() == startDate.getMonth()) && (d.getValue() < startDate.getDay()))
			|| !((m.getValue() == endDate.getMonth()) && (d.getValue() > endDate.getDay()))) {
				Vector ns = d.getNotes();
				for(int ni = 0; ni < ns.size(); ni++) {
					NoteElement n = (NoteElement) ns.get(ni);
					v.add(new NoteImpl(n.getElement(), _project));
				}
			}
                    }
                }
            }
        }
    }
    return v;
}
 
开发者ID:ser316asu,项目名称:Reinickendorf_SER316,代码行数:30,代码来源:NoteListImpl.java

示例2: getNotesForPeriod

import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
public Collection getNotesForPeriod(CalendarDate startDate, CalendarDate endDate) {
    Vector v = new Vector();
    Elements yrs = _root.getChildElements("year");
    for (int yi = 0; yi < yrs.size(); yi++) {
        Year y = new Year(yrs.get(yi));
        if ((y.getValue() >= startDate.getYear()) && (y.getValue() <= endDate.getYear())) {
            Vector months = y.getMonths();
            for (int mi = 0; mi < months.size(); mi++) {
                Month m = (Month) months.get(mi);
                if (!((y.getValue() == startDate.getYear()) && (m.getValue() < startDate.getMonth()))
                    || !((y.getValue() == endDate.getYear()) && (m.getValue() > endDate.getMonth()))) {
                    Vector days = m.getDays();
                    for (int di = 0; di < days.size(); di++) {
                        Day d = (Day) days.get(di);
                        if (!((m.getValue() == startDate.getMonth()) && (d.getValue() < startDate.getDay()))
                        || !((m.getValue() == endDate.getMonth()) && (d.getValue() > endDate.getDay()))) {
                            Vector ns = d.getNotes();
                            for(int ni = 0; ni < ns.size(); ni++) {
                                NoteElement n = (NoteElement) ns.get(ni);
                                v.add(new NoteImpl(n.getElement(), _project));
                            }
                        }
                    }
                }
            }
        }
    }
    return v;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:30,代码来源:NoteListImpl.java

示例3: getRepeatableEventsForDate

import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
public static Collection getRepeatableEventsForDate(CalendarDate date) {
	Vector reps = (Vector) getRepeatableEvents();
	Vector v = new Vector();
	for (int i = 0; i < reps.size(); i++) {
		Event ev = (Event) reps.get(i);
		
		// --- ivanrise
		// ignore this event if it's a 'only working days' event and today is weekend.
		if(ev.getWorkingDays() && (date.getCalendar().get(Calendar.DAY_OF_WEEK) == 1 ||
			date.getCalendar().get(Calendar.DAY_OF_WEEK) == 7)) continue;
		// ---
		/*
		 * /if ( ((date.after(ev.getStartDate())) &&
		 * (date.before(ev.getEndDate()))) ||
		 * (date.equals(ev.getStartDate()))
		 */
		//System.out.println(date.inPeriod(ev.getStartDate(),
		// ev.getEndDate()));
		if (date.inPeriod(ev.getStartDate(), ev.getEndDate())) {
			if (ev.getRepeat() == REPEAT_DAILY) {
				int n = date.getCalendar().get(Calendar.DAY_OF_YEAR);
				int ns =
					ev.getStartDate().getCalendar().get(
						Calendar.DAY_OF_YEAR);
				//System.out.println((n - ns) % ev.getPeriod());
				if ((n - ns) % ev.getPeriod() == 0)
					v.add(ev);
			} else if (ev.getRepeat() == REPEAT_WEEKLY) {
				if (date.getCalendar().get(Calendar.DAY_OF_WEEK)
					== ev.getPeriod())
					v.add(ev);
			} else if (ev.getRepeat() == REPEAT_MONTHLY) {
				if (date.getCalendar().get(Calendar.DAY_OF_MONTH)
					== ev.getPeriod())
					v.add(ev);
			} else if (ev.getRepeat() == REPEAT_YEARLY) {
				int period = ev.getPeriod();
				//System.out.println(date.getCalendar().get(Calendar.DAY_OF_YEAR));
				if ((date.getYear() % 4) == 0
					&& date.getCalendar().get(Calendar.DAY_OF_YEAR) > 60)
					period++;

				if (date.getCalendar().get(Calendar.DAY_OF_YEAR) == period)
					v.add(ev);
			}
		}
	}
	return v;
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:50,代码来源:EventsManager.java

示例4: getNotesForPeriod

import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
public Collection getNotesForPeriod(CalendarDate startDate, CalendarDate endDate) {
	Vector v = new Vector();
	Elements yrs = _root.getChildElements("year");
	for (int yi = 0; yi < yrs.size(); yi++) {
		Year y = new Year(yrs.get(yi));
		if ((y.getValue() >= startDate.getYear()) && (y.getValue() <= endDate.getYear())) {
			Vector months = y.getMonths();
			for (int mi = 0; mi < months.size(); mi++) {
				Month m = (Month) months.get(mi);
				if (!((y.getValue() == startDate.getYear()) && (m.getValue() < startDate.getMonth()))
						|| !((y.getValue() == endDate.getYear()) && (m.getValue() > endDate.getMonth()))) {
					Vector days = m.getDays();
					for (int di = 0; di < days.size(); di++) {
						Day d = (Day) days.get(di);
						if (!((m.getValue() == startDate.getMonth()) && (d.getValue() < startDate.getDay()))
								|| !((m.getValue() == endDate.getMonth()) && (d.getValue() > endDate.getDay()))) {
							Vector ns = d.getNotes();
							for (int ni = 0; ni < ns.size(); ni++) {
								NoteElement n = (NoteElement) ns.get(ni);
								v.add(new NoteImpl(n.getElement(), _project));
							}
						}
					}
				}
			}
		}
	}
	return v;
}
 
开发者ID:ser316asu,项目名称:Dahlem_SER316,代码行数:30,代码来源:NoteListImpl.java

示例5: monthsCB_actionPerformed

import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
void monthsCB_actionPerformed(ActionEvent e) {
  if (ignoreChange) return;
  _date = new CalendarDate(_date.getDay(), monthsCB.getSelectedIndex(), _date.getYear());
  jnCalendar.set(_date);
  notifyListeners();
}
 
开发者ID:ser316asu,项目名称:SER316-Aachen,代码行数:7,代码来源:JNCalendarPanel.java

示例6: getRepeatableEventsForDate

import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
/**
 *
 * @param date day to check
 * @return a collection of all repeatable events scheduled on date
 */
public static List<Event> getRepeatableEventsForDate(CalendarDate date) {
	List<Event> reps = getRepeatableEvents();
	List<Event> repsForDate = new ArrayList<>();

	for (Event e : reps) {
		// ignore this event if it's a 'only working days' event and today is weekend.
		if (e.getWorkingDays() && (date.getCalendar().get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) ||
				date.getCalendar().get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
			continue;
		}

		if (date.inPeriod(e.getStartDate(), e.getEndDate())) {
			if (e.getRepeatType() == Event.RepeatType.REPEAT_DAILY) {
				int n = date.getCalendar().get(Calendar.DAY_OF_YEAR);
				int ns = e.getStartDate().getCalendar().get(Calendar.DAY_OF_YEAR);

				if ((n - ns) % e.getPeriod() == 0) {
					repsForDate.add(e);
				}
			} else if (e.getRepeatType() == Event.RepeatType.REPEAT_WEEKLY) {
				if (e.getRepeatDays()[date.getCalendar().get(Calendar.DAY_OF_WEEK) - 1]) {
					repsForDate.add(e);
				}
			} else if (e.getRepeatType() == Event.RepeatType.REPEAT_MONTHLY) {
				if (date.getCalendar().get(Calendar.DAY_OF_MONTH) == e.getPeriod()) {
					repsForDate.add(e);
				}
			} else if (e.getRepeatType() == Event.RepeatType.REPEAT_YEARLY) {
				int period = e.getPeriod();
				if ((date.getYear() % 4) == 0 && date.getCalendar().get(Calendar.DAY_OF_YEAR) > 60) {
					period++;
				}
				if (date.getCalendar().get(Calendar.DAY_OF_YEAR) == period) {
					repsForDate.add(e);
				}
			}
		}
	}

	return repsForDate;
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:47,代码来源:EventsManager.java

示例7: getRepeatableEventsForDate

import net.sf.memoranda.date.CalendarDate; //导入方法依赖的package包/类
public static Collection getRepeatableEventsForDate(CalendarDate date) {
	Vector reps = (Vector) getRepeatableEvents();
	Vector v = new Vector();
	for (int i = 0; i < reps.size(); i++) {
		Event ev = (Event) reps.get(i);
		
		// --- ivanrise
		// ignore this event if it's a 'only working days' event and today is weekend.
		if(ev.getWorkingDays() && (date.getCalendar().get(Calendar.DAY_OF_WEEK) == 1 ||
			date.getCalendar().get(Calendar.DAY_OF_WEEK) == 7)) continue;
		// ---
		/*
		 * /if ( ((date.after(ev.getStartDate())) &&
		 * (date.before(ev.getEndDate()))) ||
		 * (date.equals(ev.getStartDate()))
		 */
		//System.out.println(date.inPeriod(ev.getStartDate(),
		// ev.getEndDate()));
		if (date.inPeriod(ev.getStartDate(), ev.getEndDate())) {
			if (ev.getRepeat() == REPEAT_DAILY) {
				int n = date.getCalendar().get(Calendar.DAY_OF_YEAR);
				int ns =
					ev.getStartDate().getCalendar().get(
						Calendar.DAY_OF_YEAR);
				//System.out.println((n - ns) % ev.getPeriod());arg0
				if ((n - ns) % ev.getPeriod() == 0)
					v.add(ev);
			} else if (ev.getRepeat() == REPEAT_WEEKLY) {
				if (date.getCalendar().get(Calendar.DAY_OF_WEEK)
					== ev.getPeriod())
					v.add(ev);
			} else if (ev.getRepeat() == REPEAT_MONTHLY) {
				if (date.getCalendar().get(Calendar.DAY_OF_MONTH)
					== ev.getPeriod())
					v.add(ev);
			} else if (ev.getRepeat() == REPEAT_YEARLY) {
				int period = ev.getPeriod();
				//System.out.println(date.getCalendar().get(Calendar.DAY_OF_YEAR));
				if ((date.getYear() % 4) == 0
					&& date.getCalendar().get(Calendar.DAY_OF_YEAR) > 60)
					period++;

				if (date.getCalendar().get(Calendar.DAY_OF_YEAR) == period)
					v.add(ev);
			}
		}
	}
	return v;
}
 
开发者ID:ser316asu,项目名称:Wilmersdorf_SER316,代码行数:50,代码来源:EventsManager.java


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