src/share/classes/java/text/CalendarBuilder.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -89,10 +89,19 @@
             index = DAY_OF_WEEK;
         }
         return field[index] > UNSET;
     }
 
+    CalendarBuilder clear(int index) {
+        if (index == ISO_DAY_OF_WEEK) {
+            index = DAY_OF_WEEK;
+        }
+        field[index] = UNSET;
+        field[MAX_FIELD + index] = 0;
+        return this;
+    }
+
     Calendar establish(Calendar cal) {
         boolean weekDate = isSet(WEEK_YEAR)
                             && field[WEEK_YEAR] > field[YEAR];
         if (weekDate && !cal.isWeekDateSupported()) {
             // Use YEAR instead