git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898297 13f79535-47bb-0310-9956-ffa450edef68tags/REL_5_2_1
boolean haveSerializedIndex = false; | boolean haveSerializedIndex = false; | ||||
for (int k = 0; k < _records.size(); k++) { | for (int k = 0; k < _records.size(); k++) { | ||||
RecordBase record = _records.get(k); | |||||
RecordBase recordBase = _records.get(k); | |||||
if (record instanceof RecordAggregate) { | |||||
RecordAggregate agg = (RecordAggregate) record; | |||||
if (recordBase instanceof RecordAggregate) { | |||||
RecordAggregate agg = (RecordAggregate) recordBase; | |||||
agg.visitContainedRecords(ptv); | agg.visitContainedRecords(ptv); | ||||
} else { | |||||
ptv.visitRecord((Record) record); | |||||
} else if (recordBase instanceof Record) { | |||||
ptv.visitRecord((Record) recordBase); | |||||
} | } | ||||
// If the BOF record was just serialized then add the IndexRecord | // If the BOF record was just serialized then add the IndexRecord | ||||
if (record instanceof BOFRecord) { | |||||
if (recordBase instanceof BOFRecord) { | |||||
if (!haveSerializedIndex) { | if (!haveSerializedIndex) { | ||||
haveSerializedIndex = true; | haveSerializedIndex = true; | ||||
// Add an optional UncalcedRecord. However, we should add | // Add an optional UncalcedRecord. However, we should add |
/* ==================================================================== | |||||
Licensed to the Apache Software Foundation (ASF) under one or more | |||||
contributor license agreements. See the NOTICE file distributed with | |||||
this work for additional information regarding copyright ownership. | |||||
The ASF licenses this file to You under the Apache License, Version 2.0 | |||||
(the "License"); you may not use this file except in compliance with | |||||
the License. You may obtain a copy of the License at | |||||
http://www.apache.org/licenses/LICENSE-2.0 | |||||
Unless required by applicable law or agreed to in writing, software | |||||
distributed under the License is distributed on an "AS IS" BASIS, | |||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
See the License for the specific language governing permissions and | |||||
limitations under the License. | |||||
==================================================================== */ | |||||
/* | |||||
* DateUtil.java | |||||
* | |||||
* Created on January 19, 2002, 9:30 AM | |||||
*/ | |||||
package org.apache.poi.hssf.usermodel; | |||||
import java.util.Calendar; | |||||
import org.apache.poi.ss.usermodel.DateUtil; | |||||
/** | |||||
* Contains methods for dealing with Excel dates. | |||||
* @deprecated Use {@link DateUtil} instead | |||||
*/ | |||||
@Deprecated | |||||
public final class HSSFDateUtil extends DateUtil { | |||||
protected static int absoluteDay(Calendar cal, boolean use1904windowing) { | |||||
return DateUtil.absoluteDay(cal, use1904windowing); | |||||
} | |||||
} |
} | } | ||||
} | } | ||||
if (refModeRecord == null) { | if (refModeRecord == null) { | ||||
continue; | |||||
//no-op | |||||
} else if (refModeRecord.getMode() == RefModeRecord.USE_R1C1_MODE) { | } else if (refModeRecord.getMode() == RefModeRecord.USE_R1C1_MODE) { | ||||
return CellReferenceType.R1C1; | return CellReferenceType.R1C1; | ||||
} else if (refModeRecord.getMode() == RefModeRecord.USE_A1_MODE) { | } else if (refModeRecord.getMode() == RefModeRecord.USE_A1_MODE) { | ||||
public List<HSSFPictureData> getAllPictures() { | public List<HSSFPictureData> getAllPictures() { | ||||
// The drawing group record always exists at the top level, so we won't need to do this recursively. | // The drawing group record always exists at the top level, so we won't need to do this recursively. | ||||
List<HSSFPictureData> pictures = new ArrayList<>(); | List<HSSFPictureData> pictures = new ArrayList<>(); | ||||
for (RecordBase r : workbook.getRecords()) { | |||||
for (org.apache.poi.hssf.record.Record r : workbook.getRecords()) { | |||||
if (r instanceof AbstractEscherHolderRecord) { | if (r instanceof AbstractEscherHolderRecord) { | ||||
((AbstractEscherHolderRecord) r).decode(); | ((AbstractEscherHolderRecord) r).decode(); | ||||
List<EscherRecord> escherRecords = ((AbstractEscherHolderRecord) r).getEscherRecords(); | List<EscherRecord> escherRecords = ((AbstractEscherHolderRecord) r).getEscherRecords(); |
public static final WorkdayCalculator instance = new WorkdayCalculator(); | public static final WorkdayCalculator instance = new WorkdayCalculator(); | ||||
private static final Set<Integer> standardWeekend = | private static final Set<Integer> standardWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.SATURDAY, Calendar.SUNDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.SATURDAY, Calendar.SUNDAY)); | |||||
private static final Set<Integer> sunMonWeekend = | private static final Set<Integer> sunMonWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.SUNDAY, Calendar.MONDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.SUNDAY, Calendar.MONDAY)); | |||||
private static final Set<Integer> monTuesWeekend = | private static final Set<Integer> monTuesWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.MONDAY, Calendar.TUESDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.MONDAY, Calendar.TUESDAY)); | |||||
private static final Set<Integer> tuesWedsWeekend = | private static final Set<Integer> tuesWedsWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.TUESDAY, Calendar.WEDNESDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.TUESDAY, Calendar.WEDNESDAY)); | |||||
private static final Set<Integer> wedsThursWeekend = | private static final Set<Integer> wedsThursWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.WEDNESDAY, Calendar.THURSDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.WEDNESDAY, Calendar.THURSDAY)); | |||||
private static final Set<Integer> thursFriWeekend = | private static final Set<Integer> thursFriWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.THURSDAY, Calendar.FRIDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.THURSDAY, Calendar.FRIDAY)); | |||||
private static final Set<Integer> friSatWeekend = | private static final Set<Integer> friSatWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.FRIDAY, Calendar.SATURDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.FRIDAY, Calendar.SATURDAY)); | |||||
private static final Set<Integer> monWeekend = | private static final Set<Integer> monWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.MONDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.MONDAY)); | |||||
private static final Set<Integer> tuesWeekend = | private static final Set<Integer> tuesWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.TUESDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.TUESDAY)); | |||||
private static final Set<Integer> wedsWeekend = | private static final Set<Integer> wedsWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.WEDNESDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.WEDNESDAY)); | |||||
private static final Set<Integer> thursWeekend = | private static final Set<Integer> thursWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.THURSDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.THURSDAY)); | |||||
private static final Set<Integer> friWeekend = | private static final Set<Integer> friWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.FRIDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.FRIDAY)); | |||||
private static final Set<Integer> satWeekend = | private static final Set<Integer> satWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.SATURDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.SATURDAY)); | |||||
private static final Set<Integer> sunWeekend = | private static final Set<Integer> sunWeekend = | ||||
new HashSet<>(Arrays.asList(new Integer[]{Calendar.SUNDAY})); | |||||
new HashSet<>(Arrays.asList(Calendar.SUNDAY)); | |||||
private static final Map<Integer, Set<Integer>> weekendTypeMap = new HashMap<>(); | private static final Map<Integer, Set<Integer>> weekendTypeMap = new HashMap<>(); | ||||
static { | static { |
import org.apache.poi.ss.formula.eval.OperandResolver; | import org.apache.poi.ss.formula.eval.OperandResolver; | ||||
import org.apache.poi.ss.formula.eval.ValueEval; | import org.apache.poi.ss.formula.eval.ValueEval; | ||||
import java.math.BigDecimal; | |||||
import java.math.MathContext; | |||||
/** | /** | ||||
* Implementation for Excel BESSELJ() function. | * Implementation for Excel BESSELJ() function. | ||||
* <p> | * <p> |
import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
import java.math.MathContext; | import java.math.MathContext; | ||||
import java.text.NumberFormat; | |||||
import java.util.Locale; | |||||
/** | /** | ||||
* Implementation for Excel DOLLARFR() function. | * Implementation for Excel DOLLARFR() function. |
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
import java.time.LocalTime; | import java.time.LocalTime; | ||||
import java.time.ZoneId; | import java.time.ZoneId; | ||||
import java.time.ZoneOffset; | |||||
import java.time.format.DateTimeFormatter; | import java.time.format.DateTimeFormatter; | ||||
import java.time.format.DateTimeFormatterBuilder; | import java.time.format.DateTimeFormatterBuilder; | ||||
import java.time.temporal.ChronoField; | import java.time.temporal.ChronoField; | ||||
* Contains methods for dealing with Excel dates. | * Contains methods for dealing with Excel dates. | ||||
*/ | */ | ||||
public class DateUtil { | public class DateUtil { | ||||
// FIXME this should be changed to private and the class marked final once HSSFDateUtil can be removed | |||||
protected DateUtil() { | |||||
private DateUtil() { | |||||
// no instances of this class | // no instances of this class | ||||
} | } | ||||