本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}