Path: blob/master/test/jdk/sun/util/calendar/zi/BackEnd.java
41153 views
/*1* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/**24* <code>BackEnd</code> is an abstract base class for a back-end of compiling25* Olson's zoneinfo database and generating Java zoneinfo database.26*27* @since 1.428*/29abstract class BackEnd {3031/**32* Receives each zone's TimeZone information which was created by33* {@link Zoneinfo#parse} in class <code>Zoneinfo</code>,34* and processes it.35*36* @param tz Timezone object for each zone37* @return 0 if no error occurred, otherwise 1.38*/39abstract int processZoneinfo(Timezone tz);4041/**42* Receives whole information which is generated by JavaZic's front-end43* in the form of Mapping object and generates all Java zone information44* files.45*46* @param m Mappings object which is generated by47* {@link Main#compile() Main.compile()}.48* @return 0 if no error occurred, otherwise 1.49*/50abstract int generateSrc(Mappings m);5152/**53* Decides which backend class should be used and returns its instance.54* @return an instance of backend class55*/56static BackEnd getBackEnd() {57if (Zoneinfo.isYearForTimeZoneDataSpecified) {58return new Simple();59} else if (Main.outputDoc) {60return new GenDoc();61} else {62return new Gen();63}64}65}666768