mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
https://svn.apache.org/repos/asf/poi/trunk ........ r690404 | josh | 2008-08-29 23:08:42 +0100 (Fri, 29 Aug 2008) | 1 line Clean-up toString() and inner class ........ r690411 | josh | 2008-08-29 23:21:10 +0100 (Fri, 29 Aug 2008) | 1 line Added ArrayRecord and CellRangeAddress8Bit ........ r690461 | josh | 2008-08-30 05:34:01 +0100 (Sat, 30 Aug 2008) | 1 line Fixed decoding of operand class for ArrayPtg ........ r690517 | nick | 2008-08-30 15:47:33 +0100 (Sat, 30 Aug 2008) | 1 line Various bug fixes, and hpbf updates ........ git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@690533 13f79535-47bb-0310-9956-ffa450edef68
54 lines
1.9 KiB
Java
54 lines
1.9 KiB
Java
/* ====================================================================
|
|
Copyright 2002-2004 Apache Software Foundation
|
|
|
|
Licensed 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.util;
|
|
|
|
import org.apache.poi.hssf.record.SelectionRecord;
|
|
import org.apache.poi.util.LittleEndian;
|
|
|
|
/**
|
|
* See OOO documentation: excelfileformat.pdf sec 2.5.14 - 'Cell Range Address'<p/>
|
|
*
|
|
* Note - {@link SelectionRecord} uses the BIFF5 version of this structure
|
|
* @author Dragos Buleandra (dragos.buleandra@trade2b.ro)
|
|
*/
|
|
public class CellRangeAddress extends CellRangeAddressBase {
|
|
/*
|
|
* TODO - replace org.apache.poi.hssf.util.Region
|
|
*/
|
|
public static final int ENCODED_SIZE = 8;
|
|
|
|
public CellRangeAddress(int firstRow, int lastRow, int firstCol, int lastCol) {
|
|
super(firstRow, lastRow, firstCol, lastCol);
|
|
}
|
|
|
|
public int serialize(int offset, byte[] data) {
|
|
LittleEndian.putUShort(data, offset + 0, getFirstRow());
|
|
LittleEndian.putUShort(data, offset + 2, getLastRow());
|
|
LittleEndian.putUShort(data, offset + 4, getFirstColumn());
|
|
LittleEndian.putUShort(data, offset + 6, getLastColumn());
|
|
return ENCODED_SIZE;
|
|
}
|
|
|
|
public CellRangeAddress copy() {
|
|
return new CellRangeAddress(getFirstRow(), getLastRow(), getFirstColumn(), getLastColumn());
|
|
}
|
|
|
|
public static int getEncodedSize(int numberOfItems) {
|
|
return numberOfItems * ENCODED_SIZE;
|
|
}
|
|
}
|