/* ==================================================================== 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. ==================================================================== */ package org.apache.poi.ss; import org.apache.poi.ss.util.CellReference; /** * This enum allows spreadsheets from multiple Excel versions to be handled by the common code. * Properties of this enum correspond to attributes of the spreadsheet that are easily * discernable to the user. It is not intended to deal with low-level issues like file formats. *
* * @author Josh Micich * @author Yegor Kozlov */ public enum SpreadsheetVersion { /** * Excel97 format aka BIFF8 * getMaxRows() - 1
*/
public int getLastRowIndex() {
return _maxRows - 1;
}
/**
* @return the maximum number of usable columns in each spreadsheet
*/
public int getMaxColumns() {
return _maxColumns;
}
/**
* @return the last (maximum) valid column index, equals to getMaxColumns() - 1
*/
public int getLastColumnIndex() {
return _maxColumns - 1;
}
/**
* @return the maximum number arguments that can be passed to a multi-arg
* function (e.g. COUNTIF)
*/
public int getMaxFunctionArgs() {
return _maxFunctionArgs;
}
/**
*
* @return the maximum number of conditional format conditions on a cell
*/
public int getMaxConditionalFormats() {
return _maxCondFormats;
}
/**
*
* @return the last valid column index in a ALPHA-26 representation
* ( IV
or XFD
).
*/
public String getLastColumnName() {
return CellReference.convertNumToColString(getLastColumnIndex());
}
}