From d75ecc051275e1e9e14ffb412cbcddf0671c7311 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 8 Mar 2008 15:38:29 +0000 Subject: [PATCH] Tweak method signature to match changes done in trunk git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@634991 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hssf/usermodel/HSSFRow.java | 23 +++++++++++++++---- .../org/apache/poi/ss/usermodel/Row.java | 4 +--- .../apache/poi/xssf/usermodel/XSSFRow.java | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java index 54229a16ab..712dcc99c5 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java @@ -299,17 +299,30 @@ public class HSSFRow } /** - * get the hssfcell representing a given column (logical cell) 0-based. If you - * ask for a cell that is not defined....you get a null. + * Get the hssfcell representing a given column (logical cell) + * 0-based. If you ask for a cell that is not defined.... + * you get a null. + * Short method signature provided to retain binary + * compatibility. * * @param cellnum 0 based column number * @return HSSFCell representing that column or null if undefined. */ - public HSSFCell getCell(short cellnum) { - if(cellnum<0||cellnum>=cells.length) return null; - return cells[cellnum]; + return getCell((int)cellnum); + } + /** + * Get the hssfcell representing a given column (logical cell) + * 0-based. If you ask for a cell that is not defined.... + * you get a null. + * + * @param cellnum 0 based column number + * @return HSSFCell representing that column or null if undefined. + */ + public HSSFCell getCell(int cellnum) { + if(cellnum<0||cellnum>=cells.length) return null; + return cells[cellnum]; } /** diff --git a/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java b/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java index b0b12cd25d..012ee81d04 100644 --- a/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java +++ b/src/ooxml/interfaces-jdk15/org/apache/poi/ss/usermodel/Row.java @@ -79,14 +79,12 @@ public interface Row extends Iterable { * @param cellnum 0 based column number * @return HSSFCell representing that column or null if undefined. */ - - Cell getCell(short cellnum); + Cell getCell(int cellnum); /** * get the number of the first cell contained in this row. * @return short representing the first logical cell in the row, or -1 if the row does not contain any cells. */ - short getFirstCellNum(); /** diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java index fc372de585..dba4188649 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFRow.java @@ -122,7 +122,7 @@ public class XSSFRow implements Row { return xcell; } - public Cell getCell(short cellnum) { + public Cell getCell(int cellnum) { Iterator it = cellIterator(); for ( ; it.hasNext() ; ) { Cell cell = it.next();