0N/A/*
2362N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage sun.util.calendar;
0N/A
0N/Aimport java.util.Locale;
0N/Aimport java.util.TimeZone;
0N/A
0N/Aclass ImmutableGregorianDate extends BaseCalendar.Date {
0N/A private final BaseCalendar.Date date;
0N/A
0N/A ImmutableGregorianDate(BaseCalendar.Date date) {
0N/A if (date == null) {
0N/A throw new NullPointerException();
0N/A }
0N/A this.date = date;
0N/A }
0N/A
0N/A public Era getEra() {
0N/A return date.getEra();
0N/A }
0N/A
0N/A public CalendarDate setEra(Era era) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public int getYear() {
0N/A return date.getYear();
0N/A }
0N/A
0N/A public CalendarDate setYear(int year) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addYear(int n) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public boolean isLeapYear() {
0N/A return date.isLeapYear();
0N/A }
0N/A
0N/A void setLeapYear(boolean leapYear) {
0N/A unsupported();
0N/A }
0N/A
0N/A public int getMonth() {
0N/A return date.getMonth();
0N/A }
0N/A
0N/A public CalendarDate setMonth(int month) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addMonth(int n) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public int getDayOfMonth() {
0N/A return date.getDayOfMonth();
0N/A }
0N/A
0N/A public CalendarDate setDayOfMonth(int date) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addDayOfMonth(int n) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public int getDayOfWeek() {
0N/A return date.getDayOfWeek();
0N/A }
0N/A
0N/A public int getHours() {
0N/A return date.getHours();
0N/A }
0N/A
0N/A public CalendarDate setHours(int hours) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addHours(int n) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public int getMinutes() {
0N/A return date.getMinutes();
0N/A }
0N/A
0N/A public CalendarDate setMinutes(int minutes) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addMinutes(int n) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public int getSeconds() {
0N/A return date.getSeconds();
0N/A }
0N/A
0N/A public CalendarDate setSeconds(int seconds) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addSeconds(int n) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public int getMillis() {
0N/A return date.getMillis();
0N/A }
0N/A
0N/A public CalendarDate setMillis(int millis) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addMillis(int n) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public long getTimeOfDay() {
0N/A return date.getTimeOfDay();
0N/A }
0N/A
0N/A public CalendarDate setDate(int year, int month, int dayOfMonth) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addDate(int year, int month, int dayOfMonth) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate setTimeOfDay(int hours, int minutes, int seconds, int millis) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public CalendarDate addTimeOfDay(int hours, int minutes, int seconds, int millis) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A protected void setTimeOfDay(long fraction) {
0N/A unsupported();
0N/A }
0N/A
0N/A public boolean isNormalized() {
0N/A return date.isNormalized();
0N/A }
0N/A
0N/A public boolean isStandardTime() {
0N/A return date.isStandardTime();
0N/A }
0N/A
0N/A public void setStandardTime(boolean standardTime) {
0N/A unsupported();
0N/A }
0N/A
0N/A public boolean isDaylightTime() {
0N/A return date.isDaylightTime();
0N/A }
0N/A
0N/A protected void setLocale(Locale loc) {
0N/A unsupported();
0N/A }
0N/A
0N/A public TimeZone getZone() {
0N/A return date.getZone();
0N/A }
0N/A
0N/A public CalendarDate setZone(TimeZone zoneinfo) {
0N/A unsupported(); return this;
0N/A }
0N/A
0N/A public boolean isSameDate(CalendarDate date) {
0N/A return date.isSameDate(date);
0N/A }
0N/A
0N/A public boolean equals(Object obj) {
0N/A if (this == obj) {
0N/A return true;
0N/A }
0N/A if (!(obj instanceof ImmutableGregorianDate)) {
0N/A return false;
0N/A }
0N/A return date.equals(((ImmutableGregorianDate) obj).date);
0N/A }
0N/A
0N/A public int hashCode() {
0N/A return date.hashCode();
0N/A }
0N/A
0N/A public Object clone() {
0N/A return super.clone();
0N/A }
0N/A
0N/A public String toString() {
0N/A return date.toString();
0N/A }
0N/A
0N/A protected void setDayOfWeek(int dayOfWeek) {
0N/A unsupported();
0N/A }
0N/A
0N/A protected void setNormalized(boolean normalized) {
0N/A unsupported();
0N/A }
0N/A
0N/A public int getZoneOffset() {
0N/A return date.getZoneOffset();
0N/A }
0N/A
0N/A protected void setZoneOffset(int offset) {
0N/A unsupported();
0N/A }
0N/A
0N/A public int getDaylightSaving() {
0N/A return date.getDaylightSaving();
0N/A }
0N/A
0N/A protected void setDaylightSaving(int daylightSaving) {
0N/A unsupported();
0N/A }
0N/A
0N/A public int getNormalizedYear() {
0N/A return date.getNormalizedYear();
0N/A }
0N/A
0N/A public void setNormalizedYear(int normalizedYear) {
0N/A unsupported();
0N/A }
0N/A
0N/A private void unsupported() {
0N/A throw new UnsupportedOperationException();
0N/A }
0N/A}