01: /*
02: * @(#)DateWeekOfYearGrouper.java 5/19/2006
03: *
04: * Copyright 2002 - 2006 JIDE Software Inc. All rights reserved.
05: */
06:
07: package com.jidesoft.grouper.date;
08:
09: import com.jidesoft.grouper.GroupResources;
10: import com.jidesoft.grouper.GrouperContext;
11:
12: import java.util.Calendar;
13: import java.util.Locale;
14:
15: public class DateWeekOfYearGrouper extends DateGrouper {
16: public static GrouperContext CONTEXT = new GrouperContext(
17: "DateWeekOfYear");
18:
19: public Object getValue(Object value) {
20: return getCalendarField(value, Calendar.WEEK_OF_YEAR);
21: }
22:
23: public String getName() {
24: return GroupResources.getResourceBundle(Locale.getDefault())
25: .getString("Date.weekOfYear");
26: }
27: // public static void main(String[] args) {
28: // ObjectGrouper grouper = new DateWeekOfYearGrouper();
29: // Calendar calendar = Calendar.getInstance();
30: // for (int i = 0; i < 40; i++) {
31: // System.out.println(grouper.getValue(calendar));
32: // calendar.roll(Calendar.WEEK_OF_YEAR, 1);
33: // }
34: // }
35: }
|