Common abstract class for {@link EscherOptRecord} and
{@link EscherTertiaryOptRecord}
@author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
@author Glen Stampoultzis
The base abstract record from which all escher records are defined. Subclasses will need
to define methods for serialization/deserialization and for determining the record size.
@author Glen Stampoultzis
Initializes a new instance of the class.
Delegates to FillFields(byte[], int, EscherRecordFactory)
The data.
The f.
The contract of this method is to deSerialize an escher record including
it's children.
The byte array containing the Serialized escher
records.
The offset into the byte array.
A factory for creating new escher records.
The number of bytes written.
Reads the 8 byte header information and populates the
options
and
recordId
records.
the byte array to Read from
the offset to start Reading from
the number of bytes remaining in this record. This
Read the options field from header and return instance part of it.
the byte array to read from
the offset to start reading from
value of instance part of options field
Serializes to a new byte array. This is done by delegating to
Serialize(int, byte[]);
the Serialized record.
Serializes to an existing byte array without serialization listener.
This is done by delegating to Serialize(int, byte[], EscherSerializationListener).
the offset within the data byte array.
the data array to Serialize to.
The number of bytes written.
Serializes the record to an existing byte array.
the offset within the byte array.
the offset within the byte array
a listener for begin and end serialization events. This.
is useful because the serialization is
hierarchical/recursive and sometimes you need to be able
break into that.
Creates a new object that is a copy of the current instance.
A new object that is a copy of this instance.
Returns the indexed child record.
The index.
The display methods allows escher variables to print the record names
according to their hierarchy.
The current indent level.
@param tab - each children must be a right of his parent
@return xml representation of this record
Determine whether this is a container record by inspecting the option
field.
true if this instance is container record; otherwise, false.
Gets or sets the options field for this record. All records have one
The options.
Subclasses should effeciently return the number of bytes required to
Serialize the record.
number of bytes
Return the current record id.
The 16 bit record id.
Gets or sets the child records.
Returns the children of this record. By default this will
be an empty list. EscherCotainerRecord is the only record that may contain children.
Gets the name of the record.
The name of the record.
Get or set the instance part of the option record.
Get or set the version part of the option record.
This class Reads the standard escher header.
Reads the header.
The data.
The off set.
Returns a that represents the current .
A that represents the current .
Gets the options.
The options.
Gets the record id.
The record id.
Gets the remaining bytes.
The remaining bytes.
Add a property to this record.
The list of properties stored by this record.
Records should be sorted by property number before being stored.
* Set an escher property. If a property with given propId already
exists it is replaced.
*
* @param value the property to set.
Retrieve the string representation of this record.
The list of properties stored by this record.
"The OfficeArtTertiaryFOPT record specifies a table of OfficeArtRGFOPTE properties, as defined in section 2.3.1."
-- [MS-ODRAW] -- v20110608; Office Drawing Binary File Format
@author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
The Character Encoding is not supported.
@author Asmus Freytag
@since JDK1.1
Constructs an UnsupportedEncodingException without a detail message.
Constructs an UnsupportedEncodingException with a detail message.
@param s Describes the reason for the exception.
@return maximum 1-base index of column that were rendered, zero if none
Creates COLGROUP element with width specified for all columns. (Except
first if {@link #isOutputRowNumbers()}==true)
是否输出列头
是否输出隐藏的列
是否输出隐藏的行
是否输出文本前的空格
是否输出行号
在跨列的单元格使用DIV标记
Creates a map (i.e. two-dimensional array) filled with ranges. Allow fast
retrieving {@link CellRangeAddress} of any cell, if cell is contained in
range.
@see #getMergedRange(CellRangeAddress[][], int, int)
See here for Xio explanation and details
@param mergedRanges
map of sheet merged ranges built with
{@link #buildMergedRangesMap(HSSFSheet)}
@return {@link CellRangeAddress} from map if cell with specified row and
column numbers contained in found range, null otherwise
ATTACHEDLABEL = Text Begin Pos [FontX] [AlRuns] AI [FRAME] [ObjectLink] [DataLabExtContents] [CrtLayout12] [TEXTPROPS] [CRTMLFRT] End
AI = BRAI [SeriesText]
RecordAggregates are groups of of BIFF Records that are typically stored
together and/or updated together. Workbook / Sheet records are typically stored in a sequential
list, which does not provide much structure to coordinate updates.
@author Josh Micich
Common base class of {@link Record} and {@link RecordAggregate}
@author Josh Micich
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array.
@param offset to begin writing at
@param data byte array containing instance data
@return number of bytes written
gives the current serialized size of the record. Should include the sid
and reclength (4 bytes).
Visit each of the atomic BIFF records contained in this {@link RecordAggregate} in the order
that they should be written to file. Implementors may or may not return the actual
{@link Record}s being used to manage POI's internal implementation. Callers should not
assume either way, and therefore only attempt to modify those {@link Record}s after cloning
Implementors may call non-mutating methods on Record r.
@param r must not be null
AXES = [IVAXIS DVAXIS [SERIESAXIS] / DVAXIS DVAXIS] *3ATTACHEDLABEL [PlotArea FRAME]
AXISPARENT = AxisParent Begin Pos [AXES] 1*4CRT End
AXM = YMult StartObject ATTACHEDLABEL EndObject
AXS = [IFmtRecord] [Tick] [FontX] *4(AxisLine LineFormat) [AreaFormat]
[GELFRAME] *4SHAPEPROPS [TextPropsStream *ContinueFrt12]
CHARTFOMATS = Chart Begin *2FONTLIST Scl PlotGrowth [FRAME] *SERIESFORMAT *SS ShtProps
*2DFTTEXT AxesUsed 1*2AXISPARENT [CrtLayout12A] [DAT] *ATTACHEDLABEL [CRTMLFRT]
*([DataLabExt StartObject] ATTACHEDLABEL [EndObject]) [TEXTPROPS] *2CRTMLFRT End
CHARTSHEET = BOF CHARTSHEETCONTENT
CHARTSHEETCONTENT = [WriteProtect] [SheetExt] [WebPub] *HFPicture PAGESETUP PrintSize
[HeaderFooter] [BACKGROUND] *Fbi *Fbi2 [ClrtClient] [PROTECTION] [Palette] [SXViewLink]
[PivotChartBits] [SBaseRef] [MsoDrawingGroup] OBJECTS Units CHARTFOMATS SERIESDATA
*WINDOW *CUSTOMVIEW [CodeName] [CRTMLFRT] EOF
All the records between BOF and EOF
CRT = ChartFormat Begin (Bar / Line / (BopPop [BopPopCustom]) / Pie / Area / Scatter / Radar /
RadarArea / Surf) CrtLink [SeriesList] [Chart3d] [LD] [2DROPBAR] *4(CrtLine LineFormat)
*2DFTTEXT [DataLabExtContents] [SS] *4SHAPEPROPS End
CRTMLFRT = CrtMlFrt *CrtMlFrtContinue
DAT = Dat Begin LD End
DFTTEXT = [DataLabExt StartObject] DefaultText ATTACHEDLABEL [EndObject]
DROPBAR = DropBar Begin LineFormat AreaFormat [GELFRAME] [SHAPEPROPS] End
DVAXIS = Axis Begin [ValueRange] [AXM] AXS [CRTMLFRT] End
FONTLIST = FrtFontList StartObject *(Font [Fbi]) EndObject
FRAME = Frame Begin LineFormat AreaFormat [GELFRAME] [SHAPEPROPS] End
GELFRAME = 1*2GelFrame *Continue [PICF]
PICF = Begin PicF End
IVAXIS = Axis Begin [CatSerRange] AxcExt [CatLab] AXS [CRTMLFRT] End
LD = Legend Begin Pos ATTACHEDLABEL [FRAME] [CrtLayout12] [TEXTPROPS] [CRTMLFRT] End
SERIESAXIS = Axis Begin [CatSerRange] AXS [CRTMLFRT] End
SERIESDATA = Dimensions 3(SIIndex *(Number / BoolErr / Blank / Label))
SERIESFORMAT = Series Begin 4AI *SS (SerToCrt / (SerParent (SerAuxTrend / SerAuxErrBar)))
*(LegendException [Begin ATTACHEDLABEL [TEXTPROPS] End]) End
LegendException [Begin ATTACHEDLABEL [TEXTPROPS] End]
SHAPEPROPS = ShapePropsStream *ContinueFrt12
SS = DataFormat Begin [Chart3DBarShape] [LineFormat AreaFormat PieFormat] [SerFmt]
[GELFRAME] [MarkerFormat] [AttachedLabel] *2SHAPEPROPS [CRTMLFRT] End
TEXTPROPS = (RichTextStream / TextPropsStream) *ContinueFrt12
The AlRuns record specifies Rich Text Formatting within chart
titles (section 2.2.3.3), trendline (section 2.2.3.12), and
data labels (section 2.2.3.11).
Subclasses of this class (the majority of BIFF records) are non-continuable. This allows for
some simplification of serialization logic
@author Josh Micich
Title: Record
Description: All HSSF Records inherit from this class. It
populates the fields common to all records (id, size and data).
Subclasses should be sure to validate the id,
Company:
@author Andrew C. Oliver
@author Marc Johnson (mjohnson at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
instantiates a blank record strictly for ID matching
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array.
@return byte array containing instance data
return the non static version of the id for this record.
Write the data content of this BIFF record including the sid and record length.
The subclass must write the exact number of bytes as reported by Record#getRecordSize()
offset
data
Write the data content of this BIFF record. The 'ushort sid' and 'ushort size' header fields
have already been written by the superclass.
The number of bytes written must equal the record size reported by
{@link Record#getDataSize()} minus four
( record header consiting of a 'ushort sid' and 'ushort reclength' has already been written
by thye superclass).
* The series label record defines the type of label associated with the data format record.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a SeriesLabels record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the format flags field for the SeriesLabels record.
show actual value of the data point
@return the show actual field value.
show value as percentage of total (pie charts only)
@return the show percent field value.
show category label/value as percentage (pie charts only)
@return the label as percentage field value.
show smooth line
@return the smoothed line field value.
Display category label
@return the show label field value.
??
@return the show bubble sizes field value.
The AxcExt record specifies additional extension properties of a date axis (section 2.2.3.6),
along with a CatSerRange record (section 2.4.39).
specifies the interval at which the major tick marks are displayed on the axis (section 2.2.3.6),
in the unit defined by duMajor.
specifies the unit of time to use for catMajor when the axis (section 2.2.3.6) is a date axis (section 2.2.3.6).
If fDateAxis is set to 0, MUST be ignored.
specifies the interval at which the minor tick marks are displayed on the axis (section 2.2.3.6),
in a unit defined by duMinor.
specifies the smallest unit of time used by the axis (section 2.2.3.6).
specifies at which date, as a date in the date system specified by the Date1904 record (section 2.4.77),
in the units defined by duBase, the value axis (section 2.2.3.6) crosses this axis (section 2.2.3.6).
specifies whether MinimumDate is calculated automatically.
specifies whether MaximumDate is calculated automatically.
* The number of axes used on a chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a AxisUsed record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the num axis field for the AxisUsed record.
The axis (section 2.2.3.6) line itself.
The major gridlines along the axis
The minor gridlines along the axis
The walls or floor of a 3-D chart
The AxisLine record specifies which part of the axis (section 2.2.3.6) is
specified by the LineFormat record (section 2.4.156) that follows.
Excel Binary File Format (.xls) Structure Specification
Constructs a AxisLineFormat record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
The BopPopCustom record specifies which data points in the series are contained
in the secondary bar/pie instead of the primary pie. MUST follow a BopPop record
that has its split field set to Custom (0x0003).
author: Antony liu (antony.apollo at gmail.com)
this record only used for record that has name and not implemented.
The BopPop record specifies that the chart group is a bar of pie chart group or
a pie of pie chart group and specifies the chart group attributes.
author: Antony liu (antony.apollo at gmail.com)
The BRAI record specifies a reference to data in a sheet (1) that is used by a part of a series,
legend entry, trendline or error bars.
A ChartParsedFormula structure that specifies the formula (section 2.2.2) that specifies the reference.
Constructs a LinkedData record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
specifies the part of the series, trendline, or error bars the referenced data specifies.
specifies the number format to use for the data.
specifies the properties of a category (3) axis, a date axis, or a series axis.
Constructs a CategorySeriesAxis record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
specifies where the value axis crosses this axis, based on the following table.
If fMaxCross is set to 1, the value this field MUST be ignored.
Category (3) axis This field specifies the category (3) at which the value axis crosses.
For example, if this field is 2, the value axis crosses this axis at the second category (3)
on this axis. MUST be greater than or equal to 1 and less than or equal to 31999.
Series axis MUST be 0.
Date axis catCross MUST be equal to the value given by the following formula:
catCross = catCrossDate – catMin + 1
Where catCrossDate is the catCrossDate field of the AxcExt record
and catMin is the catMin field of the AxcExt record.
specifies the interval between axis labels on this axis. MUST be greater than or equal to 1 and
less than or equal to 31999. MUST be ignored for a date axis.
specifies the interval at which major tick marks and minor tick marks are displayed on the axis.
Major tick marks and minor tick marks that would have been visible are hidden unless they are
located at a multiple of this field.
specifies whether the value axis crosses this axis between major tick marks. MUST be a value from to following table:
0 The value axis crosses this axis on a major tick mark.
1 The value axis crosses this axis between major tick marks.
specifies whether the value axis crosses this axis at the last category (3), the last series,
or the maximum date. MUST be a value from the following table:
0 The value axis crosses this axis at the value specified by catCross.
1 The value axis crosses this axis at the last category (3), the last series, or the maximum date.
specifies whether the axis is displayed in reverse order. MUST be a value from the following table:
0 The axis is displayed in order.
1 The axis is display in reverse order.
the shape of the base of the data points in a bar or column chart group.
MUST be a value from the following table
0x00 The base of the data point is a rectangle.
0x01 The base of the data point is an ellipse.
how the data points in a bar or column chart group taper from base to tip.
MUST be a value from the following
0x00 The data points of the bar or column chart group do not taper.
The shape at the maximum value of the data point is the same as the shape at the base.:
0x01 The data points of the bar or column chart group taper to a point at the maximum value of each data point.
0x02 The data points of the bar or column chart group taper towards a projected point at the position of
the maximum value of all of the data points in the chart group, but are clipped at the value of each data point.
The CrtLine record specifies the presence of drop lines, high-low lines, series lines
or leader lines on the chart group. This record is followed by a LineFormat record
which specifies the format of the lines.
author: Antony liu (antony.apollo at gmail.com)
The CrtMlFrtContinue record specifies additional data for a CrtMlFrt record, as specified in the CrtMlFrt record.
author: Antony liu (antony.apollo at gmail.com)
The DataLabExtContents record specifies the contents of an extended data label.
DATALABEXT - Chart Data Label Extension (0x086A)
@author Patrick Cheng
specifies the text elements that are formatted using the position and appearance information
specified by the Text record immediately following this record.
Format all Text records in the chart group where fShowPercent is equal to 0 or fShowValue is equal to 0.
Format all Text records in the chart group where fShowPercent is equal to 1 or fShowValue is equal to 1.
Format all Text records in the chart where the value of fScaled of the associated FontInfo structure is equal to 0.
Format all Text records in the chart where the value of fScaled of the associated FontInfo structure is equal to 1.
specifies the text elements that are formatted using the information specified by
the Text record immediately following this record.
Constructs a DefaultDataLabelTextProperties record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
specifies the text elements that are formatted using the position and appearance
information specified by the Text record immediately following this record.
The DropBar record specifies the attributes of the up bars or the down bars between multiple
series of a line chart group and specifies the beginning of a collection of records as
defined by the Chart Sheet Substream ABNF. The first of these collections in the line chart
group specifies the attributes of the up bars. The second specifies the attributes of the
down bars. If this record exists, then the chart group type MUST be line and the field cSer
in the record SeriesList MUST be greater than 1.
author: Antony liu (antony.apollo at gmail.com)
ENDBLOCK - Chart Future Record Type End Block (0x0853)
@author Patrick Cheng
The Fbi2 record specifies the font information at the time the scalable font is added to the chart.
author: Antony liu (antony.apollo at gmail.com)
The Fbi record specifies the font information at the time the scalable font is added to the chart.
Constructs a FontBasis record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the x Basis field for the FontBasis record.
Get the y Basis field for the FontBasis record.
Get the height basis field for the FontBasis record.
Get the scale field for the FontBasis record.
Get the index to font table field for the FontBasis record.
The FontX record specifies the font for a given text element.
The Font record referenced by iFont can exist in this chart sheet substream or the workbook.
Constructs a FontIndex record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
specifies the font to use for subsequent records.
This font can either be the default font of the chart, part of the collection of Font records following
the FrtFontList record, or part of the collection of Font records in the globals substream.
If iFont is 0x0000, this record specifies the default font of the chart.
If iFont is less than or equal to the number of Font records in the globals substream,
iFont is a one-based index to a Font record in the globals substream.
Otherwise iFont is a one-based index into the collection of Font records in this chart sheet substream
where the index is equal to iFont – n, where n is the number of Font records in the globals substream.
The FrtFontList record specifies font information used on the chart and specifies the
beginning of a collection of Font records as defined by the Chart Sheet Substream ABNF.
author: Antony liu (antony.apollo at gmail.com)
specifies the properties of a fill pattern for parts of a chart.
author: Antony liu (antony.apollo at gmail.com)
The IFmtRecord record specifies the number format to use for the text on an axis.
Constructs a NumberFormatIndex record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the format index field for the NumberFormatIndex record.
The LegendException record specifies information about a legend entry which was
changed from the default legend entry settings, and specifies the beginning of
a collection of records as defined by the Chart Sheet Substream ABNF.
The collection of records specifies legend entry formatting. On a chart where
the legend contains legend entries for the series and trendlines, as defined
in the legend overview, there MUST be zero instances or one instance of this
record in the sequence of records that conform to the SERIESFORMAT rule.
author: Antony liu (antony.apollo at gmail.com)
The PicF record specifies the layout of a picture that is attached to a picture-filled chart element.
author: Antony liu (antony.apollo at gmail.com)
The RadarArea record specifies that the chart group is a filled radar chart group and specifies the chart group attributes.
author: Antony liu (antony.apollo at gmail.com)
The Radar record specifies that the chart group is a radar chart group and specifies the chart group attributes.
author: Antony liu (antony.apollo at gmail.com)
The RichTextStream record specifies additional text properties for the text in
the entire chart, text in the current legend, text in the current legend entry,
or text in the attached label. These text properties are a superset of the
properties stored in the Text, Font, FontX, BRAI, and ObjectLink records based
on the following table, as specified by the Chart Sheet Substream ABNF. In each
case, the associated Font record is specified by the associated FontX record.
author: Antony liu (antony.apollo at gmail.com)
The Scatter record specifies that the chart group is a scatter chart group or
a bubble chart group, and specifies the chart group attributes.
author: Antony liu (antony.apollo at gmail.com)
The SerAuxErrBar record specifies properties of an error bar.
author: Antony liu (antony.apollo at gmail.com)
The SerAuxTrend record specifies a trendline.
author: Antony liu (antony.apollo at gmail.com)
The SerFmt record specifies properties of the associated data points, data markers,
or lines of the series. The associated data points, data markers, or lines of the
series are specified by the preceding DataFormat record. If this record is not
present in the sequence of records that conforms to the SS rule of the Chart Sheet
Substream ABNF, then the properties of the associated data points, data markers,
or lines of the series are specified by the default values of the fields of this record.
author: Antony liu (antony.apollo at gmail.com)
The SerParent record specifies the series to which the current trendline or error bar corresponds.
author: Antony liu (antony.apollo at gmail.com)
The SerToCrt record specifies the chart group for the current series.
Constructs a SeriesChartGroupIndex record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the chart Group index field for the SeriesChartGroupIndex record.
The ShapePropsStream record specifies the shape formatting properties for chart elements.
These shape formatting properties are a superset of the properties stored in the LineFormat,
AreaFormat, MarkerFormat, and GelFrame records. They are stored in the rgb field, which is an
XML stream (section 2.1.7.22), as defined in [ECMA-376] Part 4, section 5.7.2.198.
author: Antony liu (antony.apollo at gmail.com)
* Describes a chart sheet properties record.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
specifies properties of a chart as defined by the Chart Sheet Substream ABNF
Constructs a SheetProperties record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the flags field for the SheetProperties record.
Get the empty field for the SheetProperties record.
@return One of
EMPTY_NOT_PLOTTED
EMPTY_ZERO
EMPTY_INTERPOLATED
specifies how the empty cells are plotted be a value from the following table:
0x00 Empty cells are not plotted.
0x01 Empty cells are plotted as zero.
0x02 Empty cells are plotted as interpolated.
whether series are automatically allocated for the chart.
whether to plot visible cells only.
whether to size the chart with the window.
If fAlwaysAutoPlotArea is 1, then this field MUST be 1.
If fAlwaysAutoPlotArea is 0, then this field MUST be ignored.
specifies whether the default plot area dimension (2) is used.
0 Use the default plot area dimension (2) regardless of the Pos record information.
1 Use the plot area dimension (2) of the Pos record; and fManPlotArea MUST be 1.
STARTBLOCK - Chart Future Record Type Start Block (0x0852)
@author Patrick Cheng
The Surf record specifies that the chart group is a surface chart group and specifies the chart group attributes.
author: Antony liu (antony.apollo at gmail.com)
The RichTextStream record specifies additional text properties for the text
in the entire chart, text in the current legend, text in the current legend
entry, or text in the attached label. These text properties are a superset
of the properties stored in the Text, Font, FontX, BRAI, and ObjectLink records
based on the following table, as specified by the Chart Sheet Substream ABNF.
In each case, the associated Font record is specified by the associated FontX record.
author: Antony liu (antony.apollo at gmail.com)
The YMult record specifies properties of the value multiplier for a value axis and
that specifies the beginning of a collection of records as defined by the Chart Sheet
substream ABNF. The collection of records specifies a display units label.
author: Antony liu (antony.apollo at gmail.com)
The ContinueFrt12 record specifies a continuation of the data in a preceding Future Record
Type record that has data longer than 8,224 bytes. Such records are split into several records.
The first section of the data appears in the base record and subsequent sections appear in
one or more ContinueFrt12 records that appear after the base record. The preceding base record
MUST contain a FrtRefHeader or a FrtHeader field.
author: Antony liu (antony.apollo at gmail.com)
DConRef records specify a range in a workbook (internal or external) that serves as a data source
for pivot tables or data consolidation.
Represents a DConRef
Structure
[MS-XLS s.
2.4.86], and the contained DConFile
structure
[MS-XLS s. 2.5.69]. This in turn contains a XLUnicodeStringNoCch
[MS-XLS s. 2.5.296].
_______________________________
| DConRef |
(bytes) +-+-+-+-+-+-+-+-+-+-+...+-+-+-+-+
| ref |cch| stFile | un|
+-+-+-+-+-+-+-+-+-+-+...+-+-+-+-+
|
_________|_____________________
|DConFile / XLUnicodeStringNoCch|
+-+-+-+-+-+-+-+-+-+-+-+...+-+-+-+
(bits) |h| reserved | rgb |
+-+-+-+-+-+-+-+-+-+-+-+...+-+-+-+
Where
DConFile.h = 0x00
if the characters inrgb
are single byte, and
DConFile.h = 0x01
if they are double byte.
If they are double byte, then
- If it exists, the length of
DConRef.un = 2
. Otherwise it is 1.
- The length of
DConFile.rgb = (2 * DConRef.cch)
. Otherwise it is equal to
DConRef.cch
.
DConRef.rgb
starts with 0x01
if it is an external reference,
and with 0x02
if it is a self-reference.
At the moment this class is read-only.
@author Niklas Rehfeld
The id of the record type,
sid = {@value}
A RefU structure specifying the range of cells if this record is part of an SXTBL.
[MS XLS s.2.5.211]
A RefU structure specifying the range of cells if this record is part of an SXTBL.
[MS XLS s.2.5.211]
A RefU structure specifying the range of cells if this record is part of an SXTBL.
[MS XLS s.2.5.211]
A RefU structure specifying the range of cells if this record is part of an SXTBL.
[MS XLS s.2.5.211]
the number of chars in the link
the type of characters (single or double byte)
The link's path string. This is the rgb
field of a
XLUnicodeStringNoCch
. Therefore it will contain at least one leading special
character (0x01 or 0x02) and probably other ones.
@see
DConFile [MS-XLS s. 2.5.77] and
VirtualPath [MS-XLS s. 2.5.69]
unused bits at the end, must be set to 0.
Read constructor.
@param data byte array containing a DConRef Record, including the header.
Read Constructor.
@param inStream RecordInputStream containing a DConRefRecord structure.
@return raw path byte array.
@return The first column of the range.
@return The first row of the range.
@return The last column of the range.
@return The last row of the range.
@return the link's path, with the special characters stripped/replaced. May be null.
See MS-XLS 2.5.277 (VirtualPath)
Checks if the data source in this reference record is external to this sheet or internal.
@return true iff this is an external reference.
Represents a simple shape such as a line, rectangle or oval.
@author Glen Stampoultzis (glens at apache.org)
An abstract shape.
@author Glen Stampoultzis (glens at apache.org)
creates shapes from existing file
@param spContainer
@param objRecord
Create a new shape with the specified parent and anchor.
The parent.
The anchor.
Sets the color applied to the lines of this shape
The red.
The green.
The blue.
Sets the color used to fill this shape.
The red.
The green.
The blue.
Gets the parent shape.
The parent.
Gets or sets the anchor that is used by this shape.
The anchor.
The color applied to the lines of this shape.
The color of the line style.
Gets or sets the color used to fill this shape.
The color of the fill.
Gets or sets with width of the line in EMUs. 12700 = 1 pt.
The width of the line.
Gets or sets One of the constants in LINESTYLE_*
The line style.
Gets or sets a value indicating whether this instance is no fill.
true if this shape Is not filled with a color; otherwise, false.
whether this shape is vertically flipped.
whether this shape is horizontally flipped.
get or set the rotation, in degrees, that is applied to a shape.
Negative values specify rotation in the counterclockwise direction.
Rotation occurs around the center of the shape.
The default value for this property is 0x00000000
Count of all children and their childrens children.
The count of all children.
Initializes a new instance of the class.
The parent.
The anchor.
Gets the shape type.
One of the OBJECT_TYPE_* constants.
@see #OBJECT_TYPE_LINE
@see #OBJECT_TYPE_OVAL
@see #OBJECT_TYPE_RECTANGLE
@see #OBJECT_TYPE_PICTURE
@see #OBJECT_TYPE_COMMENT
Get or set the rich text string used by this object.
@author Evgeniy Berlog
date: 05.06.12
build shape tree from escher container
@param container root escher container from which escher records must be taken
@param agg - EscherAggregate
@param out - shape container to which shapes must be added
@param root - node to create HSSFObjectData shapes
Copies an Entry into a target POIFS directory, recursively
Copies all the nodes from one POIFS Directory to another
@param sourceRoot
is the source Directory to copy from
@param targetRoot
is the target Directory to copy to
Copies nodes from one Directory to the other minus the excepts
@param filteredSource The filtering source Directory to copy from
@param filteredTarget The filtering target Directory to copy to
Copies nodes from one Directory to the other minus the excepts
@param sourceRoot
is the source Directory to copy from
@param targetRoot
is the target Directory to copy to
@param excepts
is a list of Strings specifying what nodes NOT to copy
@deprecated use {@link FilteringDirectoryNode} instead
Copies all nodes from one POIFS to the other
@param source
is the source POIFS to copy from
@param target
is the target POIFS to copy to
Copies nodes from one POIFS to the other, minus the excepts.
This delegates the filtering work to {@link FilteringDirectoryNode},
so excepts can be of the form "NodeToExclude" or
"FilteringDirectory/ExcludedChildNode"
@param source is the source POIFS to copy from
@param target is the target POIFS to copy to
@param excepts is a list of Entry Names to be excluded from the copy
Checks to see if the two Directories hold the same contents.
For this to be true, they must have entries with the same names,
no entries in one but not the other, and the size+contents
of each entry must match, and they must share names.
To exclude certain parts of the Directory from being checked,
use a {@link FilteringDirectoryNode}
Checks to see if two Documents have the same name
and the same contents. (Their parent directories are
not checked)
A DirectoryEntry filter, which exposes another DirectoryEntry less certain parts.
This is typically used when copying or comparing Filesystems.
This interface defines methods specific to Directory objects
managed by a Filesystem instance.
@author Marc Johnson (mjohnson at apache dot org)
This interface provides access to an object managed by a Filesystem
instance. Entry objects are further divided into DocumentEntry and
DirectoryEntry instances.
@author Marc Johnson (mjohnson at apache dot org)
Delete this Entry. ThIs operation should succeed, but there are
special circumstances when it will not:
If this Entry Is the root of the Entry tree, it cannot be
deleted, as there Is no way to Create another one.
If this Entry Is a directory, it cannot be deleted unless it Is
empty.
true if the Entry was successfully deleted, else false
Rename this Entry. ThIs operation will fail if:
There Is a sibling Entry (i.e., an Entry whose parent Is the
same as this Entry's parent) with the same name.
ThIs Entry Is the root of the Entry tree. Its name Is dictated
by the Filesystem and many not be Changed.
the new name for this Entry
true if the operation succeeded, else false
Get the name of the Entry
The name.
Is this a DirectoryEntry?
true if the Entry Is a DirectoryEntry; otherwise, false.
Is this a DocumentEntry?
true if the Entry Is a DocumentEntry; otherwise, false.
Get this Entry's parent (the DirectoryEntry that owns this
Entry). All Entry objects, except the root Entry, has a parent.
this Entry's parent; null iff this Is the root Entry
This property is moved to EntryNode
get a specified Entry by name
the name of the Entry to obtain.
the specified Entry, if it is directly contained in
this DirectoryEntry
Create a new DocumentEntry
the name of the new DocumentEntry
the Stream from which to Create the new DocumentEntry
the new DocumentEntry
Create a new DocumentEntry; the data will be provided later
the name of the new DocumentEntry
the size of the new DocumentEntry
BeforeWriting event handler
the new DocumentEntry
Create a new DirectoryEntry
the name of the new DirectoryEntry
the name of the new DirectoryEntry
Checks if entry with specified name present
entry name
true if have
get an iterator of the Entry instances contained directly in
this instance (in other words, children only; no grandchildren
etc.)
The entries.never null, but hasNext() may return false
immediately (i.e., this DirectoryEntry is empty). All
objects retrieved by next() are guaranteed to be
implementations of Entry.
is this DirectoryEntry empty?
true if this instance contains no Entry instances; otherwise, false.
find out how many Entry instances are contained directly within
this DirectoryEntry
number of immediately (no grandchildren etc.) contained
Entry instances
Gets or sets the storage ClassID.
The storage ClassID.
Creates a filter round the specified directory, which will exclude entries such as
"MyNode" and "MyDir/IgnoreNode". The excludes can stretch into children, if they contain a /.
The Directory to filter
The Entries to exclude
Copies an Entry into a target POIFS directory, recursively
Copies nodes from one POIFS to the other minus the excepts
@param source
is the source POIFS to copy from
@param target
is the target POIFS to copy to
@param excepts
is a list of Strings specifying what nodes NOT to copy
Copies nodes from one POIFS to the other minus the excepts
@param source
is the source POIFS to copy from
@param target
is the target POIFS to copy to
@param excepts
is a list of Strings specifying what nodes NOT to copy
Evaluator for formula arguments.
@author jfaenomoto@gmail.com
Evaluate a generic {@link ValueEval} argument to a double value that represents a date in POI.
@param arg {@link ValueEval} an argument.
@param srcCellRow number cell row.
@param srcCellCol number cell column.
@return a double representing a date in POI.
@throws EvaluationException exception upon argument evaluation.
Evaluate a generic {@link ValueEval} argument to an array of double values that represents dates in POI.
@param arg {@link ValueEval} an argument.
@param srcCellRow number cell row.
@param srcCellCol number cell column.
@return an array of doubles representing dates in POI.
@throws EvaluationException exception upon argument evaluation.
Evaluate a generic {@link ValueEval} argument to a double value.
@param arg {@link ValueEval} an argument.
@param srcCellRow number cell row.
@param srcCellCol number cell column.
@return a double value.
@throws EvaluationException exception upon argument evaluation.
Parser for java dates.
@author jfaenomoto@gmail.com
Parses a date from a string.
@param strVal a string with a date pattern.
@return a date parsed from argument.
@throws EvaluationException exception upon parsing.
@param month 1-based
Implementation of Excel 'Analysis ToolPak' function NETWORKDAYS()
Returns the number of workdays given a starting and an ending date, considering an interval of holidays. A workday is any non
saturday/sunday date.
Syntax
NETWORKDAYS(startDate, endDate, holidays)
@author jfaenomoto@gmail.com
For most Excel functions, involving references ((cell, area), (2d, 3d)), the references are
passed in as arguments, and the exact location remains fixed. However, a select few Excel
functions have the ability to access cells that were not part of any reference passed as an
argument.
Two important functions with this feature are INDIRECT and OFFSet
In POI, the HSSFFormulaEvaluator Evaluates every cell in each reference argument before
calling the function. This means that functions using fixed references do not need access to
the rest of the workbook to execute. Hence the Evaluate() method on the common
interface Function does not take a workbook parameter.
This interface recognises the requirement of some functions to freely Create and Evaluate
references beyond those passed in as arguments.
@author Josh Micich
@param args the pre-Evaluated arguments for this function. args is never null
,
nor are any of its elements.
@param ec primarily used to identify the source cell Containing the formula being Evaluated.
may also be used to dynamically create reference evals.
@return never null
. Possibly an instance of ErrorEval in the case of
a specified Excel error (Exceptions are never thrown to represent Excel errors).
Constructor.
@param anEvaluator an injected {@link ArgumentsEvaluator}.
Evaluate for NETWORKDAYS. Given two dates and a optional date or interval of holidays, determines how many working days are there
between those dates.
@return {@link ValueEval} for the number of days between two dates.
A calculator for workdays, considering dates as excel representations.
@author jfaenomoto@gmail.com
Constructor.
Calculate how many workdays are there between a start and an end date, as excel representations, considering a range of holidays.
@param start start date.
@param end end date.
@param holidays an array of holidays.
@return number of workdays between start and end dates, including both dates.
Calculate the workday past x workdays from a starting date, considering a range of holidays.
@param start start date.
@param workdays number of workdays to be past from starting date.
@param holidays an array of holidays.
@return date past x workdays.
Calculates how many days of week past between a start and an end date.
@param start start date.
@param end end date.
@param dayOfWeek a day of week as represented by {@link Calendar} constants.
@return how many days of week past in this interval.
Calculates how many holidays in a list are workdays, considering an interval of dates.
@param start start date.
@param end end date.
@param holidays an array of holidays.
@return number of holidays that occur in workdays, between start and end dates.
@param aDate a given date.
@return true
if date is weekend, false
otherwise.
@param aDate a given date.
@param holidays an array of holidays.
@return true
if date is a holiday, false
otherwise.
@param aDate a given date.
@param holidays an array of holidays.
@return 1
is not a workday, 0
otherwise.
@param start start date.
@param end end date.
@param aDate a date to be analyzed.
@return true
if aDate is between start and end dates, false
otherwise.
Implementation of Excel 'Analysis ToolPak' function WORKDAY()
Returns the date past a number of workdays beginning at a start date, considering an interval of holidays. A workday is any non
saturday/sunday date.
Syntax
WORKDAY(startDate, days, holidays)
@author jfaenomoto@gmail.com
Evaluate for WORKDAY. Given a date, a number of days and a optional date or interval of holidays, determines which date it is past
number of parametrized workdays.
@return {@link ValueEval} with date as its value.
Implementation for the ERROR.TYPE() Excel function.
Syntax:
ERROR.TYPE(errorValue)
Returns a number corresponding to the error type of the supplied argument.
errorValue | Return Value |
#NULL! | 1 |
#DIV/0! | 2 |
#VALUE! | 3 |
#REF! | 4 |
#NAME? | 5 |
#NUM! | 6 |
#N/A! | 7 |
everything else | #N/A! |
Note - the results of ERROR.TYPE() are different to the constants defined in
ErrorConstants.
@author Josh Micich
Convenience base class for functions that must take exactly one argument.
@author Josh Micich
Implemented by all functions that can be called with one argument
@author Josh Micich
Function serves as a marker interface.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Evaluates the specified args.
the evaluated function arguments. Empty values are represented with BlankEval or MissingArgEval
row index of the cell containing the formula under evaluation
column index of the cell containing the formula under evaluation
see {@link Function#Evaluate(ValueEval[], int, int)}
Implementation of Excel HYPERLINK function.
In Excel this function has special behaviour - it causes the displayed cell value to behave like
a hyperlink in the GUI. From an evaluation perspective however, it is very simple.
Syntax:
HYPERLINK(link_location, friendly_name)
link_location The URL of the hyperlink
friendly_name (optional) the value to display
Returns last argument. Leaves type unchanged (does not convert to {@link org.apache.poi.ss.formula.eval.StringEval}).
@author Wayne Clingingsmith
Convenience base class for any function which must take two or three
arguments
@author Josh Micich
Implemented by all functions that can be called with two arguments
@author Josh Micich
see {@link Function#Evaluate(ValueEval[], int, int)}
* Returns the rank of a number in a list of numbers. The rank of a number is its size relative to other values in a list.
* Syntax:
* RANK(number,ref,order)
* Number is the number whose rank you want to find.
* Ref is an array of, or a reference to, a list of numbers. Nonnumeric values in ref are ignored.
* Order is a number specifying how to rank number.
* If order is 0 (zero) or omitted, Microsoft Excel ranks number as if ref were a list sorted in descending order.
* If order is any nonzero value, Microsoft Excel ranks number as if ref were a list sorted in ascending order.
*
* @author Rubin Wang
Convenience base class for any function which must take two or three
arguments
@author Josh Micich
Implemented by all functions that can be called with three arguments
@author Josh Micich
see {@link Function#Evaluate(ValueEval[], int, int)}
Implements the Excel Rate function
Excel does not support infinities and NaNs, rather, it gives a #NUM! error in these cases
@throws EvaluationException (#NUM!) if result is NaN or Infinity
Implementation for the Excel function SUMIFS
Syntax :
SUMIFS ( sum_range, criteria_range1, criteria1,
[criteria_range2, criteria2], ...)
- sum_range Required. One or more cells to sum, including numbers or names, ranges,
or cell references that contain numbers. Blank and text values are ignored.
- criteria1_range Required. The first range in which
to evaluate the associated criteria.
- criteria1 Required. The criteria in the form of a number, expression,
cell reference, or text that define which cells in the criteria_range1
argument will be added
- criteria_range2, criteria2, ... Optional. Additional ranges and their associated criteria.
Up to 127 range/criteria pairs are allowed.
@author Yegor Kozlov
Verify that each criteriaRanges
argument contains the same number of rows and columns
as the sumRange
argument
@throws EvaluationException if
@param ranges criteria ranges, each range must be of the same dimensions as aeSum
@param predicates array of predicates, a predicate for each value in ranges
@param aeSum the range to sum
@return the computed value
Implementation for the Excel function WEEKDAY
@author Thies Wellpott
* Perform WEEKDAY(date, returnOption) function.
* Note: Parameter texts are from German EXCEL-2010 help.
* Parameters in args[]:
* args[0] serialDate
* EXCEL-date value
* Standardmaessig ist der 1. Januar 1900 die fortlaufende Zahl 1 und
* der 1. Januar 2008 die fortlaufende Zahl 39.448, da dieser Tag nach 39.448 Tagen
* auf den 01.01.1900 folgt.
* @return Option (optional)
* Bestimmt den Rueckgabewert:
1 oder nicht angegeben Zahl 1 (Sonntag) bis 7 (Samstag). Verhaelt sich wie fruehere Microsoft Excel-Versionen.
2 Zahl 1 (Montag) bis 7 (Sonntag).
3 Zahl 0 (Montag) bis 6 (Sonntag).
11 Die Zahlen 1 (Montag) bis 7 (Sonntag)
12 Die Zahlen 1 (Dienstag) bis 7 (Montag)
13 Die Zahlen 1 (Mittwoch) bis 7 (Dienstag)
14 Die Zahlen 1 (Donnerstag) bis 7 (Mittwoch)
15 Die Zahlen 1 (Freitag) bis 7 (Donnerstag)
16 Die Zahlen 1 (Samstag) bis 7 (Freitag)
17 Die Zahlen 1 (Sonntag) bis 7 (Samstag)
Manages the all the records associated with a chart sub-stream.
Includes the Initial {@link BOFRecord} and {@link EOFRecord}.
@author Josh Micich
All the records between BOF and EOF
Groups the sheet protection records for a worksheet.
See OOO excelfileformat.pdf sec 4.18.2 'Sheet Protection in a Workbook
(BIFF5-BIFF8)'
@author Josh Micich
Creates an empty WorksheetProtectionBlock
@return true if the specified Record sid is one belonging to
the 'Page Settings Block'.
This method Reads {@link WorksheetProtectionBlock} records from the supplied RecordStream
until the first non-WorksheetProtectionBlock record is encountered. As each record is Read,
it is incorporated into this WorksheetProtectionBlock.
As per the OOO documentation, the protection block records can be expected to be written
toGether (with no intervening records), but earlier versions of POI (prior to Jun 2009)
didn't do this. Workbooks with sheet protection Created by those earlier POI versions
seemed to be valid (Excel opens them OK). So PO allows continues to support Reading of files
with non continuous worksheet protection blocks.
Note - when POI Writes out this WorksheetProtectionBlock, the records will always be
written in one consolidated block (in the standard ordering) regardless of how scattered the
records were when they were originally Read.
protect a spreadsheet with a password (not encrypted, just sets protect flags and the password.)
password to set;Pass null
to remove all protection
shouldProtectObjects are protected
shouldProtectScenarios are protected
Creates an ObjectProtect record with protect set to false.
Creates a ScenarioProtect record with protect set to false.
Creates a Password record with password set to 0x0000.
the ProtectRecord. If one is not contained in the sheet, then one is created.
the PasswordRecord. If one is not Contained in the sheet, then one is Created.
The Chart3d record specifies that the plot area of the chart group is rendered in a 3-D scene
and also specifies the attributes of the 3-D plot area. The preceding chart group type MUST be
of type bar, pie, line, area, or surface.
author: Antony liu (antony.apollo at gmail.com)
A signed integer that specifies the clockwise rotation, in degrees, of the 3-D plot area
around a vertical line through the center of the 3-D plot area. MUST be greater than or
equal to 0 and MUST be less than or equal to 360.
A signed integer that specifies the rotation, in degrees, of the 3-D plot area around
a horizontal line through the center of the 3-D plot area.MUST be greater than or equal
to -90 and MUST be less than or equal to 90.
A signed integer that specifies the field of view angle for the 3-D plot area.
MUST be greater than or equal to zero and less than 200.
If fNotPieChart is 0, then this is an unsigned integer that specifies the thickness of the pie for a pie chart group.
If fNotPieChart is 1, then this is a signed integer that specifies the height of the 3-D plot area as a percentage of its width.
A signed integer that specifies the depth of the 3-D plot area as a percentage of its width.
MUST be greater than or equal to 1 and less than or equal to 2000.
An unsigned integer that specifies the width of the gap between the series and the front and
back edges of the 3-D plot area as a percentage of the data point depth divided by 2.
If fCluster is not 1 and chart group type is not a bar then pcGap also specifies distance
between adjacent series as a percentage of the data point depth. MUST be less than or equal to 500.
A bit that specifies whether the 3-D plot area is rendered with a vanishing point.
If fNotPieChart is 0 the value MUST be 0. If fNotPieChart is 1 then the value
MUST be a value from the following
true Perspective vanishing point applied based on value of pcDist.
false No vanishing point applied.
specifies whether data points are clustered together in a bar chart group.
If chart group type is not bar or pie, value MUST be ignored. If chart group type is pie,
value MUST be 0. If chart group type is bar, then the value MUST be a value from the following
true Data points are clustered.
false Data points are not clustered.
A bit that specifies whether the height of the 3-D plot area is automatically determined.
If fNotPieChart is 0 then this MUST be 0. If fNotPieChart is 1 then the value MUST be a value from the following table:
false The value of pcHeight is used to determine the height of the 3-D plot area
true The height of the 3-D plot area is automatically determined
A bit that specifies whether the chart group type is pie. MUST be a value from the following :
false Chart group type MUST be pie.
true Chart group type MUST not be pie.
Whether the walls are rendered in 2-D. If fPerspective is 1 then this MUST be ignored.
If the chart group type is not bar, area or pie this MUST be ignored.
If the chart group is of type bar and fCluster is 0, then this MUST be ignored.
If the chart group type is pie this MUST be 0 and MUST be ignored.
If the chart group type is bar or area, then the value MUST be a value from the following
false Chart walls and floor are rendered in 3D.
true Chart walls are rendered in 2D and the chart floor is not rendered.
The CrtLayout12A record specifies layout information for a plot area.
author: Antony liu (antony.apollo at gmail.com)
specifies the type of plot area for the layout target.
false Outer plot area - The bounding rectangle that includes the axis labels, axis titles, data table (2) and plot area of the chart.
true Inner plot area – The rectangle bounded by the chart axes.
specifies the checksum
specifies the horizontal offset of the plot area’s upper-left corner, relative to the upper-left corner of the chart area
specifies the vertical offset of the plot area’s upper-left corner, relative to the upper-left corner of the chart area
specifies the width of the plot area
specifies the height of the plot area
A CrtLayout12Mode structure that specifies the meaning of x.
A CrtLayout12Mode structure that specifies the meaning of y.
A CrtLayout12Mode structure that specifies the meaning of dx.
A CrtLayout12Mode structure that specifies the meaning of dy.
An Xnum (section 2.5.342) value that specifies a horizontal offset. The meaning is determined by wXMode.
An Xnum value that specifies a vertical offset. The meaning is determined by wYMode.
An Xnum value that specifies a width or an horizontal offset. The meaning is determined by wWidthMode.
An Xnum value that specifies a height or an vertical offset. The meaning is determined by wHeightMode.
The CrtLayout12Mode specifies a layout mode. Each layout mode specifies a different
meaning of the x, y, dx, and dy fields of CrtLayout12 and CrtLayout12A.
Position and dimension (2) are determined by the application. x, y, dx and dy MUST be ignored.
x and y specify the offset of the top left corner, relative to its default position,
as a fraction of the chart area. MUST be greater than or equal to -1.0 and MUST be
less than or equal to 1.0. dx and dy specify the width and height, as a fraction of
the chart area, MUST be greater than or equal to 0.0, and MUST be less than or equal to 1.0.
x and y specify the offset of the upper-left corner; dx and dy specify the offset of the bottom-right corner.
x, y, dx and dy are specified relative to the upper-left corner of the chart area as a fraction of the chart area.
x, y, dx and dy MUST be greater than or equal to 0.0, and MUST be less than or equal to 1.0.
The CrtLayout12 record specifies the layout information for attached label, when contained
in the sequence of records that conforms to the ATTACHEDLABEL rule,
or legend, when contained in the sequence of records that conforms to the LD rule.
automatic layout type of the legend.
MUST be ignored when this record is in the sequence of records that conforms to the ATTACHEDLABEL rule.
MUST be a value from the following table:
0x0 Align to the bottom
0x1 Align to top right corner
0x2 Align to the top
0x3 Align to the right
0x4 Align to the left
specifies the checksum of the values in the order as follows,
A CrtLayout12Mode structure that specifies the meaning of x.
A CrtLayout12Mode structure that specifies the meaning of y.
A CrtLayout12Mode structure that specifies the meaning of dx.
A CrtLayout12Mode structure that specifies the meaning of dy.
An Xnum (section 2.5.342) value that specifies a horizontal offset. The meaning is determined by wXMode.
An Xnum value that specifies a vertical offset. The meaning is determined by wYMode.
An Xnum value that specifies a width or an horizontal offset. The meaning is determined by wWidthMode.
An Xnum value that specifies a height or an vertical offset. The meaning is determined by wHeightMode.
The CrtMlFrt record specifies additional properties for chart elements, as specified by
the Chart Sheet Substream ABNF. These properties complement the record to which they
correspond, and are stored as a structure chain defined in XmlTkChain. An application
can ignore this record without loss of functionality, except for the additional properties.
If this record is longer than 8224 bytes, it MUST be split into several records. The first
section of the data appears in this record and subsequent sections appear in one or more
CrtMlFrtContinue records that follow this record.
author: Antony liu (antony.apollo at gmail.com)
specifies the color, size, and shape of the associated data markers that appear on line, radar,
and scatter chart groups. The associated data markers are specified by the preceding DataFormat record.
author: Antony liu (antony.apollo at gmail.com)
the border color of the data marker.
the interior color of the data marker.
the type of data marker.
whether the data marker is automatically generated.
false The data marker is not automatically generated.
true The data marker type, size, and color are automatically generated and the values are set accordingly in this record.
whether to show the data marker interior.
false The data marker interior is shown.
true The data marker interior is not shown.
whether to show the data marker border.
false The data marker border is shown.
true The data marker border is not shown.
the border color of the data marker.
the interior color of the data marker.
specifies the size in twips of the data marker.
The PieFormat record specifies the distance of a data point or data points in a series from the center of one of the following:
The plot area for a doughnut or pie chart group.
The primary pie in a pie of pie or bar of pie chart group.
The secondary bar/pie of a pie of pie chart group.
author: Antony liu (antony.apollo at gmail.com)
A signed integer that specifies the distance of a data point or data points in a series from the center of one of the following:
The plot area for a doughnut or pie chart group.
The primary pie in a pie of pie or bar of pie chart group.
The secondary bar/pie of a pie of pie chart group.
The Pie record specifies that the chart group is a pie chart group or
a doughnut chart group, and specifies the chart group attributes.
author: Antony liu (antony.apollo at gmail.com)
An unsigned integer that specifies the starting angle of the first data point,
clockwise from the top of the circle. MUST be less than or equal to 360.
An unsigned integer that specifies the size of the center hole in a doughnut chart group
as a percentage of the plot area size. MUST be a value from the following table:
0 Pie chart group.
10 to 90 Doughnut chart group.
A bit that specifies whether one data point or more data points in the chart group have shadows.
A bit that specifies whether the leader lines to the data labels are shown.
FeatFormulaErr2 (Formula Evaluation Shared Feature) common record part
This record part specifies Formula Evaluation & Error Ignoring data
for a sheet, stored as part of a Shared Feature. It can be found in
records such as {@link FeatRecord}.
For the full meanings of the flags, see pages 669 and 670
of the Excel binary file format documentation.
Common Interface for all Shared Features
What errors we should ignore
Title: FeatProtection (Protection Shared Feature) common record part
This record part specifies Protection data for a sheet, stored
as part of a Shared Feature. It can be found in records such
as {@link FeatRecord}
0 means no password. Otherwise indicates the
password verifier algorithm (same kind as
{@link PasswordRecord} and
{@link PasswordRev4Record})
Title: FeatSmartTag (Smart Tag Shared Feature) common record part
This record part specifies Smart Tag data for a sheet, stored as part
of a Shared Feature. It can be found in records such as {@link FeatRecord}.
It is made up of a hash, and a Set of Factoid Data that Makes up
the smart tags.
For more details, see page 669 of the Excel binary file
format documentation.
Title: FtrHeader (Future Record Header) common record part
This record part specifies a header for a Ftr (Future)
style record, which includes extra attributes above and
beyond those of a traditional record.
This MUST match the type on the Containing record
This is a FrtFlags
MUST be 8 bytes and all zero
Title: Unicode String
Description: Unicode String - just standard fields that are in several records.
It is considered more desirable then repeating it in all of them.
This is often called a XLUnicodeRichExtendedString in MS documentation.
REFERENCE: PG 264 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
REFERENCE: PG 951 Excel Binary File Format (.xls) Structure Specification v20091214
Our handling of Equals is inconsistent with CompareTo. The trouble is because we don't truely understand
rich text fields yet it's difficult to make a sound comparison.
@param o The object to Compare.
@return true if the object is actually Equal.
construct a unicode string record and fill its fields, ID is ignored
@param in the RecordInputstream to read the record from
Adds a font run to the formatted string.
If a font run exists at the current charcter location, then it is
Replaced with the font run to be Added.
Swaps all use in the string of one font index
for use of a different font index.
Normally only called when fonts have been
Removed / re-ordered
unlike the real records we return the same as "getString()" rather than debug info
@see #getDebugInfo()
@return String value of the record
return a character representation of the fields of this record
@return String of output for biffviewer etc.
Serialises out the String. There are special rules
about where we can and can't split onto
Continue records.
get the number of characters in the string,
as an un-wrapped int
@return number of characters
Get the option flags which among other things return if this is a 16-bit or
8 bit string
@return optionflags bitmask
@return the actual string this Contains as a java String object
Returns our size, excluding our
4 byte header
A decorated {@link RecordInputStream} that can read primitive data types
(short, int, long, etc.) spanned across a {@link ContinueRecord } boundary.
Most records construct themselves from {@link RecordInputStream}.
This class assumes that a {@link ContinueRecord} record break always occurs at the type boundary,
however, it is not always so.
Two attachments to Bugzilla 50779
demonstrate that a CONTINUE break can appear right in between two bytes of a unicode character
or between two bytes of a short
. The problematic portion of the data is
in a Asian Phonetic Settings Block (ExtRst) of a UnicodeString.
{@link RecordInputStream} greedily requests the bytes to be read and stumbles on such files with a
"Not enough data (1) to read requested (2) bytes" exception. The ContinuableRecordInput
class circumvents this "type boundary" rule and Reads data byte-by-byte rolling over CONTINUE if necessary.
YK: For now (March 2011) this class is only used to read
@link NPOI.HSSF.Record.Common.UnicodeString.ExtRst} blocks of a UnicodeString.
@author Yegor Kozlov
@author Josh Micich
Title: FeatHdr (Feature Header) Record
This record specifies common information for Shared Features, and
specifies the beginning of a collection of records to define them.
The collection of data (Globals Substream ABNF, macro sheet substream
ABNF or worksheet substream ABNF) specifies Shared Feature data.
Specifies the enhanced protection type. Used to protect a
shared workbook by restricting access to some areas of it
Specifies that formula errors should be ignored
Specifies the smart tag type. Recognises certain
types of entries (proper names, dates/times etc) and
flags them for action
Specifies the shared list type. Used for a table
within a sheet
0x00000000 = rgbHdrData not present
0xffffffff = rgbHdrData present
We need a BOFRecord to make sense of this...
Title: Feat (Feature) Record
This record specifies Shared Features data. It is normally paired
up with a {@link FeatHdrRecord}.
See SHAREDFEATURES_* on {@link FeatHdrRecord}
Only matters if type is ISFFEC2
Contents depends on isf_sharedFeatureType :
ISFPROTECTION -> FeatProtection
ISFFEC2 -> FeatFormulaErr2
ISFFACTOID -> FeatSmartTag
Subrecords are part of the OBJ class.
Wether this record terminates the sub-record stream.
There are two cases when this method must be overridden and return true
- EndSubRecord (sid = 0x00)
- LbsDataSubRecord (sid = 0x12)
@return whether this record is the last in the sub-record stream
Construct a new FtCblsSubRecord
and
fill its data with the default values
Convert this record to string.
Used by BiffViewer and other utilities.
Serialize the record data into the supplied array of bytes
@param out the stream to serialize into
@return id of this record.
The xtHeader.drType field MUST be equal to 0x07.
The xtHeader.drType field MUST be equal to 0x02.
The xtHeader.drType field MUST be equal to 0x03.
The xtHeader.drType field MUST be equal to 0x04.
The xtHeader.drType field MUST be equal to 0x01.
The xtHeader.drType field MUST be equal to 0x05.
An array of Unicode characters. The size of the array, in characters, is specified
by the cchValue field. The size of the field, in bytes, MUST equal the result of
the following formula:cchValue * 2.
The chartStyle.xtHeader.xmlTkTag MUST be equal to 0x0003.
The nInterval.xtHeader.xmlTkTag field MUST be equal to 0x0052.
@author Josh Micich
@return data validation type of this constraint
@see ValidationType
@return the operator used for this constraint
@see OperatorType
get or set then comparison operator for this constraint
get or set the formula for expression 1. May be null
get or set the formula for expression 2. May be null
Creates a list constraint
Creates a number based data validation constraint. The text values entered for expr1 and expr2
can be either standard Excel formulas or formatted number values. If the expression starts
with '=' it is Parsed as a formula, otherwise it is Parsed as a formatted number.
@param validationType one of {@link NPOI.SS.UserModel.DataValidationConstraint.ValidationType#ANY},
{@link NPOI.SS.UserModel.DataValidationConstraint.ValidationType#DECIMAL},
{@link NPOI.SS.UserModel.DataValidationConstraint.ValidationType#INTEGER},
{@link NPOI.SS.UserModel.DataValidationConstraint.ValidationType#TEXT_LENGTH}
@param comparisonOperator any constant from {@link NPOI.SS.UserModel.DataValidationConstraint.OperatorType} enum
@param expr1 date formula (when first char is '=') or formatted number value
@param expr2 date formula (when first char is '=') or formatted number value
Creates a time based data validation constraint. The text values entered for expr1 and expr2
can be either standard Excel formulas or formatted time values. If the expression starts
with '=' it is Parsed as a formula, otherwise it is Parsed as a formatted time. To parse
formatted times, two formats are supported: "HH:MM" or "HH:MM:SS". This is contrary to
Excel which uses the default time format from the OS.
@param comparisonOperator constant from {@link NPOI.SS.UserModel.DataValidationConstraint.OperatorType} enum
@param expr1 date formula (when first char is '=') or formatted time value
@param expr2 date formula (when first char is '=') or formatted time value
Creates a date based data validation constraint. The text values entered for expr1 and expr2
can be either standard Excel formulas or formatted date values. If the expression starts
with '=' it is Parsed as a formula, otherwise it is Parsed as a formatted date (Excel uses
the same convention). To parse formatted dates, a date format needs to be specified. This
is contrary to Excel which uses the default short date format from the OS.
@param comparisonOperator constant from {@link NPOI.SS.UserModel.DataValidationConstraint.OperatorType} enum
@param expr1 date formula (when first char is '=') or formatted date value
@param expr2 date formula (when first char is '=') or formatted date value
@param dateFormat ignored if both expr1 and expr2 are formulas. Default value is "YYYY/MM/DD"
otherwise any other valid argument for SimpleDateFormat can be used
@see SimpleDateFormat
Distinguishes formula expressions from simple value expressions. This logic is only
required by a few factory methods in this class that create data validation constraints
from more or less the same parameters that would have been entered in the Excel UI. The
data validation dialog box uses the convention that formulas begin with '='. Other methods
in this class follow the POI convention (formulas and values are distinct), so the '='
convention is not used there.
@param textExpr a formula or value expression
@return all text After '=' if textExpr begins with '='. Otherwise null
if textExpr does not begin with '='
@return null
if numberStr is null
@return null
if timeStr is null
@param dateFormat pass null
for default YYYYMMDD
@return null
if timeStr is null
@return both Parsed formulas (for expression 1 and 2).
@return The Parsed token array representing the formula or value specified.
Empty array if both formula and value are null
Convenience method
@return true if this constraint is a 'list' validation
Convenience method
@return true if this constraint is a 'list' validation with explicit values
@return the numeric value for expression 1. May be null
@return the numeric value for expression 2. May be null
HSSFDataFormatter contains methods for formatting the value stored in an
HSSFCell. This can be useful for reports and GUI presentations when you
need to display data exactly as it appears in Excel. Supported formats
include currency, SSN, percentages, decimals, dates, phone numbers, zip
codes, etc.
Internally, formats will be implemented using subclasses of
such as and . Therefore the
formats used by this class must obey the same pattern rules as these Format
subclasses. This means that only legal number pattern characters ("0", "#",
".", "," etc.) may appear in number formats. Other characters can be
inserted before or after the number pattern to form a
prefix or suffix.
For example the Excel pattern "$#,##0.00 "USD"_);($#,##0.00 "USD")"
will be correctly formatted as "$1,000.00 USD" or "($1,000.00 USD)".
However the pattern "00-00-00" is incorrectly formatted by
DecimalFormat as "000000--". For Excel formats that are not compatible with
DecimalFormat, you can provide your own custom {@link Format} implementation
via HSSFDataFormatter.AddFormat(String,Format). The following
custom formats are already provided by this class:
- SSN "000-00-0000"
- Phone Number "(###) ###-####"
- Zip plus 4 "00000-0000"
If the Excel format pattern cannot be parsed successfully, then a default
format will be used. The default number format will mimic the Excel General
format: "#" for whole numbers and "#.##########" for decimal numbers. You
can override the default format pattern with
HSSFDataFormatter.DefaultNumberFormat=(Format). Note: the
default format will only be used when a Format cannot be created from the
cell's data format string.
@author James May (james dot may at fmr dot com)
HSSFDataFormatter contains methods for Formatting the value stored in an
Cell. This can be useful for reports and GUI presentations when you
need to display data exactly as it appears in Excel. Supported Formats
include currency, SSN, percentages, decimals, dates, phone numbers, zip
codes, etc.
Internally, Formats will be implemented using subclasses of
such as and . Therefore the
Formats used by this class must obey the same pattern rules as these FormatBase
subclasses. This means that only legal number pattern characters ("0", "#",
".", "," etc.) may appear in number formats. Other characters can be
inserted before or after the number pattern to form a
prefix or suffix.
For example the Excel pattern "$#,##0.00 "USD"_);($#,##0.00 "USD")"
will be correctly Formatted as "$1,000.00 USD" or "($1,000.00 USD)".
However the pattern "00-00-00" is incorrectly Formatted by
DecimalFormat as "000000--". For Excel Formats that are not compatible with
DecimalFormat, you can provide your own custom {@link FormatBase} implementation
via HSSFDataFormatter.AddFormat(String,FormatBase). The following
custom Formats are already provided by this class:
- SSN "000-00-0000"
- Phone Number "(###) ###-####"
- Zip plus 4 "00000-0000"
If the Excel FormatBase pattern cannot be Parsed successfully, then a default
FormatBase will be used. The default number FormatBase will mimic the Excel General
FormatBase: "#" for whole numbers and "#.##########" for decimal numbers. You
can override the default FormatBase pattern with
HSSFDataFormatter.setDefaultNumberFormat(FormatBase). Note: the
default FormatBase will only be used when a FormatBase cannot be Created from the
cell's data FormatBase string.
@author James May (james dot may at fmr dot com)
Pattern to find a number FormatBase: "0" or "#"
Pattern to find days of week as text "ddd...."
Pattern to find "AM/PM" marker
A regex to find patterns like [$$-1009] and [$�-452].
Note that we don't currently process these into locales
* Cells formatted with a date or time format and which contain invalid date or time values
* show 255 pound signs ("#").
General FormatBase for whole numbers.
General FormatBase for decimal numbers.
A default FormatBase to use when a number pattern cannot be Parsed.
Creates a formatter using the {@link Locale#getDefault() default locale}.
Constructor
Creates a formatter using the given locale.
@param emulateCsv whether to emulate CSV output.
Return a FormatBase for the given cell if one exists, otherwise try to
Create one. This method will return null if the any of the
following is true:
- the cell's style is null
- the style's data FormatBase string is null or empty
- the FormatBase string cannot be recognized as either a number or date
@param cell The cell to retrieve a FormatBase for
@return A FormatBase for the FormatBase String
Create and return a FormatBase based on the FormatBase string from a cell's
style. If the pattern cannot be Parsed, return a default pattern.
@param cell The Excel cell
@return A FormatBase representing the excel FormatBase. May return null.
Return true if the double value represents a whole number
@param d the double value to check
@return true if d is a whole number
Returns a default FormatBase for a cell.
@param cell The cell
@return a default FormatBase
Returns the Formatted value of an Excel date as a String based
on the cell's DataFormat. i.e. "Thursday, January 02, 2003"
, "01/02/2003" , "02-Jan" , etc.
@param cell The cell
@return a Formatted date string
Returns the Formatted value of an Excel number as a String
based on the cell's DataFormat. Supported Formats include
currency, percents, decimals, phone number, SSN, etc.:
"61.54%", "$100.00", "(800) 555-1234".
@param cell The cell
@return a Formatted number string
Formats the given raw cell value, based on the supplied
FormatBase index and string, according to excel style rules.
@see #FormatCellValue(Cell)
Performs Excel-style date formatting, using the
supplied Date and format
Formats the given raw cell value, based on the supplied
format index and string, according to excel style rules.
@see #formatCellValue(Cell)
Returns the Formatted value of a cell as a String regardless
of the cell type. If the Excel FormatBase pattern cannot be Parsed then the
cell value will be Formatted using a default FormatBase.
When passed a null or blank cell, this method will return an empty
String (""). Formulas in formula type cells will not be evaluated.
@param cell The cell
@return the Formatted cell value as a String
Returns the Formatted value of a cell as a String regardless
of the cell type. If the Excel FormatBase pattern cannot be Parsed then the
cell value will be Formatted using a default FormatBase.
When passed a null or blank cell, this method will return an empty
String (""). Formula cells will be evaluated using the given
{@link HSSFFormulaEvaluator} if the evaluator is non-null. If the
evaluator is null, then the formula String will be returned. The caller
is responsible for setting the currentRow on the evaluator
@param cell The cell (can be null)
@param evaluator The HSSFFormulaEvaluator (can be null)
@return a string value of the cell
Sets a default number FormatBase to be used when the Excel FormatBase cannot be
Parsed successfully. Note: This is a fall back for when an error
occurs while parsing an Excel number FormatBase pattern. This will not
affect cells with the General FormatBase.
The value that will be passed to the FormatBase's FormatBase method (specified
by java.text.FormatBase#FormatBase) will be a double value from a
numeric cell. Therefore the code in the FormatBase method should expect a
Number value.
@param FormatBase A FormatBase instance to be used as a default
@see java.text.FormatBase#FormatBase
Adds a new FormatBase to the available formats.
The value that will be passed to the FormatBase's FormatBase method (specified
by java.text.FormatBase#FormatBase) will be a double value from a
numeric cell. Therefore the code in the FormatBase method should expect a
Number value.
@param excelformatStr The data FormatBase string
@param FormatBase A FormatBase instance
Creates a formatter using the given locale.
Creates a formatter using the {@link Locale#getDefault() default locale}.
Utility class for creating data validation cells
@author Dragos Buleandra (dragos.buleandra@trade2b.ro)
Sets the title and text for the prompt box . Prompt box is displayed when
the user selects a cell which belongs to this validation object . In
order for a prompt box to be displayed you should also use method
SetShowPromptBox( bool show )
@param title The prompt box's title
@param text The prompt box's text
Sets the title and text for the error box . Error box is displayed when
the user enters an invalid value int o a cell which belongs to this
validation object . In order for an error box to be displayed you should
also use method SetShowErrorBox( bool show )
@param title The error box's title
@param text The error box's text
get or set the error style for error box
Setting this allows an empty object as a valid value. Retrieve the settings for empty cells allowed.
@return True if this object should treats empty as valid value , false otherwise
true if this object should treats empty as valid value, false otherwise
Useful for list validation objects .
Useful only list validation objects . This method always returns false if the object isn't a list validation object
Sets the behaviour when a cell which belongs to this object is selected
true if an prompt box should be displayed , false otherwise
Sets the behaviour when an invalid value is entered
true if an error box should be displayed , false otherwise
@return Prompt box's title or null
@return Prompt box's text or null
@return Error box's title or null
@return Error box's text or null
Constructor which Initializes the cell range on which this object will be
applied
@param constraint
@author Radhakrishnan J
@author Radhakrishnan J
Contains methods for dealing with Excel dates.
@author Michael Harhen
@author Glen Stampoultzis (glens at apache.org)
@author Dan Sherman (dsherman at isisph.com)
@author Hack Kampbjorn (hak at 2mba.dk)
@author Alex Jacoby (ajacoby at gmail.com)
@author Pavel Krupets (pkrupets at palmtreebusiness dot com)
Contains methods for dealing with Excel dates.
@author Michael Harhen
@author Glen Stampoultzis (glens at apache.org)
@author Dan Sherman (dsherman at Isisph.com)
@author Hack Kampbjorn (hak at 2mba.dk)
@author Alex Jacoby (ajacoby at gmail.com)
@author Pavel Krupets (pkrupets at palmtreebusiness dot com)
@author Thies Wellpott
Given a Calendar, return the number of days since 1899/12/31.
the date
if set to true [use1904windowing].
number of days since 1899/12/31
Given a Date, Converts it into a double representing its internal Excel representation,
which Is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
Excel representation of Date (-1 if error - test for error by Checking for less than 0.1)
the Date
Gets the excel date.
The year.
The month.
The day.
The hour.
The minute.
The second.
Should 1900 or 1904 date windowing be used?
Given a Date, Converts it into a double representing its internal Excel representation,
which Is the number of days since 1/1/1900. Fractional days represent hours, minutes, and seconds.
The date.
Should 1900 or 1904 date windowing be used?
Excel representation of Date (-1 if error - test for error by Checking for less than 0.1)
Given an Excel date with using 1900 date windowing, and converts it to a java.util.Date.
Excel Dates and Times are stored without any timezone
information. If you know (through other means) that your file
uses a different TimeZone to the system default, you can use
this version of the getJavaDate() method to handle it.
The Excel date.
null if date is not a valid Excel date
Given an Excel date with either 1900 or 1904 date windowing,
Converts it to a Date.
NOTE: If the default TimeZone in Java uses Daylight
Saving Time then the conversion back to an Excel date may not give
the same value, that Is the comparison
excelDate == GetExcelDate(GetJavaDate(excelDate,false))
Is not always true. For example if default timezone Is
Europe/Copenhagen, on 2004-03-28 the minute after
01:59 CET Is 03:00 CEST, if the excel date represents a time between
02:00 and 03:00 then it Is Converted to past 03:00 summer time
@param date The Excel date.
@param use1904windowing true if date uses 1904 windowing,
or false if using 1900 date windowing.
@return Java representation of the date, or null if date Is not a valid Excel date
@see TimeZone
Get EXCEL date as Java Calendar (with default time zone). This is like GetJavaDate(double, boolean) but returns a Calendar object.
The Excel date.
true if date uses 1904 windowing, or false if using 1900 date windowing.
null if date is not a valid Excel date
Converts a string of format "HH:MM" or "HH:MM:SS" to its (Excel) numeric equivalent
The time STR.
a double between 0 and 1 representing the fraction of the day
Converts the time internal.
The time STR.
Given a format ID and its format String, will Check to see if the
format represents a date format or not.
Firstly, it will Check to see if the format ID corresponds to an
internal excel date format (eg most US date formats)
If not, it will Check to see if the format string only Contains
date formatting Chars (ymd-/), which covers most
non US date formats.
The index of the format, eg from ExtendedFormatRecord.GetFormatIndex
The format string, eg from FormatRecord.GetFormatString
true if [is A date format] [the specified format index]; otherwise, false.
Converts a string of format "YYYY/MM/DD" to its (Excel) numeric equivalent
The date STR.
a double representing the (integer) number of days since the start of the Excel epoch
Parses the YYYYMMDD date internal.
The time string.
Parses the int.
The string value.
Name of the field.
The range max.
Parses the int.
The STR val.
Name of the field.
The lower limit.
The upper limit.
Given a format ID this will Check whether the format represents an internal excel date format or not.
The format.
Check if a cell Contains a date
Since dates are stored internally in Excel as double values
we infer it Is a date if it Is formatted as such.
The cell.
Check if a cell contains a date, Checking only for internal excel date formats.
As Excel stores a great many of its dates in "non-internal" date formats, you will not normally want to use this method.
The cell.
Given a double, Checks if it Is a valid Excel date.
the double value.
true if [is valid excel date] [the specified value]; otherwise, false.
Utility for delaying the concatenation of multiple byte arrays. Doing this up-front
causes significantly more copying, which for a large number of byte arrays can cost
a large amount of time.
Clears the array (sets the concatenated length back to zero.
Concatenates an array onto the end of our array.
This is a relatively fast operation.
@param array the array to concatenate.
@throws ArgumentException if {@code array} is {@code null}.
Gets the concatenated contents as a single byte array.
This is a slower operation, but the concatenated array is stored off as a single
array again so that subsequent calls will not perform Additional copying.
@return the byte array. Returns {@code null} if no data has been placed into it.
Generates escher records when provided the byte array containing those records.
@author Glen Stampoultzis
@author Nick Burch (nick at torchbox . com)
The escher record factory interface allows for the creation of escher
records from a pointer into a data array.
@author Glen Stampoultzis (glens at apache.org)
Create a new escher record from the data provided. Does not attempt
to Fill the contents of the record however.
The data.
The off set.
Initializes a new instance of the class.
Generates an escher record including the any children contained under that record.
An exception is thrown if the record could not be generated.
The byte array containing the records
The starting offset into the byte array
The generated escher record
Converts from a list of classes into a map that Contains the record id as the key and
the Constructor in the value part of the map. It does this by using reflection to look up
the RECORD_ID field then using reflection again to find a reference to the constructor.
The records to convert
The map containing the id/constructor pairs.
Escher array properties are the most wierd construction ever invented
with all sorts of special cases. I'm hopeful I've got them all.
@author Glen Stampoultzis (glens at superlinksoftware.com)
A complex property differs from a simple property in that the data can not fit inside a 32 bit
integer. See the specification for more detailed information regarding exactly what is
stored here.
@author Glen Stampoultzis
This is the abstract base class for all escher properties.
@see EscherOptRecord
@author Glen Stampoultzis (glens at apache.org)
Initializes a new instance of the class.
The id is distinct from the actual property number. The id includes the property number the blip id
flag and an indicator whether the property is complex or not.
Initializes a new instance of the class.The three parameters are combined to form a property
id.
The property number.
if set to true [is complex].
if set to true [is blip id].
Escher properties consist of a simple fixed Length part and a complex variable Length part.
The fixed Length part is Serialized first.
The data.
The pos.
Escher properties consist of a simple fixed Length part and a complex variable Length part.
The fixed Length part is Serialized first.
The data.
The pos.
Gets the id.
The id.
Gets the property number.
The property number.
Gets a value indicating whether this instance is complex.
true if this instance is complex; otherwise, false.
Gets a value indicating whether this instance is blip id.
true if this instance is blip id; otherwise, false.
Gets the name.
The name.
Most properties are just 6 bytes in Length. Override this if we're
dealing with complex properties.
The size of the property.
Create a complex property using the property id and a byte array containing the complex
data value.
The id consists of the property number, a flag indicating whether this is a blip id and a flag
indicating that this is a complex property.
The value of this property.
Create a complex property using the property number, a flag to indicate whether this is a
blip reference and the complex property data.
The property number.
Whether this is a blip id. Should be false.
The value of this complex property.
Serializes the simple part of this property. ie the first 6 bytes.
Serializes the complex part of this property
The data array to Serialize to
The offset within data to start serializing to.
The number of bytes Serialized.
Determine whether this property is equal to another property.
The object to compare to.
True if the objects are equal.
Serves as a hash function for a particular type.
A hash code for the current .
Returns a that represents the current .
A that represents the current .
Gets the complex data.
The complex data.
Caclulates the number of bytes required to Serialize this property.
Number of bytes
The size of the header that goes at the
start of the array, before the data
Normally, the size recorded in the simple data (for the complex
data) includes the size of the header.
There are a few cases when it doesn't though...
When Reading a property from data stream remeber if the complex part is empty and Set this flag.
Gets the element.
The index.
Sets the element.
The index.
The element.
Retrieves the string representation for this property.
We have this method because the way in which arrays in escher works
is screwed for seemly arbitary reasons. While most properties are
fairly consistent and have a predictable array size, escher arrays
have special cases.
The data array containing the escher array information
The offset into the array to start Reading from.
the number of bytes used by this complex property.
Serializes the simple part of this property. ie the first 6 bytes.
Needs special code to handle the case when the size doesn't
include the size of the header block
Sometimes the element size is stored as a negative number. We
negate it and shift it to Get the real value.
The size of elements.
@author Glen Stampoultzis
@version $Id: EscherBitmapBlip.java 569827 2007-08-26 15:26:29Z yegor $
@author Glen Stampoultzis
@version $Id: EscherBlipRecord.java 569827 2007-08-26 15:26:29Z yegor $
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into
May be null since this is not a container record.
The number of bytes Read from the byte array.
Serializes the record to an existing byte array.
the offset within the byte array
the data array to Serialize to
a listener for begin and end serialization events.
the number of bytes written.
Returns a that represents the current .
A that represents the current .
Returns the number of bytes that are required to Serialize this record.
Number of bytes
The short name for this record
Gets or sets the picture data.
The picture data.
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into
May be null since this is not a container record.
The number of bytes Read from the byte array.
Serializes the record to an existing byte array.
the offset within the byte array
the data array to Serialize to
a listener for begin and end serialization events.
the number of bytes written.
Toes the string.
Returns the number of bytes that are required to Serialize this record.
Number of bytes
Gets or sets the UID.
The UID.
Gets or sets the marker.
The marker.
The blip record is used to hold details about large binary objects that occur in escher such
as JPEG, GIF, PICT and WMF files. The contents of the stream is usually compressed. Inflate
can be used to decompress the data.
@author Glen Stampoultzis
This method deserializes the record from a byte array.
The byte array containing the escher record information
The starting offset into
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array.
@param offset
The offset into data to start writing the record data to.
the data array to Serialize to
a listener for begin and end serialization events.
the number of bytes written.
Returns a that represents the current .
A that represents the current .
Compress the contents of the provided array
An uncompressed byte array
Decompresses the specified data.
The compressed byte array.
The starting position into the byte array.
The number of compressed bytes to decompress.
An uncompressed byte array
Returns the number of bytes that are required to Serialize this record.
Number of bytes
The short name for this record
Gets or sets the secondary UID.
The secondary UID.
Gets or sets the size of the cache of.
The size of the cache of.
Gets or sets the top boundary of the metafile drawing commands
The boundary top.
Gets or sets the left boundary of the metafile drawing commands
The boundary left.
Gets or sets the boundary width of the metafile drawing commands
The width of the boundary.
Gets or sets the boundary height of the metafile drawing commands
The height of the boundary.
Gets or sets the width of the metafile in EMU's (English Metric Units).
The width.
Gets or sets the height of the metafile in EMU's (English Metric Units).
The height.
Gets or sets the cache of the saved size
the cache of the saved size.
Is the contents of the blip compressed?
The compression flag.
Gets or sets the filter.
The filter.
Gets or sets The BLIP data
The data.
Represents a bool property. The actual utility of this property is in doubt because many
of the properties marked as bool seem to actually contain special values. In other words
they're not true bools.
@author Glen Stampoultzis
A simple property is of fixed Length and as a property number in Addition
to a 32-bit value. Properties that can't be stored in only 32-bits are
stored as EscherComplexProperty objects.
@author Glen Stampoultzis (glens at apache.org)
The id is distinct from the actual property number. The id includes the property number the blip id
flag and an indicator whether the property is complex or not.
The id.
The property value.
Constructs a new escher property. The three parameters are combined to form a property
id.
The property number.
if set to true [is complex].
if set to true [is blip id].
The property value.
Serialize the simple part of the escher record.
The data.
The off set.
the number of bytes Serialized.
Escher properties consist of a simple fixed Length part and a complex variable Length part.
The fixed Length part is Serialized first.
Returns true if one escher property is equal to another.
The o.
Serves as a hash function for a particular type.
A hash code for the current .
Returns a that represents the current .
A that represents the current .
Return the 32 bit value of this property.
The property value.
Create an instance of an escher bool property.
The property number (or id)
The 32 bit value of this bool property
Whether this bool property is true
true if this instance is true; otherwise, false.
Whether this bool property is false
true if this instance is false; otherwise, false.
The BSE record is related closely to the EscherBlipRecord and stores
extra information about the blip. A blip record is actually stored inside
the BSE record even though the BSE record isn't actually a container record.
@author Glen Stampoultzis
@see EscherBlipRecord
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array.
The offset into
data to start writing the record data to
The byte array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Returns a that represents the current .
A that represents the current .
Retrieve the string representation given a blip id.
The b.
Returns the number of bytes that are required to Serialize this record.
Number of bytes
The short name for this record
Gets or sets the expected blip type under windows (failure to match this blip type will result in
Excel converting to this format).
The blip type win32.
Gets or sets the expected blip type under MacOS (failure to match this blip type will result in
Excel converting to this format).
The blip type mac OS.
Gets or sets 16 byte MD4 checksum.
The UID.
Gets or sets the tag. (Unused)
The tag.
Gets or sets Blip size in stream..
The size.
Gets or sets the reference count of this blip.
The ref.
Gets or sets the offset in the delay stream..
The offset.
Defines the way this blip is used.
The usage.
Gets or sets the blip name.
The name.
Gets or sets the unused2.
The unused2.
Gets or sets the unused3.
The unused3.
Gets or sets the blip record.
The blip record.
Gets or sets any remaining data in this record.
The remaining data.
The escher child achor record is used to specify the position of a shape under an
existing group. The first level of shape records use a EscherClientAnchor record instead.
@author Glen Stampoultzis
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array.
The offset into data to start writing the record data to.
The byte array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Returns a that represents the current .
A that represents the current .
Returns the number of bytes that are required to Serialize this record.
Number of bytes
The record id for the EscherChildAnchorRecord.
The short name for this record
Gets or sets offset within the parent coordinate space for the top left point.
The DX1.
Gets or sets the offset within the parent coordinate space for the top left point.
The dy1.
Gets or sets the offset within the parent coordinate space for the bottom right point.
The DX2.
Gets or sets the offset within the parent coordinate space for the bottom right point.
The dy2.
The escher client anchor specifies which rows and cells the shape is bound to as well as
the offsets within those cells. Each cell is 1024 units wide by 256 units long regardless
of the actual size of the cell. The EscherClientAnchorRecord only applies to the top-most
shapes. Shapes contained in groups are bound using the EscherChildAnchorRecords.
@author Glen Stampoultzis
bit[0] - fMove (1 bit): A bit that specifies whether the shape will be kept intact when the cells are moved.
bit[1] - fSize (1 bit): A bit that specifies whether the shape will be kept intact when the cells are resized. If fMove is 1, the value MUST be 1.
bit[2-4] - reserved, MUST be 0 and MUST be ignored
bit[5-15]- Undefined and MUST be ignored.
it can take values: 0, 2, 3
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array.
The offset into data to start writing the record data to.
The byte array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Returns a that represents the current .
A that represents the current .
Returns the number of bytes that are required to Serialize this record.
Number of bytes
The record id for this record.
The short name for this record
Gets or sets the flag.
0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
Gets or sets The column number for the top-left position. 0 based.
The col1.
Gets or sets The x offset within the top-left cell. Range is from 0 to 1023.
The DX1.
Gets or sets The row number for the top-left corner of the shape.
The row1.
Gets or sets The y offset within the top-left corner of the current shape.
The dy1.
Gets or sets The column of the bottom right corner of this shape.
The col2.
Gets or sets The x offset withing the cell for the bottom-right corner of this shape.
The DX2.
Gets or sets The row number for the bottom-right corner of the current shape.
The row2.
Gets or sets The y offset withing the cell for the bottom-right corner of this shape.
The dy2.
Gets or sets the remaining data.
The remaining data.
The EscherClientDataRecord is used to store client specific data about the position of a
shape within a container.
@author Glen Stampoultzis
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array.
@param offset The offset into data to start writing the record data to.
@param data The byte array to Serialize to.
@param listener A listener to retrieve start and end callbacks. Use a NullEscherSerailizationListener to ignore these events.
@return The number of bytes written.
@see NullEscherSerializationListener
Returns the string representation of this record.
Returns the number of bytes that are required to Serialize this record.
@return Number of bytes
Returns the identifier of this record.
The short name for this record
Any data recording this record.
Escher container records store other escher records as children.
The container records themselves never store any information beyond
the standard header used by all escher records. This one record is
used to represent many different types of records.
@author Glen Stampoultzis
in case if document contains any charts we have such document structure:
BOF
...
DrawingRecord
...
ObjRecord|TxtObjRecord
...
EOF
...
BOF(Chart begin)
...
DrawingRecord
...
ObjRecord|TxtObjRecord
...
EOF
So, when we call EscherAggregate.createAggregate() we have not all needed data.
When we got warning "WARNING: " + bytesRemaining + " bytes remaining but no space left"
we should save value of bytesRemaining
and add it to container size when we serialize it
The contract of this method is to deSerialize an escher record including
it's children.
The byte array containing the Serialized escher
records.
The offset into the byte array.
A factory for creating new escher records
The number of bytes written.
Serializes to an existing byte array without serialization listener.
This is done by delegating to Serialize(int, byte[], EscherSerializationListener).
the offset within the data byte array.
the data array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Do any of our (top level) children have the
given recordId?
The record id.
true if [has child of type] [the specified record id]; otherwise, false.
The display methods allows escher variables to print the record names
according to their hierarchy.
The current indent level.
Adds the child record.
The record.
Returns a that represents the current .
A that represents the current .
Gets the child by id.
The record id.
Recursively find records with the specified record ID
list to store found records
Subclasses should effeciently return the number of bytes required to
Serialize the record.
number of bytes
Returns a list of all the child (escher) records
of the container.
Returns all of our children which are also
EscherContainers (may be 0, 1, or vary rarely
2 or 3)
The child containers.
Subclasses should return the short name for this escher record.
This record defines the drawing groups used for a particular sheet.
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array.
The offset into data to start writing the record data to.
The byte array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Returns a that represents the current .
A that represents the current .
Adds the cluster.
The dg id.
The num shaped used.
Adds the cluster.
id of the drawing group (stored in the record options)
initial value of the numShapedUsed field
if set to true if true then sort clusters by drawing group id.(
In Excel the clusters are sorted but in PPT they are not).
Returns the number of bytes that are required to Serialize this record.
Number of bytes
Return the current record id.
The 16 bit record id.
The short name for this record
Gets or sets the shape id max.
The shape id max.
Gets the Number of id clusters + 1
The num id clusters.
Gets or sets the num shapes saved.
The num shapes saved.
Gets or sets the drawings saved.
The drawings saved.
Gets or sets the max drawing group id.
The max drawing group id.
Gets or sets the file id clusters.
The file id clusters.
This record simply holds the number of shapes in the drawing group and the
last shape id used for this drawing group.
@author Glen Stampoultzis
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array.
The offset into data to start writing the record data to.
The byte array to Serialize to.
The number of bytes written.
a listener for begin and end serialization events.
Returns a that represents the current .
A that represents the current .
Increments the shape count.
Returns the number of bytes that are required to Serialize this record.
Number of bytes
Return the current record id.
The 16 bit record id.
The short name for this record
Gets or sets The number of shapes in this drawing group.
The num shapes.
Gets or sets The last shape id used in this drawing group.
The last MSOSPID.
Gets the drawing group id for this record. This is encoded in the
instance part of the option record.
The drawing group id.
Used to dump the contents of escher records to a PrintStream.
@author Glen Stampoultzis (glens at apache.org)
Decodes the escher stream from a byte array and dumps the results to
a print stream.
The data array containing the escher records.
The starting offset within the data array.
The number of bytes to Read.
This version of dump is a translation from the open office escher dump routine.
The number of bytes to Read
An input stream to Read from.
Returns a property name given a property id. This is used only by the
old escher dump routine.
The property number for the name
A descriptive name.
Returns the blip description given a blip id.
blip id
A description.
Straight conversion from OO. Converts a type of float.
The N32.
Dumps out a hex value by Reading from a input stream.
How many bytes this hex value consists of.
The stream to Read the hex value from.
Dumps the specified record size.
Size of the record.
The data.
@author Daniel Noll
BLIP signatures as defined in the escher spec
The primary UID is only saved to disk if (blip_instance ^ blip_signature == 1)
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into
May be null since this is not a container record.
The number of bytes Read from the byte array.
Serializes the record to an existing byte array.
the offset within the byte array
the data array to Serialize to
a listener for begin and end serialization events.
the number of bytes written.
Decompresses the provided data, returning the inflated result.
the deflated picture data.
the inflated picture data.
Returns a that represents the current .
A that represents the current .
Returns the number of bytes that are required to Serialize this record.
Number of bytes
Gets or sets the UID.
The UID.
Gets or sets the primary UID.
The primary UID.
Gets or sets the size of the uncompressed.
The size of the uncompressed.
Gets or sets the bounds.
The bounds.
Gets or sets the size EMU.
The size EMU.
Gets or sets the size of the compressed.
The size of the compressed.
Gets or sets a value indicating whether this instance is compressed.
true if this instance is compressed; otherwise, false.
Return the blip signature
the blip signature
The opt record is used to store property values for a shape. It is the key to determining
the attributes of a shape. Properties can be of two types: simple or complex. Simple types
are fixed Length. Complex properties are variable Length.
@author Glen Stampoultzis
Automatically recalculate the correct option
The short name for this record
@author Daniel Noll
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into
May be null since this is not a container record.
The number of bytes Read from the byte array.
Serializes the record to an existing byte array.
the offset within the byte array
the data array to Serialize to
a listener for begin and end serialization events.
the number of bytes written.
Decompresses the provided data, returning the inflated result.
the deflated picture data.
the inflated picture data.
Returns a that represents the current .
A that represents the current .
Returns the number of bytes that are required to Serialize this record.
Number of bytes
Gets or sets the UID.
The UID.
Gets or sets the size of the uncompressed.
The size of the uncompressed.
Gets or sets the bounds.
The bounds.
Gets or sets the size EMU.
The size EMU.
Gets or sets the size of the compressed.
The size of the compressed.
Gets a value indicating whether this instance is compressed.
true if this instance is compressed; otherwise, false.
Provides a list of all known escher properties including the description and
type.
@author Glen Stampoultzis (glens at apache.org)
Inits the props.
Adds the prop.
The s.
The data.
Gets the data.
Name of the prop.
The type.
Gets the data.
Name of the prop.
Gets the name of the property.
The property id.
Gets the type of the property.
The property id.
Generates a property given a reference into the byte array storing that property.
@author Glen Stampoultzis
Create new properties from a byte array.
The byte array containing the property
The starting offset into the byte array
The new properties
This class stores the type and description of an escher property.
@author Glen Stampoultzis (glens at apache.org)
Initializes a new instance of the class.
The description of the escher property.
Initializes a new instance of the class.
The description of the escher property.
The type of the property.
Gets the description.
The description.
Gets the type.
The type.
A color property.
@author Glen Stampoultzis (glens at apache.org)
Initializes a new instance of the class.
The property number.
Color of the RGB.
Gets the color of the RGB.
The color of the RGB.
Gets the red.
The red.
Gets the green.
The green.
Gets the blue.
The blue.
Interface for listening to escher serialization events.
@author Glen Stampoultzis (glens at apache.org)
Fired before a given escher record is Serialized.
@param offset The position in the data array at which the record will be Serialized.
@param recordId The id of the record about to be Serialized.
Fired after a record has been Serialized.
@param offset The position of the end of the Serialized record + 1
@param recordId The id of the record about to be Serialized
@param size The number of bytes written for this record. If it is a container
record then this will include the size of any included records.
Defines the constants for the various possible shape paths.
@author Glen Stampoultzis (glens at apache.org)
Initializes a new instance of the class.
The property number.
The shape path.
The spgr record defines information about a shape group. Groups in escher
are simply another form of shape that you can't physically see.
@author Glen Stampoultzis (glens at apache.org)
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array
The offset into data
to start writing the record data to.
The byte array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Returns a that represents the current .
A that represents the current .
Returns the number of bytes that are required to Serialize this record.
Number of bytes
Return the current record id.
The 16 bit identifier of this shape group record.
The short name for this record
Gets or sets the starting top-left coordinate of child records.
The rect x1.
Gets or sets the starting bottom-right coordinate of child records.
The rect x2.
Gets or sets the starting top-left coordinate of child records.
The rect y1.
Gets or sets the starting bottom-right coordinate of child records.
The rect y2.
A list of the most recently used colours for the drawings contained in
this document.
@author Glen Stampoultzis (glens at apache.org)
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
This method Serializes this escher record into a byte array
The offset into data
to start writing the record data to.
The byte array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Returns a that represents the current .
A that represents the current .
@return a string representation of this record.
Returns the number of bytes that are required to Serialize this record.
number of bytes
Return the current record id.
the 16 bit identifer for this record.
Gets the short name for this record
The name of the record.
Gets or sets the color1.
The color1.
Gets or sets the color2.
The color2.
Gets or sets the color3.
The color3.
Gets or sets the color4.
The color4.
ToGether the the EscherOptRecord this record defines some of the basic
properties of a shape.
@author Glen Stampoultzis (glens at apache.org)
The contract of this method is to deSerialize an escher record including
it's children.
The byte array containing the Serialized escher
records.
The offset into the byte array.
A factory for creating new escher records
The number of bytes written.
Serializes to an existing byte array without serialization listener.
This is done by delegating to Serialize(int, byte[], EscherSerializationListener).
the offset within the data byte array.
the data array to Serialize to.
a listener for begin and end serialization events.
The number of bytes written.
Returns a that represents the current .
A that represents the current .
Converts the shape flags into a more descriptive name.
The flags.
Returns the number of bytes that are required to Serialize this record.
Number of bytes
@return the 16 bit identifier for this record.
The short name for this record
Gets or sets A number that identifies this shape
The shape id.
The flags that apply to this shape.
The flags.
Get or set shape type. Must be one of MSOSPT values (see [MS-ODRAW] for details).
Holds data from the parent application. Most commonly used to store
text in the format of the parent application, rather than in
Escher format. We don't attempt to understand the contents, since
they will be in the parent's format, not Escher format.
@author Glen Stampoultzis (glens at apache.org)
@author Nick Burch (nick at torchbox dot com)
The data for this record not including the the 8 byte header
This method deserializes the record from a byte array.
@param data The byte array containing the escher record information
@param offset The starting offset into data.
@param recordFactory May be null since this is not a container record.
@return The number of bytes Read from the byte array.
Writes this record and any contained records to the supplied byte
a listener for begin and end serialization events.
the number of bytes written.
Sets the extra data (in the parent application's format) to be
contained by the record. Used when the parent application changes
the contents.
The b.
The start.
The length.
Sets the data.
The b.
Returns a that represents the current .
A that represents the current .
Returns any extra data associated with this record. In practice excel
does not seem to put anything here, but with PowerPoint this will
contain the bytes that make up a TextHeaderAtom followed by a
TextBytesAtom/TextCharsAtom
The data.
Returns the number of bytes that are required to serialize this record.
Number of bytes
The short name for this record
This record is used whenever a escher record is encountered that
we do not explicitly support.
@author Glen Stampoultzis (glens at apache.org)
The data for this record not including the the 8 byte header
This method deSerializes the record from a byte array.
The byte array containing the escher record information
The starting offset into data
May be null since this is not a container record.
The number of bytes Read from the byte array.
Writes this record and any contained records to the supplied byte
array.
a listener for begin and end serialization events.
the number of bytes written.
Returns a that represents the current .
A that represents the current .
Adds the child record.
The child record.
Gets the data.
The data.
Returns the number of bytes that are required to Serialize this record.
Number of bytes
Returns the children of this record. By default this will
be an empty list. EscherCotainerRecord is the only record
that may contain children.
The short name for this record
Defines constants of general use.
@author Rainer Klute klute@rainer-klute.de
@since 2004-06-20
Allow accessing the Initial value.
Codepage 037, a special case
Codepage for SJIS
Codepage for GBK, aka MS936
Codepage for MS949
Codepage for UTF-16
Codepage for UTF-16 big-endian
Codepage for Windows 1250
Codepage for Windows 1251
Codepage for Windows 1252
Codepage for Windows 1253
Codepage for Windows 1254
Codepage for Windows 1255
Codepage for Windows 1256
Codepage for Windows 1257
Codepage for Windows 1258
Codepage for Johab
Codepage for Macintosh Roman (Java: MacRoman)
Codepage for Macintosh Japan (Java: unknown - use SJIS, cp942 or
cp943)
Codepage for Macintosh Chinese Traditional (Java: unknown - use Big5,
MS950, or cp937)
Codepage for Macintosh Korean (Java: unknown - use EUC_KR or
cp949)
Codepage for Macintosh Arabic (Java: MacArabic)
Codepage for Macintosh Hebrew (Java: MacHebrew)
Codepage for Macintosh Greek (Java: MacGreek)
Codepage for Macintosh Cyrillic (Java: MacCyrillic)
Codepage for Macintosh Chinese Simplified (Java: unknown - use
EUC_CN, ISO2022_CN_GB, MS936 or cp935)
Codepage for Macintosh Romanian (Java: MacRomania)
Codepage for Macintosh Ukrainian (Java: MacUkraine)
Codepage for Macintosh Thai (Java: MacThai)
Codepage for Macintosh Central Europe (Latin-2)
(Java: MacCentralEurope)
Codepage for Macintosh Iceland (Java: MacIceland)
Codepage for Macintosh Turkish (Java: MacTurkish)
Codepage for Macintosh Croatian (Java: MacCroatian)
Codepage for US-ASCII
Codepage for KOI8-R
Codepage for ISO-8859-1
Codepage for ISO-8859-2
Codepage for ISO-8859-3
Codepage for ISO-8859-4
Codepage for ISO-8859-5
Codepage for ISO-8859-6
Codepage for ISO-8859-7
Codepage for ISO-8859-8
Codepage for ISO-8859-9
Codepage for ISO-2022-JP
Another codepage for ISO-2022-JP
Yet another codepage for ISO-2022-JP
Codepage for ISO-2022-KR
Codepage for EUC-JP
Codepage for EUC-KR
Codepage for GB2312
Codepage for GB18030
Another codepage for US-ASCII
Codepage for UTF-8
Codepage for Unicode
Maintains the instances of {@link CustomProperty} that belong To a
{@link DocumentSummaryInformation}. The class maintains the names of the
custom properties in a dictionary. It implements the {@link Map} interface
and by this provides a simplified view on custom properties: A property's
name is the key that maps To a typed value. This implementation hides
property IDs from the developer and regards the property names as keys To
typed values.
While this class provides a simple API To custom properties, it ignores
the fact that not names, but IDs are the real keys To properties. Under the
hood this class maintains a 1:1 relationship between IDs and names. Therefore
you should not use this class To process property Sets with several IDs
mapping To the same name or with properties without a name: the result will
contain only a subSet of the original properties. If you really need To deal
such property Sets, use HPSF's low-level access methods.
An application can call the {@link #isPure} method To check whether a
property Set parsed by {@link CustomProperties} is still pure (i.e.
unmodified) or whether one or more properties have been dropped.
This class is not thRead-safe; concurrent access To instances of this
class must be syncronized.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2006-02-09
Maps property IDs To property names.
Maps property names To property IDs.
Tells whether this object is pure or not.
Puts a {@link CustomProperty} into this map. It is assumed that the
{@link CustomProperty} alReady has a valid ID. Otherwise use
{@link #Put(CustomProperty)}.
The name.
The custom property.
Returns a set of all the names of our
custom properties. Equivalent to
{@link #nameSet()}
Returns a set of all the names of our
custom properties
Returns a set of all the IDs of our
custom properties
Puts a {@link CustomProperty} that has not yet a valid ID into this
map. The method will allocate a suitable ID for the custom property:
- If there is alReady a property with the same name, take the ID
of that property.
- Otherwise Find the highest ID and use its value plus one.
The custom property.
If the was alReady a property with the same name, the
Removes a custom property.
The name of the custom property To Remove
The Removed property or
null
if the specified property was not found.
Adds a named string property.
The property's name.
The property's value.
the property that was stored under the specified name before, or
null
if there was no such property before.
Adds a named long property
The property's name.
The property's value.
the property that was stored under the specified name before, or
null
if there was no such property before.
Adds a named double property.
The property's name.
The property's value.
the property that was stored under the specified name before, or
null
if there was no such property before.
Adds a named integer property.
The property's name.
The property's value.
the property that was stored under the specified name before, or
null
if there was no such property before.
Adds a named bool property.
The property's name.
The property's value.
the property that was stored under the specified name before, or
null
if there was no such property before.
Adds a named date property.
The property's name.
The property's value.
the property that was stored under the specified name before, or
null
if there was no such property before.
Checks against both String Name and Long ID
Checks against both the property, and its values.
Gets the with the specified name.
the value or
null
if a value with the specified
name is not found in the custom properties.
Gets the dictionary which Contains IDs and names of the named custom
properties.
The dictionary.
Gets or sets the codepage.
The codepage.
Tells whether this {@link CustomProperties} instance is pure or one or
more properties of the underlying low-level property Set has been
dropped.
true if this instance is pure; otherwise, false.
This class represents custum properties in the document summary
information stream. The difference To normal properties is that custom
properties have an optional name. If the name is not null it
will be maintained in the section's dictionary.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2006-02-09
Adds writing capability To the {@link Property} class.
Please be aware that this class' functionality will be merged into the
{@link Property} class at a later time, so the API will Change.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2003-08-03
A property in a {@link Section} of a {@link PropertySet}.
The property's ID gives the property a meaning
in the context of its {@link Section}. Each {@link Section} spans
its own name space of property IDs.
The property's type determines how its
value is interpreted. For example, if the type Is
{@link Variant#VT_LPSTR} (byte string), the value consists of a
DWord telling how many bytes the string Contains. The bytes follow
immediately, including any null bytes that terminate the
string. The type {@link Variant#VT_I4} denotes a four-byte integer
value, {@link Variant#VT_FILETIME} some DateTime and time (of a
file).
Please note that not all {@link Variant} types yet. This might Change
over time but largely depends on your feedback so that the POI team knows
which variant types are really needed. So please feel free To submit error
reports or patches for the types you need.
Microsoft documentation:
Property Set Display Name Dictionary
.
@author Rainer Klute
<klute@rainer-klute.de>
@author Drew Varner (Drew.Varner InAndAround sc.edu)
@see Section
@see Variant
@since 2002-02-09
The property's ID.
The property's type.
The property's value.
Initializes a new instance of the class.
the property's ID.
the property's type, see {@link Variant}.
the property's value. Only certain types are allowed, see
{@link Variant}.
Initializes a new instance of the class.
The property's ID.
The bytes the property Set stream consists of.
The property's type/value pair's offset in the
section.
The property's type/value pair's Length in bytes.
The section's and thus the property's
codepage. It is needed only when Reading string values
Initializes a new instance of the class.
Reads the dictionary.
The byte array containing the bytes making out the dictionary.
At this offset within src the dictionary starts.
The dictionary Contains at most this many bytes.
The codepage of the string values.
The dictonary
Compares two properties.
Please beware that a property with
ID == 0 is a special case: It does not have a type, and its value is the
section's dictionary. Another special case are strings: Two properties
may have the different types Variant.VT_LPSTR and Variant.VT_LPWSTR;
The o.
Typeses the are equal.
The t1.
The t2.
Serves as a hash function for a particular type.
A hash code for the current .
Returns a that represents the current .
A that represents the current .
Returns the property's ID.
@return The ID value
Returns the property's type.
@return The type value
Gets the property's value.
The property's value
Gets the property's size in bytes. This is always a multiple of
4.
the property's size in bytes
Creates an empty property. It must be Filled using the Set method To
be usable.
Initializes a new instance of the class.
The property To copy.
Writes the property To an output stream.
The output stream To Write To.
The codepage To use for writing non-wide strings
the number of bytes written To the stream
Initializes a new instance of the class.
Initializes a new instance of the class.
the property To copy
Initializes a new instance of the class.
This property's attributes are copied To the new custom
property.
The new custom property's name.
Compares two custom properties for equality. The method returns
true if all attributes of the two custom properties are
equal.
The custom property To Compare with.
true
if both custom properties are equal, else
false
@see Object#GetHashCode()
Gets or sets the property's name.
the property's name.
Convenience class representing a DocumentSummary Information stream in a
Microsoft Office document.
@author Rainer Klute
klute@rainer-klute.de
@author Drew Varner (Drew.Varner cloSeto sc.edu)
@author robert_flaherty@hyperion.com
@since 2002-02-09
Abstract superclass for the convenience classes {@link
SummaryInformation} and {@link DocumentSummaryInformation}.
The motivation behind this class is quite nasty if you look
behind the scenes, but it serves the application programmer well by
providing him with the easy-to-use {@link SummaryInformation} and
{@link DocumentSummaryInformation} classes. When parsing the data a
property Set stream consists of (possibly coming from an {@link
java.io.Stream}) we want To Read and process each byte only
once. Since we don't know in advance which kind of property Set we
have, we can expect only the most general {@link
PropertySet}. Creating a special subclass should be as easy as
calling the special subclass' constructor and pass the general
{@link PropertySet} in. To make things easy internally, the special
class just holds a reference To the general {@link PropertySet} and
delegates all method calls To it.
A cleaner implementation would have been like this: The {@link
PropertySetFactory} parses the stream data into some internal
object first. Then it Finds out whether the stream is a {@link
SummaryInformation}, a {@link DocumentSummaryInformation} or a
general {@link PropertySet}. However, the current implementation
went the other way round historically: the convenience classes came
only late To my mind.
@author Rainer Klute
klute@rainer-klute.de
@since 2002-02-09
Adds writing support To the {@link PropertySet} class.
Please be aware that this class' functionality will be merged into the
{@link PropertySet} class at a later time, so the API will Change.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2003-02-19
Represents a property Set in the Horrible Property Set Format
(HPSF). These are usually metadata of a Microsoft Office
document.
An application that wants To access these metadata should Create
an instance of this class or one of its subclasses by calling the
factory method {@link PropertySetFactory#Create} and then retrieve
the information its needs by calling appropriate methods.
{@link PropertySetFactory#Create} does its work by calling one
of the constructors {@link PropertySet#PropertySet(InputStream)} or
{@link PropertySet#PropertySet(byte[])}. If the constructor's
argument is not in the Horrible Property Set Format, i.e. not a
property Set stream, or if any other error occurs, an appropriate
exception is thrown.
A {@link PropertySet} has a list of {@link Section}s, and each
{@link Section} has a {@link Property} array. Use {@link
#GetSections} To retrieve the {@link Section}s, then call {@link
Section#GetProperties} for each {@link Section} To Get hold of the
{@link Property} arrays. Since the vast majority of {@link
PropertySet}s Contains only a single {@link Section}, the
convenience method {@link #GetProperties} returns the properties of
a {@link PropertySet}'s {@link Section} (throwing a {@link
NoSingleSectionException} if the {@link PropertySet} Contains more
(or less) than exactly one {@link Section}).
@author Rainer Klute
<klute@rainer-klute.de>
@author Drew Varner (Drew.Varner hanginIn sc.edu)
@since 2002-02-09
If the OS version field holds this value the property Set stream Was
Created on a 16-bit Windows system.
If the OS version field holds this value the property Set stream Was
Created on a Macintosh system.
If the OS version field holds this value the property Set stream Was
Created on a 32-bit Windows system.
The "byteOrder" field must equal this value.
Specifies this {@link PropertySet}'s byte order. See the
HPFS documentation for details!
The "format" field must equal this value.
Specifies this {@link PropertySet}'s format. See the HPFS
documentation for details!
Specifies the version of the operating system that Created
this {@link PropertySet}. See the HPFS documentation for
details!
Specifies this {@link PropertySet}'s "classID" field. See
the HPFS documentation for details!
The sections in this {@link PropertySet}.
Creates an empty (uninitialized) {@link PropertySet}
Please note: For the time being this
constructor is protected since it is used for internal purposes
only, but expect it To become public once the property Set's
writing functionality is implemented.
Creates a {@link PropertySet} instance from an {@link
InputStream} in the Horrible Property Set Format.
The constructor Reads the first few bytes from the stream
and determines whether it is really a property Set stream. If
it Is, it parses the rest of the stream. If it is not, it
Resets the stream To its beginning in order To let other
components mess around with the data and throws an
exception.
Holds the data making out the property Set
stream.
Creates a {@link PropertySet} instance from a byte array
that represents a stream in the Horrible Property Set
Format.
The byte array holding the stream data.
The offset in stream where the stream data begin.
If the stream data begin with the first byte in the
array, the offset is 0.
The Length of the stream data.
Creates a {@link PropertySet} instance from a byte array
that represents a stream in the Horrible Property Set
Format.
The byte array holding the stream data. The
complete byte array contents is the stream data.
Checks whether an {@link InputStream} is in the Horrible
Property Set Format.
The {@link InputStream} To check. In order To
perform the check, the method Reads the first bytes from the
stream. After Reading, the stream is Reset To the position it
had before Reading. The {@link InputStream} must support the
{@link InputStream#mark} method.
true if the stream is a property Set
stream; otherwise, false.
Checks whether a byte array is in the Horrible Property Set
Format.
The byte array To check.
The offset in the byte array.
The significant number of bytes in the byte
array. Only this number of bytes will be checked.
true if the byte array is a property Set
stream; otherwise, false.
Initializes this {@link PropertySet} instance from a byte
array. The method assumes that it has been checked alReady that
the byte array indeed represents a property Set stream. It does
no more checks on its own.
Byte array containing the property Set stream
The property Set stream starts at this offset
Length of the property Set stream.
Convenience method returning the value of the property with
the specified ID. If the property is not available,
null is returned and a subsequent call To {@link
#WasNull} will return true .
The property ID
The property value
Convenience method returning the value of a bool property
with the specified ID. If the property is not available,
false is returned. A subsequent call To {@link
#WasNull} will return true To let the caller
distinguish that case from a real property value of
false.
The property ID
The property value
Convenience method returning the value of the numeric
property with the specified ID. If the property is not
available, 0 is returned. A subsequent call To {@link #WasNull}
will return true To let the caller distinguish
that case from a real property value of 0.
The property ID
The propertyIntValue value
Returns true if the PropertySet is equal
To the specified parameter, else false.
the object To Compare this
PropertySet
with
true
if the objects are equal,
false
if not
Serves as a hash function for a particular type.
A hash code for the current .
Returns a that represents the current .
A that represents the current .
Gets or sets the property Set stream's low-level "byte order"
field. It is always 0xFFFE
The property Set stream's low-level "byte order" field..
Gets or sets the property Set stream's low-level "format"
field. It is always 0x0000
The property Set stream's low-level "format" field.
Returns the property Set stream's low-level "OS version"
field.
The property Set stream's low-level "OS version" field.
Gets or sets the property Set stream's low-level "class ID"
The property Set stream's low-level "class ID" field.
Returns the number of {@link Section}s in the property
Set.
The number of {@link Section}s in the property Set.
Returns the {@link Section}s in the property Set.
{@link Section}s in the property Set.
Checks whether this {@link PropertySet} represents a Summary
Information.
true Checks whether this {@link PropertySet} represents a Summary
Information; otherwise, false.
Gets a value indicating whether this instance is document summary information.
true if this instance is document summary information; otherwise, false.
Checks whether this {@link PropertySet} is a Document
Summary Information.
@return
true
if this {@link PropertySet}
represents a Document Summary Information, else
false
Convenience method returning the {@link Property} array
contained in this property Set. It is a shortcut for Getting
the {@link PropertySet}'s {@link Section}s list and then
Getting the {@link Property} array from the first {@link
Section}.
The properties of the only {@link Section} of this
{@link PropertySet}.
Checks whether the property which the last call To {@link
#GetPropertyIntValue} or {@link #GetProperty} tried To access
Was available or not. This information might be important for
callers of {@link #GetPropertyIntValue} since the latter
returns 0 if the property does not exist. Using {@link
#WasNull}, the caller can distiguish this case from a
property's real value of 0.
true if the last call To {@link
#GetPropertyIntValue} or {@link #GetProperty} tried To access a
property that Was not available; otherwise, false.
Gets the first section.
The first section.
If the {@link PropertySet} has only a single section this
method returns it.
The singleSection value
Initializes a new instance of the class.
Its primary task is To initialize the immutable field with their proper
values. It also Sets fields that might Change To reasonable defaults.
Initializes a new instance of the class.
All nested elements, i.e.Sections and Property instances, will be their
mutable counterparts in the new MutablePropertySet.
The property Set To copy
The Length of the property Set stream header.
Removes all sections from this property Set.
Adds a section To this property Set.
section The {@link Section} To Add. It will be Appended
after any sections that are alReady present in the property Set
and thus become the last section.
Writes the property Set To an output stream.
the output stream To Write the section To
Returns the contents of this property Set stream as an input stream.
The latter can be used for example To Write the property Set into a POIFS
document. The input stream represents a snapshot of the property Set.
If the latter is modified while the input stream is still being
Read, the modifications will not be reflected in the input stream but in
the {@link MutablePropertySet} only.
the contents of this property Set stream
Returns the contents of this property set stream as an input stream.
The latter can be used for example to write the property set into a POIFS
document. The input stream represents a snapshot of the property set.
If the latter is modified while the input stream is still being
read, the modifications will not be reflected in the input stream but in
the {@link MutablePropertySet} only.
the contents of this property set stream
Writes a property Set To a document in a POI filesystem directory
The directory in the POI filesystem To Write the document To.
The document's name. If there is alReady a document with the
same name in the directory the latter will be overwritten.
Gets or sets the "byteOrder" property.
the byteOrder value To Set
Gets or sets the "format" property.
the format value To Set
Gets or sets the "osVersion" property
the osVersion value To Set.
Gets or sets the property Set stream's low-level "class ID"
The property Set stream's low-level "class ID" field.
The "real" property Set SpecialPropertySet
delegates To.
Initializes a new instance of the class.
The property Set To be encapsulated by the SpecialPropertySet
Initializes a new instance of the class.
The mutable property Set To be encapsulated by the SpecialPropertySet
Adds a section To this property set.
The {@link Section} To Add. It will be Appended
after any sections that are alReady present in the property Set
and thus become the last section.
Removes all sections from this property Set.
Returns the contents of this property Set stream as an input stream.
The latter can be used for example To Write the property Set into a POIFS
document. The input stream represents a snapshot of the property Set.
If the latter is modified while the input stream is still being
Read, the modifications will not be reflected in the input stream but in
the {@link MutablePropertySet} only.
the contents of this PropertySet stream
Writes a property Set To a document in a POI filesystem directory.
The directory in the POI filesystem To Write the document To
The document's name. If there is alReady a document with the
same name in the directory the latter will be overwritten.
Writes the property Set To an output stream.
the output stream To Write the section To
Returns true if the PropertySet is equal
To the specified parameter, else false.
the object To Compare this
PropertySet
with
true
if the objects are equal,
false
if not
Convenience method returning the value of the property with
the specified ID. If the property is not available,
null is returned and a subsequent call To {@link
#WasNull} will return true .
The property ID
The property value
Convenience method returning the value of a bool property
with the specified ID. If the property is not available,
false is returned. A subsequent call To {@link
#WasNull} will return true To let the caller
distinguish that case from a real property value of
false.
The property ID
The property value
Convenience method returning the value of the numeric
property with the specified ID. If the property is not
available, 0 is returned. A subsequent call To {@link #WasNull}
will return true To let the caller distinguish
that case from a real property value of 0.
The property ID
The propertyIntValue value
Serves as a hash function for a particular type.
A hash code for the current .
Returns a that represents the current .
A that represents the current .
The id to name mapping of the properties
in this set.
gets or sets the "byteOrder" property.
the byteOrder value To Set
gets or sets the "format" property
the format value To Set
gets or sets the property Set stream's low-level "class ID"
field.
The property Set stream's low-level "class ID" field
Returns the number of {@link Section}s in the property
Set.
The number of {@link Section}s in the property Set.
Checks whether this {@link PropertySet} represents a Summary
Information.
true Checks whether this {@link PropertySet} represents a Summary
Information; otherwise, false.
Gets a value indicating whether this instance is document summary information.
true if this instance is document summary information; otherwise, false.
Checks whether this {@link PropertySet} is a Document
Summary Information.
@return
true
if this {@link PropertySet}
represents a Document Summary Information, else
false
Gets the PropertySet's first section.
The {@link PropertySet}'s first section.
gets or sets the "osVersion" property
the osVersion value To Set
Convenience method returning the {@link Property} array
contained in this property Set. It is a shortcut for Getting
the {@link PropertySet}'s {@link Section}s list and then
Getting the {@link Property} array from the first {@link
Section}.
The properties of the only {@link Section} of this
{@link PropertySet}.
Checks whether the property which the last call To {@link
#GetPropertyIntValue} or {@link #GetProperty} tried To access
Was available or not. This information might be important for
callers of {@link #GetPropertyIntValue} since the latter
returns 0 if the property does not exist. Using {@link
#WasNull}, the caller can distiguish this case from a
property's real value of 0.
true if the last call To {@link
#GetPropertyIntValue} or {@link #GetProperty} tried To access a
property that Was not available; otherwise, false.
The document name a document summary information stream
usually has in a POIFS filesystem.
Initializes a new instance of the class.
A property Set which should be Created from a
document summary information stream.
Removes the category.
Removes the presentation format.
Removes the byte count.
Removes the line count.
Removes the par count.
Removes the slide count.
Removes the note count.
Removes the hidden count.
Removes the MMClip count.
Removes the scale.
Removes the heading pair.
Removes the doc parts.
Removes the manager.
Removes the company.
Removes the links dirty.
Creates section 2 if it is not alReady present.
Removes the custom properties.
Gets or sets the category.
The category value
Gets or sets the presentation format (or null).
The presentation format value
Gets or sets the byte count or 0 if the {@link
DocumentSummaryInformation} does not contain a byte count.
The byteCount value
Gets or sets the line count or 0 if the {@link
DocumentSummaryInformation} does not contain a line count.
The line count value.
Gets or sets the par count or 0 if the {@link
DocumentSummaryInformation} does not contain a par count.
The par count value
Gets or sets the slide count or 0 if the {@link
DocumentSummaryInformation} does not contain a slide count.
The slide count value
Gets or sets the note count or 0 if the {@link
DocumentSummaryInformation} does not contain a note count
The note count value
Gets or sets the hidden count or 0 if the {@link
DocumentSummaryInformation} does not contain a hidden
count.
The hidden count value.
Returns the mmclip count or 0 if the {@link
DocumentSummaryInformation} does not contain a mmclip
count.
The mmclip count value.
Gets or sets a value indicating whether this is scale.
true if cropping is desired; otherwise, false.
Gets or sets the heading pair (or null)
The heading pair value.
Gets or sets the doc parts.
The doc parts value
Gets or sets the manager (or null).
The manager value
Gets or sets the company (or null).
The company value
Gets or sets a value indicating whether [links dirty].
true if the custom links are dirty.; otherwise, false.
Gets or sets the custom properties.
The custom properties.
Extracts all of the HPSF properties, both
build in and custom, returning them in
textual form.
Common Parent for Text Extractors
of POI Documents.
You will typically find the implementation of
a given format's text extractor under
org.apache.poi.[format].extractor .
@see org.apache.poi.hssf.extractor.ExcelExtractor
@see org.apache.poi.hslf.extractor.PowerPointExtractor
@see org.apache.poi.hdgf.extractor.VisioTextExtractor
@see org.apache.poi.hwpf.extractor.WordExtractor
The POIDocument that's open
Creates a new text extractor for the given document
The document.
Creates a new text extractor, using the same
document as another text extractor. Normally
only used by properties extractors.
The other extractor.
Retrieves all the text from the document.
How cells, paragraphs etc are separated in the text
is implementation specific - see the javadocs for
a specific project for details.
All the text from the document.
Returns another text extractor, which is able to
output the textual content of the document
metadata / properties, such as author and title.
The metadata text extractor.
Gets the properties text.
The ps.
Gets the property value text.
The val.
Gets the document summary information text.
The document summary information text.
Gets the summary information text.
The summary information text.
Return the text of all the properties defined in
the document.
All the text from the document.
Returns another text extractor, which is able to
output the textual content of the document
metadata / properties, such as author and title.
The metadata text extractor.
So we can get at the properties of any
random OLE2 document.
This holds the common functionality for all POI
Document classes.
Currently, this relates to Document Information Properties
@author Nick Burch
Holds metadata on our document
Holds further metadata on our document
The directory that our document lives in
For our own logging use
Initializes a new instance of the class.
The dir.
The fs.
Initializes a new instance of the class.
The fs.
Will create whichever of SummaryInformation
and DocumentSummaryInformation (HPSF) properties
are not already part of your document.
This is normally useful when creating a new
document from scratch.
If the information properties are already there,
then nothing will happen.
Find, and Create objects for, the standard
Documment Information Properties (HPSF).
If a given property Set is missing or corrupt,
it will remain null;
For a given named property entry, either return it or null if
if it wasn't found
Name of the set.
Writes out the standard Documment Information Properties (HPSF)
the POIFSFileSystem to Write the properties into
Writes out the standard Documment Information Properties (HPSF)
the POIFSFileSystem to Write the properties into.
a list of POIFS entries to Add the property names too.
Writes out a given ProperySet
the (POIFS Level) name of the property to Write.
the PropertySet to Write out.
the POIFSFileSystem to Write the property into.
Writes the document out to the specified output stream
The out1.
Copies nodes from one POIFS to the other minus the excepts
the source POIFS to copy from.
the target POIFS to copy to
a list of Strings specifying what nodes NOT to copy
Copies nodes from one POIFS to the other minus the excepts
the source POIFS to copy from.
the target POIFS to copy to
a list of Strings specifying what nodes NOT to copy
Checks to see if the String is in the list, used when copying
nodes between one POIFS and another
The entry.
The list.
true if [is in list] [the specified entry]; otherwise, false.
Copies an Entry into a target POIFS directory, recursively
The entry.
The target.
Fetch the Document Summary Information of the document
The document summary information.
Fetch the Summary Information of the document
The summary information.
This exception is the superclass of all other checked exceptions thrown
in this package. It supports a nested "reason" throwable, i.e. an exception
that caused this one To be thrown.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
Initializes a new instance of the class.
Initializes a new instance of the class.
The message string.
Initializes a new instance of the class.
The reason, i.e. a throwable that indirectly
caused this exception.
Initializes a new instance of the class.
The message string.
The reason, i.e. a throwable that indirectly
caused this exception.
Returns the {@link Exception} that caused this exception To
be thrown or null if there was no such {@link
Exception}.
The reason.
This exception is the superclass of all other unchecked
exceptions thrown in this package. It supports a nested "reason"
throwable, i.e. an exception that caused this one To be thrown.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
Initializes a new instance of the class.
Initializes a new instance of the class.
The message string.
Initializes a new instance of the class.
The reason, i.e. a throwable that indirectly
caused this exception.
Initializes a new instance of the class.
The message string.
The reason, i.e. a throwable that indirectly
caused this exception.
This exception is thrown when there is an illegal value Set in a
{@link PropertySet}. For example, a {@link Variant#VT_BOOL} must
have a value of -1 (true) or 0 (false).
Any other value would trigger this exception. It supports a nested
"reason" throwable, i.e. an exception that caused this one To be
thrown.
@author Drew Varner(Drew.Varner atDomain sc.edu)
@since 2002-05-26
Initializes a new instance of the class.
Initializes a new instance of the class.
The exception's message string
Initializes a new instance of the class.
This exception's underlying reason
Initializes a new instance of the class.
The exception's message string
This exception's underlying reason
This exception is thrown if HPSF encounters a variant type that is illegal
in the current context.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2004-06-21
This exception is thrown if HPSF encounters a problem with a variant type.
Concrete subclasses specifiy the problem further.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2004-06-21
Initializes a new instance of the class.
The variant type causing the problem
The value who's variant type causes the problem
A message text describing the problem
Gets the offending variant type
the offending variant type.
Returns the value who's variant type caused the problem.
the value who's variant type caused the problem.
Initializes a new instance of the class.
The unsupported variant type
The value
A message string
Initializes a new instance of the class.
The unsupported variant type
The value.
This exception is thrown if an {@link java.io.InputStream} does
not support the {@link java.io.InputStream#mark} operation.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
Initializes a new instance of the class.
Initializes a new instance of the class.
The exception's message string.
Initializes a new instance of the class.
This exception's underlying reason.
Initializes a new instance of the class.
The exception's message string
This exception's underlying reason
This exception is thrown if one of the {@link PropertySet}'s
convenience methods does not Find a required {@link Section}.
The constructors of this class are analogous To those of its
superclass and documented there.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2006-02-08
Initializes a new instance of the class.
Initializes a new instance of the class.
The exception's message string
Initializes a new instance of the class.
This exception's underlying reason.
Initializes a new instance of the class.
The exception's message string
This exception's underlying reason
Adds writing capability To the {@link Section} class.
Please be aware that this class' functionality will be merged into the
{@link Section} class at a later time, so the API will Change.
@since 2002-02-20
Represents a section in a {@link PropertySet}.
@author Rainer Klute
<klute@rainer-klute.de>
@author Drew Varner (Drew.Varner allUpIn sc.edu)
@since 2002-02-09
Maps property IDs To section-private PID strings. These
strings can be found in the property with ID 0.
The section's format ID, {@link #GetFormatID}.
Creates an empty and uninitialized {@link Section}.
Creates a {@link Section} instance from a byte array.
Contains the complete property Set stream.
The position in the stream that points To the
section's format ID.
Returns the value of the property with the specified ID. If
the property is not available, null is returned
and a subsequent call To {@link #wasNull} will return
true.
@param id The property's ID
@return The property's value
Returns the value of the numeric property with the specified
ID. If the property is not available, 0 is returned. A
subsequent call To {@link #wasNull} will return
true To let the caller distinguish that case from
a real property value of 0.
@param id The property's ID
@return The property's value
Returns the value of the bool property with the specified
ID. If the property is not available, false Is
returned. A subsequent call To {@link #wasNull} will return
true To let the caller distinguish that case from
a real property value of false.
@param id The property's ID
@return The property's value
This member is true if the last call To {@link
#GetPropertyIntValue} or {@link #GetProperty} tried To access a
property that was not available, else false.
Returns the PID string associated with a property ID. The ID
is first looked up in the {@link Section}'s private
dictionary. If it is not found there, the method calls {@link
SectionIDMap#GetPIDString}.
The property ID.
The property ID's string value
Checks whether this section is equal To another object. The result Is
false if one of the the following conditions holds:
- The other object is not a {@link Section}.
- The format IDs of the two sections are not equal.
- The sections have a different number of properties. However,
properties with ID 1 (codepage) are not counted.
- The other object is not a {@link Section}.
- The properties have different values. The order of the properties
is irrelevant.
@param o The object To Compare this section with
@return true if the objects are equal, false if
not
Removes a field from a property array. The resulting array Is
compactified and returned.
The property array.
The index of the field To be Removed.
the compactified array.
Serves as a hash function for a particular type.
A hash code for the current .
Returns a that represents the current .
A that represents the current .
Returns the format ID. The format ID is the "type" of the
section. For example, if the format ID of the first {@link
Section} Contains the bytes specified by
org.apache.poi.hpsf.wellknown.SectionIDMap.SUMMARY_INFORMATION_ID
the section (and thus the property Set) is a SummaryInformation.
The format ID.
Gets the offset of the section in the stream.
The offset of the section in the stream
Returns the section's size in bytes.
The section's size in bytes.
Returns the number of properties in this section.
The number of properties in this section.
Returns this section's properties.
This section's properties.
Checks whether the property which the last call To {@link
#GetPropertyIntValue} or {@link #GetProperty} tried To access
was available or not. This information might be important for
callers of {@link #GetPropertyIntValue} since the latter
returns 0 if the property does not exist. Using {@link
#wasNull} the caller can distiguish this case from a property's
real value of 0.
true if the last call To {@link
#GetPropertyIntValue} or {@link #GetProperty} tried To access a
property that was not available; otherwise, false.
Gets the section's dictionary. A dictionary allows an application To
use human-Readable property names instead of numeric property IDs. It
Contains mappings from property IDs To their associated string
values. The dictionary is stored as the property with ID 0. The codepage
for the strings in the dictionary is defined by property with ID 1.
the dictionary or null
if the section does not have
a dictionary.
Gets the section's codepage, if any.
The section's codepage if one is defined, else -1.
Represents an entry in the property list and holds a property's ID and
its offset from the section's beginning.
Compares this {@link PropertyListEntry} with another one by their
offsets. A {@link PropertyListEntry} is "smaller" than another one if
its offset from the section's begin is smaller.
@see Comparable#CompareTo(java.lang.Object)
If the "dirty" flag is true, the section's size must be
(re-)calculated before the section is written.
List To assemble the properties. Unfortunately a wrong
decision has been taken when specifying the "properties" field
as an Property[]. It should have been a {@link java.util.List}.
Contains the bytes making out the section. This byte array is
established when the section's size is calculated and can be reused
later. It is valid only if the "dirty" flag is false.
Initializes a new instance of the class.
Constructs a MutableSection by doing a deep copy of an
existing Section. All nested Property
instances, will be their mutable counterparts in the new
MutableSection.
The section Set To copy
Sets the section's format ID.
The section's format ID
Sets the section's format ID.
The section's format ID as a byte array. It components
are in big-endian format.
Sets this section's properties. Any former values are overwritten.
This section's new properties.
Sets the string value of the property with the specified ID.
The property's ID
The property's value. It will be written as a Unicode
string.
Sets the int value of the property with the specified ID.
The property's ID
The property's value.
Sets the long value of the property with the specified ID.
The property's ID
The property's value.
Sets the bool value of the property with the specified ID.
The property's ID
The property's value.
Sets the value and the variant type of the property with the
specified ID. If a property with this ID is not yet present in
the section, it will be Added. An alReady present property with
the specified ID will be overwritten. A default mapping will be
used To choose the property's type.
The property's ID.
The property's variant type.
The property's value.
Sets the property.
The property To be Set.
Removes the property.
The ID of the property To be Removed
Sets the value of the bool property with the specified
ID.
The property's ID
The property's value
Calculates the section's size. It is the sum of the Lengths of the
section's header (8), the properties list (16 times the number of
properties) and the properties themselves.
the section's Length in bytes.
Writes this section into an output stream.
Internally this is done by writing into three byte array output
streams: one for the properties, one for the property list and one for
the section as such. The two former are Appended To the latter when they
have received all their data.
The stream To Write into.
The number of bytes written, i.e. the section's size.
Writes the section's dictionary
The output stream To Write To.
The dictionary.
The codepage to be used to Write the dictionary items.
The number of bytes written
see MSDN KB: http://msdn.microsoft.com/en-us/library/aa380065(VS.85).aspx
Ensures the properties.
Gets a property.
The ID of the property To Get
The property or null if there is no such property
Sets the property.
The property ID.
The property's value. The value's class must be one of those
supported by HPSF.
Removes all properties from the section including 0 (dictionary) and
1 (codepage).
Returns the section's size in bytes.
The section's size in bytes.
OverWrites the base class' method To cope with a redundancy:
the property count is maintained in a separate member variable, but
shouldn't.
The number of properties in this section.
Returns this section's properties.
This section's properties.
Sets the section's dictionary. All keys in the dictionary must be
{@link java.lang.long} instances, all values must be
{@link java.lang.String}s. This method overWrites the properties with IDs
0 and 1 since they are reserved for the dictionary and the dictionary's
codepage. Setting these properties explicitly might have surprising
effects. An application should never do this but always use this
method.
the dictionary
Gets the section's codepage, if any.
The section's codepage if one is defined, else -1.
This exception is thrown if a {@link MutablePropertySet} is To be written
but does not have a formatID Set (see {@link
MutableSection#SetFormatID(ClassID)} or
{@link org.apache.poi.hpsf.MutableSection#SetFormatID(byte[])}.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-09-03
Initializes a new instance of the class.
Initializes a new instance of the class.
The exception's message string
Initializes a new instance of the class.
This exception's underlying reason
Initializes a new instance of the class.
The exception's message string
This exception's underlying reason
This exception is thrown if a format error in a property Set stream Is
detected or when the input data do not constitute a property Set stream.
The constructors of this class are analogous To those of its superclass
and are documented there.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
Initializes a new instance of the class.
Initializes a new instance of the class.
The exception's message string
Initializes a new instance of the class.
This exception's underlying reason
Initializes a new instance of the class.
The exception's message string
This exception's underlying reason
This exception is thrown if one of the {@link PropertySet}'s
convenience methods that require a single {@link Section} is called
and the {@link PropertySet} does not contain exactly one {@link
Section}.
The constructors of this class are analogous To those of its
superclass and documented there.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
Initializes a new instance of the class.
Initializes a new instance of the class.
The exception's message string
Initializes a new instance of the class.
This exception's underlying reason
Initializes a new instance of the class.
The exception's message string
This exception's underlying reason
Factory class To Create instances of {@link SummaryInformation},
{@link DocumentSummaryInformation} and {@link PropertySet}.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
Creates the most specific {@link PropertySet} from an {@link
InputStream}. This is preferrably a {@link
DocumentSummaryInformation} or a {@link SummaryInformation}. If
the specified {@link InputStream} does not contain a property
Set stream, an exception is thrown and the {@link InputStream}
is repositioned at its beginning.
Contains the property set stream's data.
The Created {@link PropertySet}.
Creates a new summary information
the new summary information.
Creates a new document summary information.
the new document summary information.
This exception is thrown when HPSF tries To Read a (yet) unsupported
variant type.
@see WritingNotSupportedException
@see UnsupportedVariantTypeException
@author Rainer Klute
<klute@rainer-klute.de>
@since 2003-08-08
This exception is thrown if HPSF encounters a variant type that isn't
supported yet. Although a variant type is unsupported the value can still be
retrieved using the {@link VariantTypeException#GetValue} method.
Obviously this class should disappear some day.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2003-08-05
Initializes a new instance of the class.
The unsupported variant type
The value who's variant type is not yet supported
Initializes a new instance of the class.
The unsupported variant type
The value who's variant type is not yet supported
Convenience class representing a Summary Information stream in a
Microsoft Office document.
@author Rainer Klute
<klute@rainer-klute.de>
@see DocumentSummaryInformation
@since 2002-02-09
The document name a summary information stream usually has in a POIFS
filesystem.
Initializes a new instance of the class.
A property Set which should be Created from a summary
information stream.
Removes the title.
Removes the subject.
Removes the author.
Removes the keywords.
Removes the comments.
Removes the template.
Removes the last author.
Removes the rev number.
Removes the edit time.
Removes the last printed.
Removes the create date time.
Removes the last save date time.
Removes the page count.
Removes the word count.
Removes the char count.
Removes the thumbnail.
Removes the name of the application.
Removes the security code.
Gets or sets the title.
The title.
Gets or sets the subject.
The subject.
Gets or sets the author.
The author.
Gets or sets the keywords.
The keywords.
Gets or sets the comments.
The comments.
Gets or sets the template.
The template.
Gets or sets the last author.
The last author.
Gets or sets the rev number.
The rev number.
Returns the Total time spent in editing the document (or 0).
The Total time spent in editing the document or 0 if the {@link
SummaryInformation} does not contain this information.
Gets or sets the last printed time
The last printed time
Returns the last printed time (or null).
Gets or sets the create date time.
The create date time.
Gets or sets the last save date time.
The last save date time.
Gets or sets the page count or 0 if the {@link SummaryInformation} does
not contain a page count.
The page count or 0 if the {@link SummaryInformation} does not
contain a page count.
Gets or sets the word count or 0 if the {@link SummaryInformation} does
not contain a word count.
The word count.
Gets or sets the character count or 0 if the {@link SummaryInformation}
does not contain a char count.
The character count.
Gets or sets the thumbnail (or null) when this
method is implemented. Please note that the return type is likely To
Change!
Hint To developers: Drew Varner <Drew.Varner
-at- sc.edu> said that this is an image in WMF or Clipboard (BMP?)
format. However, we won't do any conversion into any image type but
instead just return a byte array.
The thumbnail.
Gets or sets the name of the application.
The name of the application.
Gets or sets a security code which is one of the following values:
- 0 if the {@link SummaryInformation} does not contain a
security field or if there is no security on the document. Use
{@link PropertySet#wasNull()} To distinguish between the two
cases!
- 1 if the document is password protected
- 2 if the document is Read-only recommended
- 4 if the document is Read-only enforced
- 8 if the document is locked for annotations
The security code
Class To manipulate data in the Clipboard Variant (Variant#VT_CF VT_CF) format.
@author Drew Varner (Drew.Varner inOrAround sc.edu)
@since 2002-04-29
OffSet in bytes where the Clipboard Format Tag starts in the byte[] returned by SummaryInformation#GetThumbnail()
OffSet in bytes where the Clipboard Format starts in the byte[] returned by SummaryInformation#GetThumbnail()
This is only valid if the Clipboard Format Tag is CFTAG_WINDOWS
OffSet in bytes where the Windows Metafile (WMF) image data starts in the byte[] returned by SummaryInformation#GetThumbnail()
There is only WMF data at this point in the
byte[] if the Clipboard Format Tag is
CFTAG_WINDOWS and the Clipboard Format is
CF_METAFILEPICT.
Note: The byte[] that starts at
OFFSet_WMFDATA and ends at
GetThumbnail().Length - 1 forms a complete WMF
image. It can be saved To disk with a .wmf file
type and Read using a WMF-capable image viewer.
Clipboard Format Tag - Windows clipboard format
A DWORD indicating a built-in Windows clipboard format value
Clipboard Format Tag - Macintosh clipboard format
A DWORD indicating a Macintosh clipboard format value
Clipboard Format Tag - Format ID
A GUID containing a format identifier (FMTID). This is rarely used.
Clipboard Format Tag - No Data
A DWORD indicating No data. This is rarely used.
Clipboard Format - Windows metafile format. This is the recommended way To store thumbnails in Property Streams.
Note:This is not the same format used in
regular WMF images. The clipboard version of this format has an
extra clipboard-specific header.
Clipboard Format - Device Independent Bitmap
Clipboard Format - Enhanced Windows metafile format
Clipboard Format - Bitmap
see msdn.microsoft.com/library/en-us/dnw98bk/html/clipboardoperations.asp
A byte[] To hold a thumbnail image in (
Variant#VT_CF VT_CF) format.
Default Constructor. If you use it then one you'll have To Add
the thumbnail byte[] from {@link
SummaryInformation#GetThumbnail()} To do any useful
manipulations, otherwise you'll Get a
NullPointerException.
Initializes a new instance of the class.
The thumbnail data.
Returns an int representing the Clipboard
Format
Will throw an exception if the Thumbnail's Clipboard Format
Tag is not {@link Thumbnail#CFTAG_WINDOWS CFTAG_WINDOWS}.
Possible return values are:
- {@link #CF_METAFILEPICT CF_METAFILEPICT}
- {@link #CF_DIB CF_DIB}
- {@link #CF_ENHMETAFILE CF_ENHMETAFILE}
- {@link #CF_BITMAP CF_BITMAP}
a flag indicating the Clipboard Format
Returns the Thumbnail as a byte[] of WMF data
if the Thumbnail's Clipboard Format Tag is {@link
#CFTAG_WINDOWS CFTAG_WINDOWS} and its Clipboard Format is
{@link #CF_METAFILEPICT CF_METAFILEPICT}
This
byte[] is in the traditional WMF file, not the
clipboard-specific version with special headers.
See http://www.wvware.com/caolan/ora-wmf.html
for more information on the WMF image format.
@return A WMF image of the Thumbnail
@throws HPSFException if the Thumbnail isn't CFTAG_WINDOWS and
CF_METAFILEPICT
Gets or sets the thumbnail as a byte[] in {@link
Variant#VT_CF VT_CF} format.
The thumbnail value
Returns an int representing the Clipboard
Format Tag
Possible return values are:
- {@link #CFTAG_WINDOWS CFTAG_WINDOWS}
- {@link #CFTAG_MACINTOSH CFTAG_MACINTOSH}
- {@link #CFTAG_FMTID CFTAG_FMTID}
- {@link #CFTAG_NODATA CFTAG_NODATA}
A flag indicating the Clipboard Format Tag
Class for writing little-endian data and more.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2003-02-20
Writes a two-byte value (short) To an output stream.
The stream To Write To..
The number of bytes that have been written.
Writes a four-byte value To an output stream.
@param out The stream To Write To.
@param n The value To Write.
@exception IOException if an I/O error occurs
@return The number of bytes written To the output stream.
Writes a four-byte value To an output stream.
@param out The stream To Write To.
@param n The value To Write.
@exception IOException if an I/O error occurs
@return The number of bytes written To the output stream.
Writes a eight-byte value To an output stream.
@param out The stream To Write To.
@param n The value To Write.
@exception IOException if an I/O error occurs
@return The number of bytes written To the output stream.
Writes an unsigned two-byte value To an output stream.
@param out The stream To Write To
@param n The value To Write
@exception IOException if an I/O error occurs
Writes an unsigned four-byte value To an output stream.
@param out The stream To Write To.
@param n The value To Write.
@return The number of bytes that have been written To the output stream.
@exception IOException if an I/O error occurs
Writes a 16-byte {@link ClassID} To an output stream.
@param out The stream To Write To
@param n The value To Write
@return The number of bytes written
@exception IOException if an I/O error occurs
Writes an array of {@link Property} instances To an output stream
according To the Horrible Property Format.
@param out The stream To Write To
@param properties The array To Write To the stream
@param codepage The codepage number To use for writing strings
@exception IOException if an I/O error occurs
@throws UnsupportedVariantTypeException if HPSF does not support some
variant type.
Writes a double value value To an output stream.
@param out The stream To Write To.
@param n The value To Write.
@exception IOException if an I/O error occurs
@return The number of bytes written To the output stream.
This exception is thrown if a certain type of property Set Is
expected (e.g. a Document Summary Information) but the provided
property Set is not of that type.
The constructors of this class are analogous To those of its
superclass and documented there.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
Initializes a new instance of the class.
Initializes a new instance of the class.
The message string.
Initializes a new instance of the class.
The reason, i.e. a throwable that indirectly
caused this exception.
Initializes a new instance of the class.
The message string.
The reason, i.e. a throwable that indirectly
caused this exception.
Provides various static utility methods.
@author Rainer Klute (klute@rainer-klute.de)
@since 2002-02-09
Copies a part of a byte array into another byte array.
The source byte array.
OffSet in the source byte array.
The number of bytes To Copy.
The destination byte array.
OffSet in the destination byte array.
Concatenates the contents of several byte arrays into a
single one.
The byte arrays To be conCatened.
A new byte array containing the conCatenated byte arrays.
Copies bytes from a source byte array into a new byte
array.
Copy from this byte array.
Start Copying here.
Copy this many bytes.
The new byte array. Its Length is number of copied bytes.
The difference between the Windows epoch (1601-01-01
00:00:00) and the Unix epoch (1970-01-01 00:00:00) in
milliseconds: 11644473600000L. (Use your favorite spReadsheet
program To verify the correctness of this value. By the way,
did you notice that you can tell from the epochs which
operating system is the modern one? :-))
Converts a Windows FILETIME into a {@link DateTime}. The Windows
FILETIME structure holds a DateTime and time associated with a
file. The structure identifies a 64-bit integer specifying the
number of 100-nanosecond intervals which have passed since
January 1, 1601. This 64-bit value is split into the two double
words stored in the structure.
The higher double word of the FILETIME structure.
The lower double word of the FILETIME structure.
The Windows FILETIME as a {@link DateTime}.
Converts a Windows FILETIME into a {@link DateTime}. The Windows
FILETIME structure holds a DateTime and time associated with a
file. The structure identifies a 64-bit integer specifying the
number of 100-nanosecond intervals which have passed since
January 1, 1601.
The filetime To Convert.
The Windows FILETIME as a {@link DateTime}.
Converts a {@link DateTime} into a filetime.
The DateTime To be Converted
The filetime
Compares To object arrays with regarding the objects' order. For
example, [1, 2, 3] and [2, 1, 3] are equal.
The first object array.
The second object array.
true
if the object arrays are equal,
false
if they are not.
Internals the equals.
The c1.
The c2.
Pads a byte array with 0x00 bytes so that its Length is a multiple of
4.
The byte array To pad.
The padded byte array.
Pads a character array with 0x0000 characters so that its Length is a
multiple of 4.
The character array To pad.
The padded character array.
Pads a string with 0x0000 characters so that its Length is a
multiple of 4.
The string To pad.
The padded string as a character array.
The Variant types as defined by Microsoft's COM. I
found this information in
http://www.marin.clara.net/COM/variant_type_definitions.htm.
In the variant types descriptions the following shortcuts are
used: [V] - may appear in a VARIANT,
[T] - may appear in a TYPEDESC,
[P] - may appear in an OLE property Set,
[S] - may appear in a Safe Array.
@author Rainer Klute (klute@rainer-klute.de)
@since 2002-02-09
[V][P] Nothing, i.e. not a single byte of data.
[V][P] SQL style Null.
[V][T][P][S] 2 byte signed int.
[V][T][P][S] 4 byte signed int.
[V][T][P][S] 4 byte real.
[V][T][P][S] 8 byte real.
[V][T][P][S] currency. How long is this? How is it To be
interpreted?
[V][T][P][S] DateTime. How long is this? How is it To be
interpreted?
[V][T][P][S] OLE Automation string. How long is this? How is it
To be interpreted?
[V][T][P][S] IDispatch *. How long is this? How is it To be
interpreted?
[V][T][S] SCODE. How
long is this? How is it To be interpreted?
[V][T][P][S] True=-1, False=0.
[V][T][P][S] VARIANT *. How long is this? How is it To be
interpreted?
[V][T][S] IUnknown *. How long is this? How is it To be
interpreted?
[V][T][S] 16 byte fixed point.
[T] signed char.
[V][T][P][S] unsigned char.
[T][P] unsigned short.
[T][P] unsigned int.
[T][P] signed 64-bit int.
[T][P] unsigned 64-bit int.
[T] signed machine int.
[T] unsigned machine int.
[T] C style void.
[T] Standard return type. How long is this? How is it To be
interpreted?
[T] pointer type. How long is this? How is it To be
interpreted?
[T] (use VT_ARRAY in VARIANT).
[T] C style array. How long is this? How is it To be
interpreted?
[T] user defined type. How long is this? How is it To be
interpreted?
[T][P] null terminated string.
[T][P] wide (Unicode) null terminated string.
[P] FILETIME. The FILETIME structure holds a DateTime and time
associated with a file. The structure identifies a 64-bit
integer specifying the number of 100-nanosecond intervals which
have passed since January 1, 1601. This 64-bit value is split
into the two dwords stored in the structure.
[P] Length prefixed bytes.
[P] Name of the stream follows.
[P] Name of the storage follows.
[P] Stream Contains an object. How long is this? How is it
To be interpreted?
[P] Storage Contains an object. How long is this? How is it
To be interpreted?
[P] Blob Contains an object. How long is this? How is it To be
interpreted?
[P] Clipboard format. How long is this? How is it To be
interpreted?
[P] A Class ID.
It consists of a 32 bit unsigned integer indicating the size
of the structure, a 32 bit signed integer indicating (Clipboard
Format Tag) indicating the type of data that it Contains, and
then a byte array containing the data.
The valid Clipboard Format Tags are:
- {@link Thumbnail#CFTAG_WINDOWS}
- {@link Thumbnail#CFTAG_MACINTOSH}
- {@link Thumbnail#CFTAG_NODATA}
- {@link Thumbnail#CFTAG_FMTID}
typedef struct tagCLIPDATA {
// cbSize is the size of the buffer pointed To
// by pClipData, plus sizeof(ulClipFmt)
ULONG cbSize;
long ulClipFmt;
BYTE* pClipData;
} CLIPDATA;
See
msdn.microsoft.com/library/en-us/com/stgrstrc_0uwk.asp.
"MUST be a VersionedStream. The storage representing the (non-simple)
property set MUST have a stream element with the name in the StreamName
field." -- [MS-OLEPS] -- v20110920; Object Linking and Embedding (OLE)
Property Set Data Structures; page 24 / 63
[P] simple counted array. How long is this? How is it To be
interpreted?
[V] SAFEARRAY*. How
long is this? How is it To be interpreted?
[V] void* for local use. How long is this? How is it To be
interpreted?
FIXME (3): Document this!
FIXME (3): Document this!
FIXME (3): Document this!
FIXME (3): Document this!
Denotes a variant type with a Length that is unknown To HPSF yet.
Denotes a variant type with a variable Length.
Denotes a variant type with a Length of 0 bytes.
Denotes a variant type with a Length of 2 bytes.
Denotes a variant type with a Length of 4 bytes.
Denotes a variant type with a Length of 8 bytes.
Maps the numbers denoting the variant types To their corresponding
variant type names.
Returns the variant type name associated with a variant type
number.
The variant type number.
The variant type name or the string "unknown variant type"
Returns a variant type's Length.
The variant type number.
The Length of the variant type's data in bytes. If the Length Is
variable, i.e. the Length of a string, -1 is returned. If HPSF does not
know the Length, -2 is returned. The latter usually indicates an
unsupported variant type.
Supports Reading and writing of variant data.
FIXME (3):
Reading and writing should be made more
uniform than it is now. The following items should be resolved:
Reading requires a Length parameter that is 4 byte greater than the
actual data, because the variant type field is included.
Reading Reads from a byte array while writing Writes To an byte array
output stream.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2003-08-08
Keeps a list of the variant types an "unsupported" message has alReady
been issued for.
Writes a warning To System.err that a variant type Is
unsupported by HPSF. Such a warning is written only once for each variant
type. Log messages can be turned on or off by
The exception To log
HPSF is able To Read these {@link Variant} types.
Checks whether HPSF supports the specified variant type. Unsupported
types should be implemented included in the {@link #SUPPORTED_TYPES}
array.
the variant type To check
true if HPFS supports this type,otherwise, false.
Reads a variant type from a byte array
The byte array
The offset in the byte array where the variant starts
The Length of the variant including the variant type field
The variant type To Read
The codepage To use for non-wide strings
A Java object that corresponds best To the variant field. For
example, a VT_I4 is returned as a {@link long}, a VT_LPSTR as a
{@link String}.
Turns a codepage number into the equivalent character encoding's
name.
@param codepage The codepage number
@return The character encoding's name. If the codepage number is 65001,
the encoding name is "UTF-8". All other positive numbers are mapped to
"cp" followed by the number, e.g. if the codepage number is 1252 the
returned character encoding name will be "cp1252".
@exception UnsupportedEncodingException if the specified codepage is
less than zero.
Writes a variant value To an output stream. This method ensures that
always a multiple of 4 bytes is written.
If the codepage is UTF-16, which is encouraged, strings
must always be written as {@link Variant#VT_LPWSTR}
strings, not as {@link Variant#VT_LPSTR} strings. This method ensure this
by Converting strings appropriately, if needed.
The stream To Write the value To.
The variant's type.
The variant's value.
The codepage To use To Write non-wide strings
The number of entities that have been written. In many cases an
"entity" is a byte but this is not always the case.
Checks whether logging of unsupported variant types warning is turned
on or off.
true if logging is turned on; otherwise, false.
This is a dictionary which maps property ID values To property
ID strings.
The methods {@link #GetSummaryInformationProperties} and {@link
#GetDocumentSummaryInformationProperties} return singleton {@link
PropertyIDMap}s. An application that wants To extend these maps
should treat them as unmodifiable, copy them and modifiy the
copies.
@author Rainer Klute
<klute@rainer-klute.de>
@since 2002-02-09
ID of the property that denotes the document's title
ID of the property that denotes the document's subject
ID of the property that denotes the document's author
ID of the property that denotes the document's keywords
ID of the property that denotes the document's comments
ID of the property that denotes the document's template
ID of the property that denotes the document's last author
ID of the property that denotes the document's revision number
ID of the property that denotes the document's edit time
ID of the property that denotes the DateTime and time the document was
last printed
ID of the property that denotes the DateTime and time the document was
Created.
ID of the property that denotes the DateTime and time the document was
saved
ID of the property that denotes the number of pages in the
document
ID of the property that denotes the number of words in the
document
ID of the property that denotes the number of characters in the
document
ID of the property that denotes the document's thumbnail
ID of the property that denotes the application that Created the
document
ID of the property that denotes whether Read/Write access To the
document is allowed or whether is should be opened as Read-only. It can
have the following values:
Value |
Description |
0 |
No restriction |
2 |
Read-only recommended |
4 |
Read-only enforced |
The entry is a dictionary.
The entry denotes a code page.
The entry is a string denoting the category the file belongs
To, e.g. review, memo, etc. This is useful To Find documents of
same type.
TarGet format for power point presentation, e.g. 35mm,
printer, video etc.
Number of bytes.
Number of lines.
Number of paragraphs.
Number of slides in a power point presentation.
Number of slides with notes.
Number of hidden slides.
Number of multimedia clips, e.g. sound or video.
This entry is Set To -1 when scaling of the thumbnail Is
desired. Otherwise the thumbnail should be cropped.
This entry denotes an internally used property. It is a
vector of variants consisting of pairs of a string (VT_LPSTR)
and a number (VT_I4). The string is a heading name, and the
number tells how many document parts are under that
heading.
This entry Contains the names of document parts (word: names
of the documents in the master document, excel: sheet names,
power point: slide titles, binder: document names).
This entry Contains the name of the project manager.
This entry Contains the company name.
If this entry is -1 the links are dirty and should be
re-evaluated.
The highest well-known property ID. Applications are free To use higher values for custom purposes.
Contains the summary information property ID values and
associated strings. See the overall HPSF documentation for
details!
Contains the summary information property ID values and
associated strings. See the overall HPSF documentation for
details!
Initializes a new instance of the class.
initialCapacity The initial capacity as defined for
{@link HashMap}
The load factor as defined for {@link HashMap}
Initializes a new instance of the class.
The instance To be Created is backed by this map.
Puts a ID string for an ID into the {@link
PropertyIDMap}.
The ID string.
The id string.
As specified by the {@link java.util.Map} interface, this method
returns the previous value associated with the specified id
Gets the ID string for an ID from the {@link
PropertyIDMap}.
The ID.
The ID string associated with id
Gets the Summary Information properties singleton
Gets the Document Summary Information properties
singleton.
The Document Summary Information properties singleton.
Maps section format IDs To {@link PropertyIDMap}s. It Is
initialized with two well-known section format IDs: those of the
\005SummaryInformation stream and the
\005DocumentSummaryInformation stream.
If you have a section format ID you can use it as a key To query
this map. If you Get a {@link PropertyIDMap} returned your section
is well-known and you can query the {@link PropertyIDMap} for PID
strings. If you Get back null you are on your own.
This {@link java.util.Map} expects the byte arrays of section format IDs
as keys. A key maps To a {@link PropertyIDMap} describing the
property IDs in sections with the specified section format ID.
@author Rainer Klute (klute@rainer-klute.de)
@since 2002-02-09
A property without a known name is described by this string.
The SummaryInformation's section's format ID.
The DocumentSummaryInformation's first and second sections' format
ID.
The default section ID map. It maps section format IDs To
{@link PropertyIDMap}s.
Returns the singleton instance of the default {@link
SectionIDMap}.
The instance value
Returns the property ID string that is associated with a
given property ID in a section format ID's namespace.
Each section format ID has its own name
space of property ID strings and thus must be specified.
The property ID
The well-known property ID string associated with the
property ID pid in the name space spanned by sectionFormatID If the pid
sectionFormatID combination is not well-known, the
string "[undefined]" is returned.
Returns the {@link PropertyIDMap} for a given section format
ID.
The section format ID.
the property ID map
Returns the {@link PropertyIDMap} for a given section format
ID.
A section format ID as a
byte[]
the property ID map
Associates a section format ID with a {@link
PropertyIDMap}.
the section format ID
The property ID map.
Puts the specified key.
This parameter remains undocumented since the method Is
deprecated.
This parameter remains undocumented since the method Is
deprecated.
The return value remains undocumented since the method Is
deprecated.
This exception is thrown when trying To Write a (yet) unsupported variant
type.
@see ReadingNotSupportedException
@see UnsupportedVariantTypeException
@author Rainer Klute
<klute@rainer-klute.de>
@since 2003-08-08
Initializes a new instance of the class.
The unsupported variant type.
The value
An ERFListener Is registered with the EventRecordFactory.
An ERFListener listens for Records coming from the stream
via the EventRecordFactory
@see EventRecordFactory
@author Andrew C. Oliver acoliver@apache.org
Process a Record. This method Is called by the
EventRecordFactory when a record Is returned.
@return bool specifying whether the effort was a success.
Event-based record factory. As opposed to RecordFactory
this refactored version throws record events as it comes
accross the records. I throws the "lazily" one record behind
to ensure that ContinueRecords are Processed first.
@author Andrew C. Oliver (acoliver@apache.org) - probably to blame for the bugs (so yank his chain on the list)
@author Marc Johnson (mjohnson at apache dot org) - methods taken from RecordFactory
@author Glen Stampoultzis (glens at apache.org) - methods taken from RecordFactory
@author Csaba Nagy (ncsaba at yahoo dot com)
Create an EventRecordFactory
@param abortable specifies whether the return from the listener
handler functions are obeyed. False means they are ignored. True
means the event loop exits on error.
sends the record event to all registered listeners.
@param record the record to be thrown.
@return false to abort. This aborts
out of the event loop should the listener return false
Create an array of records from an input stream
@param in the InputStream from which the records will be
obtained
@exception RecordFormatException on error Processing the
InputStream
Interface for use with the HSSFRequest and HSSFEventFactory. Users should Create
a listener supporting this interface and register it with the HSSFRequest (associating
it with Record SID's).
@see org.apache.poi.hssf.eventusermodel.HSSFEventFactory
@see org.apache.poi.hssf.eventusermodel.HSSFRequest
@see org.apache.poi.hssf.eventusermodel.HSSFUserException
@author Carey Sublette (careysub@earthling.net)
Interface for use with the HSSFRequest and HSSFEventFactory. Users should Create
a listener supporting this interface and register it with the HSSFRequest (associating
it with Record SID's).
@author acoliver@apache.org
Process an HSSF Record. Called when a record occurs in an HSSF file.
The record.
This method, inherited from HSSFListener Is implemented as a stub.
It Is never called by HSSFEventFActory or HSSFRequest.
Process an HSSF Record. Called when a record occurs in an HSSF file.
Provides two options for halting the Processing of the HSSF file.
The return value provides a means of non-error termination with a
user-defined result code. A value of zero must be returned to
continue Processing, any other value will halt Processing by
HSSFEventFactory with the code being passed back by
its abortable Process events methods.
Error termination can be done by throwing the HSSFUserException.
Note that HSSFEventFactory will not call the inherited Process
@return result code of zero for continued Processing.
@throws HSSFUserException User code can throw this to abort
file Processing by HSSFEventFactory and return diagnostic information.
A dummy record to indicate that we've now had the last
cell record for this row.
Returns the (0 based) number of the row we are
currently working on.
Returns the (0 based) number of the last column
seen for this row. You should have alReady been
called with that record.
This Is -1 in the case of there being no columns
for the row.
A dummy record for when we're missing a cell in a row,
but still want to trigger something
A dummy record for when we're missing a row, but still
want to trigger something
When working with the EventUserModel, if you want to
Process formulas, you need an instance of
Workbook to pass to a HSSFWorkbook,
to finally give to HSSFFormulaParser,
and this will build you stub ones.
Since you're working with the EventUserModel, you
wouldn't want to Get a full Workbook and
HSSFWorkbook, as they would eat too much memory.
Instead, you should collect a few key records as they
go past, then call this once you have them to build a
stub Workbook, and from that a stub
HSSFWorkbook, to use with the HSSFFormulaParser.
The records you should collect are:
ExternSheetRecord
BoundSheetRecord
You should probably also collect SSTRecord,
but it's not required to pass this in.
To help, this class includes a HSSFListener wrapper
that will do the collecting for you.
Wraps up your stub Workbook as a stub HSSFWorkbook, ready for passing to HSSFFormulaParser
The stub workbook.
Creates a stub Workbook from the supplied records,
suitable for use with the {@link HSSFFormulaParser}
The ExternSheetRecords in your file
The BoundSheetRecords in your file
TThe SSTRecord in your file.
A stub Workbook suitable for use with HSSFFormulaParser
Creates a stub workbook from the supplied records,
suitable for use with the HSSFFormulaParser
The ExternSheetRecords in your file
A stub Workbook suitable for use with HSSFFormulaParser
A stub Workbook suitable for use with {@link HSSFFormulaParser}
A wrapping HSSFListener which will collect
BoundSheetRecords and {@link ExternSheetRecord}s as
they go past, so you can Create a Stub {@link Workbook} from
them once required.
Initializes a new instance of the class.
The child listener.
Gets the bound sheet records.
Gets the extern sheet records.
Gets the SST record.
Gets the stub HSSF workbook.
Gets the stub workbook.
Process this record ourselves, and then
pass it on to our child listener
The record.
Process the record ourselves, but do not
pass it on to the child Listener.
The record.
Let us at the {@link Workbook} constructor on
{@link HSSFWorkbook}
High level representation of a workbook. This is the first object most users
will construct whether they are reading or writing a workbook. It is also the
top level object for creating new sheets/etc.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Shawn Laubach (slaubach at apache dot org)
High level interface of a Excel workbook. This is the first object most users
will construct whether they are reading or writing a workbook. It is also the
top level object for creating new sheets/etc.
This interface is shared between the implementation specific to xls and xlsx.
This way it is possible to access Excel workbooks stored in both formats.
Sets the order of appearance for a given sheet.
the name of the sheet to reorder
the position that we want to insert the sheet into (0 based)
Sets the tab whose data is actually seen when the sheet is opened.
This may be different from the "selected sheet" since excel seems to
allow you to show the data of one sheet when another is seen "selected"
in the tabs (at the bottom).
the index of the sheet to select (0 based)
set the active sheet. The active sheet is is the sheet
which is currently displayed when the workbook is viewed in Excel.
index of the active sheet (0-based)
Set the sheet name
sheet number (0 based)
Sheet name
Set the sheet name.
sheet number (0 based)
sheet name
Returns the index of the sheet by its name
the sheet name
index of the sheet (0 based)
Returns the index of the given sheet
the sheet to look up
index of the sheet (0 based)
Sreate an Sheet for this Workbook, Adds it to the sheets and returns
the high level representation. Use this to create new sheets.
Create an Sheet for this Workbook, Adds it to the sheets and returns
the high level representation. Use this to create new sheets.
sheetname to set for the sheet.
Sheet representing the new sheet.
Create an Sheet from an existing sheet in the Workbook.
Get the Sheet object at the given index.
index of the sheet number (0-based physical & logical)
Sheet at the provided index
Get sheet with the given name
name of the sheet
Sheet with the name provided or null if it does not exist
Support foreach ISheet, e.g.
HSSFWorkbook workbook = new HSSFWorkbook();
foreach(ISheet sheet in workbook) ...
Enumeration of all the sheets of this workbook
Removes sheet at the given index
To set just repeating columns:
workbook.SetRepeatingRowsAndColumns(0,0,1,-1-1);
To set just repeating rows:
workbook.SetRepeatingRowsAndColumns(0,-1,-1,0,4);
To remove all repeating rows and columns for a sheet.
workbook.SetRepeatingRowsAndColumns(0,-1,-1,-1,-1);
Sets the repeating rows and columns for a sheet (as found in
File->PageSetup->Sheet). This is function is included in the workbook
because it Creates/modifies name records which are stored at the
workbook level.
0 based index to sheet.
0 based start of repeating columns.
0 based end of repeating columns.
0 based start of repeating rows.
0 based end of repeating rows.
Create a new Font and add it to the workbook's font table
Finds a font that matches the one with the supplied attributes
the font with the matched attributes or null
Get the font at the given index number
index number (0-based)
font at the index
Create a new Cell style and add it to the workbook's style table
the new Cell Style object
Get the cell style object at the given index
index within the set of styles (0-based)
CellStyle object at the index
Write out this workbook to an OutPutstream.
the stream you wish to write to
the defined name with the specified name.
the name of the defined name
the defined name with the specified name. null if not found
the defined name at the specified index
position of the named range (0-based)
Creates a new (unInitialised) defined name in this workbook
new defined name object
Gets the defined name index by name
the name of the defined name
zero based index of the defined name.
Remove the defined name at the specified index
named range index (0 based)
Remove a defined name by name
the name of the defined name
Sets the printarea for the sheet provided
Zero-based sheet index
Valid name Reference for the Print Area
Sets the printarea for the sheet provided
Zero-based sheet index (0 = First Sheet)
Column to begin printarea
Column to end the printarea
Row to begin the printarea
Row to end the printarea
Retrieves the reference for the printarea of the specified sheet,
the sheet name is Appended to the reference even if it was not specified.
Zero-based sheet index
Null if no print area has been defined
Delete the printarea for the sheet specified
Zero-based sheet index (0 = First Sheet)
Returns the instance of DataFormat for this workbook.
the DataFormat object
Adds a picture to the workbook.
The bytes of the picture
The format of the picture.
the index to this picture (1 based).
Gets all pictures from the Workbook.
the list of pictures (a list of link PictureData objects.)
Return an object that handles instantiating concrete classes of
the various instances one needs for HSSF and XSSF.
Check whether a sheet is hidden.
number of sheet
true if sheet is hidden
Check whether a sheet is very hidden.
This is different from the normal hidden status
({@link #isSheetHidden(int)})
@param sheetIx sheet index to check
@return true
if sheet is very hidden
Hide or unhide a sheet
@param sheetIx the sheet index (0-based)
@param hidden True to mark the sheet as hidden, false otherwise
Hide or unhide a sheet.
0 = not hidden
1 = hidden
2 = very hidden.
@param sheetIx The sheet number
@param hidden 0 for not hidden, 1 for hidden, 2 for very hidden
Register a new toolpack in this workbook.
the toolpack to register
get the active sheet. The active sheet is is the sheet
which is currently displayed when the workbook is viewed in Excel.
Gets the first tab that is displayed in the list of tabs in excel.
Get the number of spreadsheets in the workbook
Get the number of fonts in the font table
Get the number of styles the workbook Contains
the total number of defined names in this workbook
Retrieves the current policy on what to do when getting missing or blank cells from a row.
if this workbook is not visible in the GUI
The maximum number of cell styles in a .xls workbook.
The 'official' limit is 4,000, but POI allows a slightly larger number.
This extra delta takes into account built-in styles that are automatically
created for new workbooks
See http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP005199291.aspx
used for compile-time performance/memory optimization. This determines the
initial capacity for the sheet collection. Its currently Set to 3.
Changing it in this release will decrease performance
since you're never allowed to have more or less than three sheets!
@deprecated POI will now properly handle Unicode strings without
forceing an encoding
@deprecated POI will now properly handle Unicode strings without
forceing an encoding
this Is the reference to the low level Workbook object
this holds the HSSFSheet objects attached to this workbook
this holds the HSSFName objects attached to this workbook
holds whether or not to preserve other nodes in the POIFS. Used
for macros and embedded objects.
Used to keep track of the data formatter so that all
CreateDataFormatter calls return the same one for a given
book. This Ensures that updates from one places Is visible
someplace else.
this holds the HSSFFont objects attached to this workbook.
We only create these from the low level records as required.
Creates new HSSFWorkbook from scratch (start here!)
given a POI POIFSFileSystem object, Read in its Workbook and populate the high and
low level models. If you're Reading in a workbook...start here.
the POI filesystem that Contains the Workbook stream.
whether to preseve other nodes, such as
macros. This takes more memory, so only say yes if you
need to. If Set, will store all of the POIFSFileSystem
in memory
Normally, the Workbook will be in a POIFS Stream
called "Workbook". However, some weird XLS generators use "WORKBOOK"
given a POI POIFSFileSystem object, and a specific directory
within it, Read in its Workbook and populate the high and
low level models. If you're Reading in a workbook...start here.
the POI filesystem directory to Process from
the POI filesystem that Contains the Workbook stream.
whether to preseve other nodes, such as
macros. This takes more memory, so only say yes if you
need to. If Set, will store all of the POIFSFileSystem
in memory
given a POI POIFSFileSystem object, and a specific directory
within it, read in its Workbook and populate the high and
low level models. If you're reading in a workbook...start here.
@param directory the POI filesystem directory to process from
@param preserveNodes whether to preseve other nodes, such as
macros. This takes more memory, so only say yes if you
need to. If set, will store all of the POIFSFileSystem
in memory
@see org.apache.poi.poifs.filesystem.POIFSFileSystem
@exception IOException if the stream cannot be read
Companion to HSSFWorkbook(POIFSFileSystem), this constructs the POI filesystem around your
inputstream.
@param s the POI filesystem that Contains the Workbook stream.
@param preserveNodes whether to preseve other nodes, such as
macros. This takes more memory, so only say yes if you
need to.
@see org.apache.poi.poifs.filesystem.POIFSFileSystem
@see #HSSFWorkbook(POIFSFileSystem)
@exception IOException if the stream cannot be Read
used internally to Set the workbook properties.
This is basically a kludge to deal with the now obsolete Label records. If
you have to read in a sheet that contains Label records, be aware that the rest
of the API doesn't deal with them, the low level structure only provides Read-only
semi-immutable structures (the Sets are there for interface conformance with NO
impelmentation). In short, you need to call this function passing it a reference
to the Workbook object. All labels will be converted to LabelSST records and their
contained strings will be written to the Shared String tabel (SSTRecord) within
the Workbook.
The records.
The offset.
Sets the order of appearance for a given sheet.
the name of the sheet to reorder
the position that we want to Insert the sheet into (0 based)
Validates the index of the sheet.
The index.
Test only. Do not use
Selects a single sheet. This may be different to
the 'active' sheet (which Is the sheet with focus).
The index.
Sets the selected tabs.
The indexes.
Set the sheet name.
The sheet number(0 based).
The name.
Get the sheet name
The sheet index.
Sheet name
Check whether a sheet is hidden
The sheet index.
true if sheet is hidden; otherwise, false.
Check whether a sheet is very hidden.
This is different from the normal
hidden status
The sheet index.
true if sheet is very hidden; otherwise, false.
Hide or Unhide a sheet
The sheet index
True to mark the sheet as hidden, false otherwise
Hide or unhide a sheet.
The sheet number
0 for not hidden, 1 for hidden, 2 for very hidden
Returns the index of the sheet by his name
the sheet name
index of the sheet (0 based)
Returns the index of the given sheet
the sheet to look up
index of the sheet (0 based).-1
if not found
Returns the external sheet index of the sheet
with the given internal index, creating one
if needed.
Used by some of the more obscure formula and
named range things.
Index of the internal sheet.
Create an HSSFSheet for this HSSFWorkbook, Adds it to the sheets and returns
the high level representation. Use this to Create new sheets.
HSSFSheet representing the new sheet.
Create an HSSFSheet from an existing sheet in the HSSFWorkbook.
the sheet index
HSSFSheet representing the Cloned sheet.
Gets the name of the unique sheet.
Name of the SRC.
Create an HSSFSheet for this HSSFWorkbook, Adds it to the sheets and
returns the high level representation. Use this to Create new sheets.
sheetname to set for the sheet.
HSSFSheet representing the new sheet.
Gets the sheets.
Get the HSSFSheet object at the given index.
index of the sheet number (0-based)
HSSFSheet at the provided index
Get sheet with the given name (case insensitive match)
name of the sheet
HSSFSheet with the name provided or null if it does not exist
Removes sheet at the given index.
index of the sheet (0-based)
Care must be taken if the Removed sheet Is the currently active or only selected sheet in
the workbook. There are a few situations when Excel must have a selection and/or active
sheet. (For example when printing - see Bug 40414).
This method makes sure that if the Removed sheet was active, another sheet will become
active in its place. Furthermore, if the Removed sheet was the only selected sheet, another
sheet will become selected. The newly active/selected sheet will have the same index, or
one less if the Removed sheet was the last in the workbook.
Sets the repeating rows and columns for a sheet (as found in
File->PageSetup->Sheet). This Is function Is included in the workbook
because it Creates/modifies name records which are stored at the
workbook level.
0 based index to sheet.
0 based start of repeating columns.
0 based end of repeating columns.
0 based start of repeating rows.
0 based end of repeating rows.
To set just repeating columns:
workbook.SetRepeatingRowsAndColumns(0,0,1,-1-1);
To set just repeating rows:
workbook.SetRepeatingRowsAndColumns(0,-1,-1,0,4);
To remove all repeating rows and columns for a sheet.
workbook.SetRepeatingRowsAndColumns(0,-1,-1,-1,-1);
Create a new Font and Add it to the workbook's font table
new font object
Finds a font that matches the one with the supplied attributes
The bold weight.
The color.
Height of the font.
The name.
if set to true [italic].
if set to true [strikeout].
The type offset.
The underline.
Get the font at the given index number
The index number
HSSFFont at the index
Reset the fonts cache, causing all new calls
to getFontAt() to create new objects.
Should only be called after deleting fonts,
and that's not something you should normally do
Create a new Cell style and Add it to the workbook's style table
the new Cell Style object
Get the cell style object at the given index
index within the Set of styles
HSSFCellStyle object at the index
Write out this workbook to an Outputstream. Constructs
a new POI POIFSFileSystem, passes in the workbook binary representation and
Writes it out.
the java OutputStream you wish to Write the XLS to
Get the bytes of just the HSSF portions of the XLS file.
Use this to construct a POI POIFSFileSystem yourself.
byte[] array containing the binary representation of this workbook and all contained
sheets, rows, cells, etc.
The locator of user-defined functions.
By default includes functions from the Excel Analysis Toolpack
Register a new toolpack in this workbook.
@param toopack the toolpack to register
Gets the Named range
position of the named range
named range high level
Gets the named range name
the named range index (0 based)
named range name
TODO - make this less cryptic / move elsewhere
Index to REF entry in EXTERNSHEET record in the Link Table
zero-based to DEFINEDNAME or EXTERNALNAME record
the string representation of the defined or external name
Sets the printarea for the sheet provided
i.e. Reference = $A$1:$B$2
Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
Valid name Reference for the Print Area
Sets the print area.
Zero-based sheet index (0 = First Sheet)
Column to begin printarea
Column to end the printarea
Row to begin the printarea
Row to end the printarea
Retrieves the reference for the printarea of the specified sheet, the sheet name Is Appended to the reference even if it was not specified.
Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
String Null if no print area has been defined
Delete the printarea for the sheet specified
Zero-based sheet index (0 = First Sheet)
Creates a new named range and Add it to the model
named range high level
Gets the named range index by his name
Note:
Excel named ranges are case-insensitive and
this method performs a case-insensitive search.
named range name
named range index
As GetNameIndex(String) is not necessarily unique
(name + sheet index is unique), this method is more accurate.
the name whose index in the list of names of this workbook should be looked up.
an index value >= 0 if the name was found; -1, if the name was not found
Remove the named range by his index
The named range index (0 based)
Creates the instance of HSSFDataFormat for this workbook.
the HSSFDataFormat object
Remove the named range by his name
named range name
As #removeName(String) is not necessarily unique (name + sheet index is unique),
this method is more accurate.
the name to remove.
Spits out a list of all the drawing records in the workbook.
if set to true [fat].
Adds a picture to the workbook.
The bytes of the picture
The format of the picture. One of
PictureType.
the index to this picture (1 based).
Gets all pictures from the Workbook.
the list of pictures (a list of HSSFPictureData objects.)
Performs a recursive search for pictures in the given list of escher records.
the escher records.
the list to populate with the pictures.
protect a workbook with a password (not encypted, just Sets Writeprotect
flags and the password.
password to set
The username.
Removes the Write protect flag
Gets all embedded OLE2 objects from the Workbook.
the list of embedded objects (a list of HSSFObjectData objects.)
Gets all embedded OLE2 objects from the Workbook.
the list of records to search.
the list of embedded objects to populate.
Support foreach ISheet, e.g.
HSSFWorkbook workbook = new HSSFWorkbook();
foreach(ISheet sheet in workbook) ...
Enumeration of all the sheets of this workbook
Changes an external referenced file to another file.
A formular in Excel which refers a cell in another file is saved in two parts:
The referenced file is stored in an reference table. the row/cell information is saved separate.
This method invokation will only change the reference in the lookup-table itself.
@param oldUrl The old URL to search for and which is to be replaced
@param newUrl The URL replacement
@return true if the oldUrl was found and replaced with newUrl. Otherwise false
Retrieves the current policy on what to do when
getting missing or blank cells from a row.
The default is to return blank and null cells.
The missing cell policy.
Gets or sets the tab whose data is actually seen when the sheet is opened.
This may be different from the "selected sheet" since excel seems to
allow you to show the data of one sheet when another Is seen "selected"
in the tabs (at the bottom).
Gets or sets the first tab that is displayed in the list of tabs
in excel.
Get the number of spreadsheets in the workbook (this will be three after serialization)
The number of sheets.
determine whether the Excel GUI will backup the workbook when saving.
the current Setting for backups.
Get the number of fonts in the font table
The number of fonts.
Get the number of styles the workbook Contains
count of cell styles
Gets the workbook.
The workbook.
Gets the total number of named ranges in the workboko
The number of named ranges
Is the workbook protected with a password (not encrypted)?
true if this instance is write protected; otherwise, false.
Gets the new UID.
The new UID.
Whether the application shall perform a full recalculation when the workbook is opened.
Typically you want to force formula recalculation when you modify cell formulas or values
of a workbook previously created by Excel. When set to true, this flag will tell Excel
that it needs to recalculate all formulas in the workbook the next time the file is opened.
Note, that recalculation updates cached formula results and, thus, modifies the workbook.
Depending on the version, Excel may prompt you with "Do you want to save the changes in filename?"
on close.
Value is true if the application will perform a full recalculation of
workbook values when the workbook is opened.
since 3.8
Totals the sizes of all sheet records and eventually serializes them
A proxy HSSFListener that keeps track of the document
formatting records, and provides an easy way to look
up the format strings used by cells from their ids.
Process this record ourselves, and then
pass it on to our child listener
Process the record ourselves, but do not
pass it on to the child Listener.
@param record
Formats the given numeric of date Cell's contents
as a String, in as close as we can to the way
that Excel would do so.
Uses the various format records to manage this.
TODO - move this to a central class in such a
way that hssf.usermodel can make use of it too
Returns the format string, eg $##.##, for the
given number format index.
Returns the format string, eg $##.##, used
by your cell
Returns the index of the format string, used by your cell,
or -1 if none found
Low level event based HSSF Reader. Pass either a DocumentInputStream to
Process events along with a request object or pass a POIFS POIFSFileSystem to
ProcessWorkbookEvents along with a request.
This will cause your file to be Processed a record at a time. Each record with
a static id matching one that you have registed in your HSSFRequest will be passed
to your associated HSSFListener.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Carey Sublette (careysub@earthling.net)
Creates a new instance of HSSFEventFactory
Processes a file into essentially record events.
an Instance of HSSFRequest which has your registered listeners
a POIFS filesystem containing your workbook
Processes a file into essentially record events.
an Instance of HSSFRequest which has your registered listeners
a POIFS filesystem containing your workbook
numeric user-specified result code.
Processes a DocumentInputStream into essentially Record events.
If an
AbortableHSSFListener
causes a halt to Processing during this call
the method will return just as with
abortableProcessEvents
, but no
user code or
HSSFUserException
will be passed back.
an Instance of HSSFRequest which has your registered listeners
a DocumentInputStream obtained from POIFS's POIFSFileSystem object
Processes a DocumentInputStream into essentially Record events.
an Instance of HSSFRequest which has your registered listeners
a DocumentInputStream obtained from POIFS's POIFSFileSystem object
numeric user-specified result code.
Processes a DocumentInputStream into essentially Record events.
an Instance of HSSFRequest which has your registered listeners
a DocumentInputStream obtained from POIFS's POIFSFileSystem object
numeric user-specified result code.
A stream based way to Get at complete records, with
as low a memory footprint as possible.
This handles Reading from a RecordInputStream, turning
the data into full records, Processing continue records
etc.
Most users should use HSSFEventFactory
HSSFListener and have new records pushed to
them, but this does allow for a "pull" style of coding.
Have we run out of records on the stream?
Have we returned all the records there are?
Sometimes we end up with a bunch of
records. When we do, these should
be returned before the next normal
record Processing occurs (i.e. before
we Check for continue records and
return rec)
The next record to return, which may need to have its
continue records passed to it before we do
The most recent record that we gave to the user
The most recent DrawingRecord seen
Returns the next (complete) record from the
stream, or null if there are no more.
If there are any "bonus" records, that should
be returned before Processing new ones,
grabs the next and returns it.
If not, returns null;
Returns the next available record, or null if
this pass didn't return a record that's
suitable for returning (eg was a continue record).
An HSSFRequest object should be constructed registering an instance or multiple
instances of HSSFListener with each Record.sid you wish to listen for.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Carey Sublette (careysub@earthling.net)
Creates a new instance of HSSFRequest
Add an event listener for a particular record type. The trick Is you have to know
what the records are for or just start with our examples and build on them. Alternatively,
you CAN call AddListenerForAllRecords and you'll recieve ALL record events in one listener,
but if you like to squeeze every last byte of efficiency out of life you my not like this.
(its sure as heck what I plan to do)
for the event
identifier for the record type this Is the .sid static member on the individual records
This Is the equivilent of calling AddListener(myListener, sid) for EVERY
record in the org.apache.poi.hssf.record package. This Is for lazy
people like me. You can call this more than once with more than one listener, but
that seems like a bad thing to do from a practice-perspective Unless you have a
compelling reason to do so (like maybe you send the event two places or log it or
something?).
a single listener to associate with ALL records
Called by HSSFEventFactory, passes the Record to each listener associated with
a record.sid.
Exception and return value Added 2002-04-19 by Carey Sublette
The record.
numeric user-specified result code. If zero continue Processing.
This exception Is provided as a way for API users to throw
exceptions from their event handling code. By doing so they
abort file Processing by the HSSFEventFactory and by
catching it from outside the HSSFEventFactory.ProcessEvents
method they can diagnose the cause for the abort.
The HSSFUserException supports a nested "reason"
throwable, i.e. an exception that caused this one to be thrown.
The HSSF package does not itself throw any of these
exceptions.
@author Rainer Klute (klute@rainer-klute.de)
@author Carey Sublette (careysub@earthling.net)
Creates a new HSSFUserException
Creates a new HSSFUserException with a message
string.
The MSG.
Creates a new HSSFUserException with a reason.
The reason.
Creates a new HSSFUserException with a message string
and a reason.
The MSG.
The reason.
A HSSFListener which tracks rows and columns, and will
trigger your HSSFListener for all rows and cells,
even the ones that aren't actually stored in the file.
This allows your code to have a more "Excel" like
view of the data in the file, and not have to worry
(as much) about if a particular row/cell Is in the
file, or was skipped from being written as it was
blank.
Constructs a new MissingRecordAwareHSSFListener, which
will fire ProcessRecord on the supplied child
HSSFListener for all Records, and missing records.
The HSSFListener to pass records on to
Process an HSSF Record. Called when a record occurs in an HSSF file.
A text extractor for Excel files, that is based
on the hssf eventusermodel api.
It will typically use less memory than
ExcelExtractor, but may not provide
the same richness of formatting.
Returns the textual content of the file, suitable for
indexing by something like Lucene, but not really
intended for display to the user.
Common Parent for OLE2 based Text Extractors
of POI Documents, such as .doc, .xls
You will typically find the implementation of
a given format's text extractor under NPOI.Format.Extractor
@see org.apache.poi.hssf.extractor.ExcelExtractor
@see org.apache.poi.hslf.extractor.PowerPointExtractor
@see org.apache.poi.hdgf.extractor.VisioTextExtractor
@see org.apache.poi.hwpf.extractor.WordExtractor
Creates a new text extractor for the given document
Returns the document information metadata for the document
The doc summary information.
Returns the summary information metadata for the document
The summary information.
Returns an HPSF powered text extractor for the
document properties metadata, such as title and author.
Triggers the extraction.
Would return the document information metadata for the document,
if we supported it
The doc summary information.
Would return the summary information metadata for the document,
if we supported it
The summary information.
Should sheet names be included? Default is true
if set to true [include sheet names].
Should we return the formula itself, and not
the result it produces? Default is false
if set to true [formulas not results].
Retreives the text contents of the file
All the text from the document.
Process an HSSF Record. Called when a record occurs in an HSSF file.
Formats a number or date cell, be that a real number, or the
answer to a formula
The cell.
The value.
A text extractor for Excel files.
Returns the textual content of the file, suitable for
indexing by something like Lucene, but not really
intended for display to the user.
Initializes a new instance of the class.
The wb.
Initializes a new instance of the class.
The fs.
Extracts the header footer.
The header or footer
Should header and footer be included? Default is true
Should sheet names be included? Default is true
if set to true [include sheet names].
Should we return the formula itself, and not
the result it produces? Default is false
if set to true [formulas not results].
Should cell comments be included? Default is false
if set to true [include cell comments].
Should blank cells be output? Default is to only
output cells that are present in the file and are
non-blank.
if set to true [include blank cells].
Retreives the text contents of the file
All the text from the document.
An abstract shape Is the lowlevel model for a shape.
@author Glen Stampoultzis (glens at apache.org)
Create a new shape object used to Create the escher records.
The simple shape this Is based on.
The shape id.
Creates an escher anchor record from a HSSFAnchor.
The high level anchor to Convert.
An escher anchor record.
Add standard properties to the opt record. These properties effect
all records.
The user model shape.
The opt record to Add the properties to.
The number of options Added.
Generate id for the CommonObjectDataSubRecord that stands behind this shape
shape id as generated by drawing manager
object id that will be assigned to the Obj record
The shape container and it's children that can represent this
shape.
The sp container.
The object record that Is associated with this shape.
The obj record.
Creates the low evel records for a combobox.
@param hssfShape The highlevel shape.
@param shapeId The shape id to use for this shape.
Generates the escher shape records for this shape.
Represents a cell comment.
This class Converts highlevel model data from HSSFComment
to low-level records.
@author Yegor Kozlov
Represents an textbox shape and Converts between the highlevel records
and lowlevel records for an oval.
@author Glen Stampoultzis (glens at apache.org)
Creates the low evel records for a textbox.
The highlevel shape.
The shape id to use for this shape.
Creates the lowerlevel OBJ records for this shape.
The HSSF shape.
The shape id.
Creates the lowerlevel escher records for this shape.
The HSSF shape.
The shape id.
Textboxes also have an extra TXO record associated with them that most
other shapes dont have.
The HSSF shape.
The shape id.
The shape container and it's children that can represent this
shape.
The object record that is associated with this shape.
The TextObject record that is associated with this shape.
Gets the EscherTextbox record.
The EscherTextbox record.
Creates the low-level records for a comment.
The highlevel shape.
The shape id to use for this shape.
Creates the low level NoteRecord
which holds the comment attributes.
The shape.
The shape id.
Sets standard escher options for a comment.
This method is responsible for Setting default background,
shading and other comment properties.
The highlevel shape.
The escher records holding the proerties
The number of escher options added
Gets the NoteRecord holding the comment attributes
The NoteRecord
Creates the anchor.
The user anchor.
Provides utilities to manage drawing Groups.
@author Glen Stampoultzis (glens at apache.org)
Allocates new shape id for the new drawing Group id.
@return a new shape id.
Provides utilities to manage drawing Groups.
Glen Stampoultzis (glens at apache.org)
Clears the cached list of drawing Groups
Allocates new shape id for the new drawing Group id.
a new shape id.
Allocates new shape id for the new drawing group id.
a new shape id.
Finds the next available (1 based) drawing Group id
HSSF wrapper for the {@link FormulaParser} and {@link FormulaRenderer}
@author Josh Micich
Convenience method for parsing cell formulas. see {@link #parse(String, HSSFWorkbook, int)}
@param formulaType a constant from {@link FormulaType}
@return the parsed formula tokens
@param formula the formula to parse
@param workbook the parent workbook
@param formulaType a constant from {@link FormulaType}
@param sheetIndex the 0-based index of the sheet this formula belongs to.
The sheet index is required to resolve sheet-level names. -1
means that
the scope of the name will be ignored and the parser will match named ranges only by name
@return the parsed formula tokens
Static method to convert an array of {@link Ptg}s in RPN order
to a human readable string format in infix mode.
@param book used for defined names and 3D references
@param ptgs must not be null
@return a human readable String
Represents a line shape and Creates all the line specific low level records.
@author Glen Stampoultzis (glens at apache.org)
Creates the line shape from the highlevel user shape. All low level
records are Created at this point.
The user model shape
The identifier to use for this shape.
Creates the lowerlevel escher records for this shape.
The HSSF shape.
The shape id.
Creates the low level OBJ record for this shape.
The HSSF shape.
The shape id.
The shape container and it's children that can represent this
shape.
The object record that is associated with this shape.
Link Table (OOO pdf reference: 4.10.3 )
The main data of all types of references is stored in the Link Table inside the Workbook Globals
Substream (4.2.5). The Link Table itself is optional and occurs only, if there are any
references in the document.
In BIFF8 the Link Table consists of
- zero or more EXTERNALBOOK Blocks
each consisting of
- exactly one EXTERNALBOOK (0x01AE) record
- zero or more EXTERNALNAME (0x0023) records
- zero or more CRN Blocks
each consisting of
- exactly one XCT (0x0059)record
- zero or more CRN (0x005A) records (documentation says one or more)
- zero or one EXTERNSHEET (0x0017) record
- zero or more DEFINEDNAME (0x0018) records
@author Josh Micich
@param extRefIndex as from a {@link Ref3DPtg} or {@link Area3DPtg}
@return -1 if the reference is to an external book
Register an external name in this workbook
@param name the name to register
@return a NameXPtg describing this name
copied from Workbook
Changes an external referenced file to another file.
A formular in Excel which refers a cell in another file is saved in two parts:
The referenced file is stored in an reference table. the row/cell information is saved separate.
This method invokation will only change the reference in the lookup-table itself.
@param oldUrl The old URL to search for and which is to be replaced
@param newUrl The URL replacement
@return true if the oldUrl was found and replaced with newUrl. Otherwise false
TODO - would not be required if calling code used RecordStream or similar
Create a new block for registering add-in functions
@see org.apache.poi.hssf.model.LinkTable#addNameXPtg(String)
Create a new block for internal references. It is called when constructing a new LinkTable.
@see org.apache.poi.hssf.model.LinkTable#LinkTable(int, WorkbookRecordList)
Performs case-insensitive search
@return -1 if not found
Represents a syntactic element from a formula by encapsulating the corresponding Ptg
token. Each ParseNode may have child ParseNodes in the case when the wrapped
Ptg is non-atomic.
@author Josh Micich
Collects the array of Ptg
tokens for the specified tree.
The root node.
The IF() function Gets marked up with two or three tAttr tokens.
Similar logic will be required for CHOOSE() when it is supported
See excelfileformat.pdf sec 3.10.5 "tAttr (19H)
The temp.
Represents a picture shape and Creates all specific low level records.
@author Glen Stampoultzis (glens at apache.org)
Creates the line shape from the highlevel user shape. All low level
records are Created at this point.
The user model shape.
The identifier to use for this shape.
Creates the lowerlevel escher records for this shape.
The HSSF shape.
The shape id.
Creates the low level OBJ record for this shape.
The HSSFShape.
The shape id.
The shape container and it's children that can represent this
shape.
The object record that is associated with this shape.
Creates the low evel records for an polygon.
The highlevel shape.
The shape id to use for this shape.
Creates the lowerlevel escher records for this shape.
The HSSF shape.
The shape id.
Creates the lowerlevel OBJ records for this shape.
The HSSF shape.
The shape id.
The shape container and it's children that can represent this
shape.
The object record that is associated with this shape.
Finds correct insert positions for records in workbook streams
See OOO excelfileformat.pdf sec. 4.2.5 'Record Order in a BIFF8 Workbook Stream'
@author Josh Micich
Adds the specified new record in the correct place in sheet records list
Finds the index where the protection block should be inserted
the records for this sheet
+ BOF
o INDEX
o Calculation Settings Block
o PRINTHEADERS
o PRINTGRIDLINES
o GRIDSET
o GUTS
o DEFAULTROWHEIGHT
o SHEETPR
o Page Settings Block
o Worksheet Protection Block
o DEFCOLWIDTH
oo COLINFO
o SORT
+ DIMENSION
These records may occur between the 'Worksheet Protection Block' and DIMENSION:
o DEFCOLWIDTH
oo COLINFO
o SORT
Find correct position to add new CFHeader record
Finds the index where the sheet validations header record should be inserted
@param records the records for this sheet
+ WINDOW2
o SCL
o PANE
oo SELECTION
o STANDARDWIDTH
oo MERGEDCELLS
o LABELRANGES
o PHONETICPR
o Conditional Formatting Table
o Hyperlink Table
o Data Validity Table
o SHEETLAYOUT
o SHEETPROTECTION
o RANGEPROTECTION
+ EOF
DIMENSIONS record is always present
if the specified record ID terminates a sequence of Row block records
It is assumed that at least one row or cell value record has been found prior to the current
record
Whether the specified record id normally appears in the row blocks section of the sheet records
Simplifies iteration over a sequence of Record objects.
@author Josh Micich
Determines whether this instance has next.
true if this instance has next; otherwise, false.
Gets the next record
Peeks the next sid.
-1 if at end of records
Peeks the next class.
the class of the next Record.return null if this stream Is exhausted.
Segregates the 'Row Blocks' section of a single sheet into plain row/cell records and
shared formula records.
@author Josh Micich
Also collects any loose MergeCellRecords and puts them in the supplied
mergedCellsTable
Some unconventional apps place {@link MergeCellsRecord}s within the row block. They
actually should be in the {@link MergedCellsTable} which is much later (see bug 45699).
@return any loose MergeCellsRecords found
@return a {@link RecordStream} containing all the non-{@link SharedFormulaRecord}
non-{@link ArrayRecord} and non-{@link TableRecord} Records.
Low level model implementation of a Sheet (one workbook Contains many sheets)
This file Contains the low level binary records starting at the sheets BOF and
ending with the sheets EOF. Use HSSFSheet for a high level representation.
The structures of the highlevel API use references to this to perform most of their
operations. Its probably Unwise to use these low level structures directly Unless you
really know what you're doing. I recommend you Read the Microsoft Excel 97 Developer's
Kit (Microsoft Press) and the documentation at http://sc.openoffice.org/excelfileformat.pdf
before even attempting to use this.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Shawn Laubach (slaubach at apache dot org) Gridlines, Headers, Footers, PrintSetup, and Setting Default Column Styles
@author Jason Height (jheight at chariot dot net dot au) Clone support. DBCell and Index Record writing support
@author Brian Sanders (kestrel at burdell dot org) Active Cell support
@author Jean-Pierre Paris (jean-pierre.paris at m4x dot org) (Just a little)
java object always present, but if empty no BIFF records are written
the DimensionsRecord is always present
Add an UncalcedRecord if not true indicating formulas have not been calculated
Clones the low level records of this sheet and returns the new sheet instance.
This method is implemented by Adding methods for deep cloning to all records that
can be Added to a sheet. The Record object does not implement Cloneable.
When Adding a new record, implement a public Clone method if and only if the record
belongs to a sheet.
get the NEXT value record (from LOC). The first record that is a value record
(starting at LOC) will be returned.
This method is "loc" sensitive. Meaning you need to set LOC to where you
want it to start searching. If you don't know do this: setLoc(getDimsLoc).
When adding several rows you can just start at the last one by leaving loc
at what this sets it to. For this method, set loc to dimsloc to start with,
subsequent calls will return values in (physical) sequence or NULL when you get to the end.
the next value record or NULL if there are no more
Creates the sheet.
The stream.
Initializes a new instance of the class.
The stream.
Creates a sheet with all the usual records minus values and the "index"
record (not required). Sets the location pointer to where the first value
records should go. Use this to Create a sheet from "scratch".
Sheet object with all values Set to defaults
Adds the merged region.
the row index From
The column index From.
The row index To
The column To.
Removes the merged region.
The index.
Gets the merged region at.
The index.
Per an earlier reported bug in working with Andy Khan's excel Read library. This
Sets the values in the sheet's DimensionsRecord object to be correct. Excel doesn't
really care, but we want to play nice with other libraries.
The first row.
The first column.
The last row.
The last column.
Create a row record. (does not Add it to the records contained in this sheet)
row number
RowRecord Created for the passed in row number
Create a LABELSST Record (does not Add it to the records contained in this sheet)
the row the LabelSST Is a member of
the column the LabelSST defines
the index of the string within the SST (use workbook AddSSTString method)
LabelSSTRecord newly Created containing your SST Index, row,col.
Create a NUMBER Record (does not Add it to the records contained in this sheet)
the row the NumberRecord is a member of
the column the NumberRecord defines
value for the number record
NumberRecord for that row, col containing that value as Added to the sheet
Create a BLANK record (does not Add it to the records contained in this sheet)
the row the BlankRecord is a member of
the column the BlankRecord is a member of
Adds a value record to the sheet's contained binary records
(i.e. LabelSSTRecord or NumberRecord).
This method is "loc" sensitive. Meaning you need to Set LOC to where you
want it to start searching. If you don't know do this: SetLoc(GetDimsLoc).
When Adding several rows you can just start at the last one by leaving loc
at what this Sets it to.
the row to Add the cell value to
the cell value record itself.
Remove a value record from the records array.
This method is not loc sensitive, it Resets loc to = dimsloc so no worries.
the row of the value record you wish to Remove
a record supporting the CellValueRecordInterface.
Replace a value record from the records array.
This method is not loc sensitive, it Resets loc to = dimsloc so no worries.
a record supporting the CellValueRecordInterface. this will Replace
the cell value with the same row and column. If there Isn't one, one will
be Added.
Adds a row record to the sheet
This method is "loc" sensitive. Meaning you need to Set LOC to where you
want it to start searching. If you don't know do this: SetLoc(GetDimsLoc).
When Adding several rows you can just start at the last one by leaving loc
at what this Sets it to.
the row record to be Added
Removes a row record
This method is not loc sensitive, it Resets loc to = dimsloc so no worries.
the row record to Remove
Get the NEXT (from LOC) RowRecord where rownumber matches the given rownum.
The first record that is a Row record (starting at LOC) that has the
same rownum as the given rownum will be returned.
This method is "loc" sensitive. Meaning you need to Set LOC to where you
want it to start searching. If you don't know do this: SetLoc(GetDimsLoc).
When Adding several rows you can just start at the last one by leaving loc
at what this Sets it to. For this method, Set loc to dimsloc to start with.
subsequent calls will return rows in (physical) sequence or NULL when you Get to the end.
which row to return (careful with LOC)
RowRecord representing the next row record or NULL if there are no more
Creates the BOF record
record containing a BOFRecord
Creates the Index record - not currently used
record containing a IndexRecord
Creates the CalcMode record and Sets it to 1 (automatic formula caculation)
record containing a CalcModeRecord
Creates the CalcCount record and Sets it to 0x64 (default number of iterations)
record containing a CalcCountRecord
Creates the RefMode record and Sets it to A1 Mode (default reference mode)
record containing a RefModeRecord
Creates the Iteration record and Sets it to false (don't iteratively calculate formulas)
record containing a IterationRecord
Creates the Delta record and Sets it to 0.0010 (default accuracy)
record containing a DeltaRecord
Creates the SaveRecalc record and Sets it to true (recalculate before saving)
record containing a SaveRecalcRecord
Creates the PrintHeaders record and Sets it to false (we don't Create headers yet so why print them)
record containing a PrintHeadersRecord
Creates the PrintGridlines record and Sets it to false (that makes for ugly sheets). As far as I can
tell this does the same thing as the GridsetRecord
record containing a PrintGridlinesRecord
Creates the GridSet record and Sets it to true (user has mucked with the gridlines)
record containing a GridsetRecord
Creates the Guts record and Sets leftrow/topcol guttter and rowlevelmax/collevelmax to 0
record containing a GutsRecordRecord
Creates the DefaultRowHeight Record and Sets its options to 0 and rowheight to 0xff
record containing a DefaultRowHeightRecord
Creates the WSBoolRecord and Sets its values to defaults
@see org.apache.poi.hssf.record.WSBoolRecord
@see org.apache.poi.hssf.record.Record
@return record containing a WSBoolRecord
Creates the HCenter Record and Sets it to false (don't horizontally center)
@see org.apache.poi.hssf.record.HCenterRecord
@see org.apache.poi.hssf.record.Record
@return record containing a HCenterRecord
Creates the VCenter Record and Sets it to false (don't horizontally center)
@see org.apache.poi.hssf.record.VCenterRecord
@see org.apache.poi.hssf.record.Record
@return record containing a VCenterRecord
Creates the PrintSetup Record and Sets it to defaults and marks it invalid
@see org.apache.poi.hssf.record.PrintSetupRecord
@see org.apache.poi.hssf.record.Record
@return record containing a PrintSetupRecord
Creates the DefaultColWidth Record and Sets it to 8
@see org.apache.poi.hssf.record.DefaultColWidthRecord
@see org.apache.poi.hssf.record.Record
@return record containing a DefaultColWidthRecord
Get the width of a given column in Units of 1/256th of a Char width
@param column index
@see org.apache.poi.hssf.record.DefaultColWidthRecord
@see org.apache.poi.hssf.record.ColumnInfoRecord
@see #SetColumnWidth(short,short)
@return column width in Units of 1/256th of a Char width
Get the index to the ExtendedFormatRecord "associated" with
the column at specified 0-based index. (In this case, an
ExtendedFormatRecord index is actually associated with a
ColumnInfoRecord which spans 1 or more columns)
Returns the index to the default ExtendedFormatRecord (0xF)
if no ColumnInfoRecord exists that includes the column
index specified.
@param column
@return index of ExtendedFormatRecord associated with
ColumnInfoRecord that includes the column index or the
index of the default ExtendedFormatRecord (0xF)
Set the width for a given column in 1/256th of a Char width Units
@param column - the column number
@param width (in Units of 1/256th of a Char width)
Get the hidden property for a given column.
@param column index
@see org.apache.poi.hssf.record.DefaultColWidthRecord
@see org.apache.poi.hssf.record.ColumnInfoRecord
@see #SetColumnHidden(short,bool)
@return whether the column is hidden or not.
Get the hidden property for a given column.
@param column - the column number
@param hidden - whether the column is hidden or not
Creates an outline Group for the specified columns.
@param fromColumn Group from this column (inclusive)
@param toColumn Group to this column (inclusive)
@param indent if true the Group will be indented by one level,
if false indenting will be Removed by one level.
Creates the Dimensions Record and Sets it to bogus values (you should Set this yourself
or let the high level API do it for you)
@see org.apache.poi.hssf.record.DimensionsRecord
@see org.apache.poi.hssf.record.Record
@return record containing a DimensionsRecord
Creates the WindowTwo Record and Sets it to:
options = 0x6b6
toprow = 0
leftcol = 0
headercolor = 0x40
pagebreakzoom = 0x0
normalzoom = 0x0
@see org.apache.poi.hssf.record.WindowTwoRecord
@see org.apache.poi.hssf.record.Record
@return record containing a WindowTwoRecord
Creates the Selection record and Sets it to nothing selected
record containing a SelectionRecord
Sets the active cell.
The row.
The column.
Sets the active cell range.
The firstrow.
The lastrow.
The firstcolumn.
The lastcolumn.
Sets the active cell range.
The cellranges.
The index of the active range.
The active row in the active range
The active column in the active range
Creates the EOF record
record containing a EOFRecord
Returns the first occurance of a record matching a particular sid.
The sid.
Sets the SCL record or Creates it in the correct place if it does not
already exist.
The record to set.
Finds the first occurance of a record matching a particular sid and
returns it's position.
@param sid the sid to search for
@return the record position of the matching record or -1 if no match
is made.
Sets whether the sheet is selected
@param sel True to select the sheet, false otherwise.
Creates a split (freezepane). Any existing freezepane or split pane Is overwritten.
@param colSplit Horizonatal position of split.
@param rowSplit Vertical position of split.
@param topRow Top row visible in bottom pane
@param leftmostColumn Left column visible in right pane.
Creates a split pane. Any existing freezepane or split pane is overwritten.
@param xSplitPos Horizonatal position of split (in 1/20th of a point).
@param ySplitPos Vertical position of split (in 1/20th of a point).
@param topRow Top row visible in bottom pane
@param leftmostColumn Left column visible in right pane.
@param activePane Active pane. One of: PANE_LOWER_RIGHT,
PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT
@see #PANE_LOWER_LEFT
@see #PANE_LOWER_RIGHT
@see #PANE_UPPER_LEFT
@see #PANE_UPPER_RIGHT
creates a Password record with password set to 00.
creates a Protect record with protect set to false.
Creates an ObjectProtect record with protect Set to false.
@see org.apache.poi.hssf.record.ObjectProtectRecord
@see org.apache.poi.hssf.record.Record
@return an ObjectProtectRecord
Creates a ScenarioProtect record with protect Set to false.
@see org.apache.poi.hssf.record.ScenarioProtectRecord
@see org.apache.poi.hssf.record.Record
@return a ScenarioProtectRecord
Finds the DrawingRecord for our sheet, and attaches it to the DrawingManager (which knows about
the overall DrawingGroup for our workbook).
If requested, will Create a new DrawRecord if none currently exist
The DrawingManager2 for our workbook
Should one be Created if missing?
location of EscherAggregate record. if no EscherAggregate record is found return -1
Perform any work necessary before the sheet is about to be Serialized.
For instance the escher aggregates size needs to be calculated before
serialization so that the dgg record (which occurs first) can be written.
Shifts all the page breaks in the range "count" number of rows/columns
@param breaks The page record to be Shifted
@param start Starting "main" value to Shift breaks
@param stop Ending "main" value to Shift breaks
@param count number of Units (rows/columns) to Shift by
Shifts the horizontal page breaks for the indicated count
@param startingRow
@param endingRow
@param count
Shifts the vertical page breaks for the indicated count
@param startingCol
@param endingCol
@param count
Updates formulas in cells and conditional formats due to moving of cells
@param externSheetIndex the externSheet index of this sheet
'initial sheet records' are between INDEX and the 'Row Blocks'
@param bofRecordIndex index of record after which INDEX record is to be placed
@return count of bytes from end of INDEX record to first ROW record.
Get the {@link NoteRecord}s (related to cell comments) for this sheet
@return never null
, typically empty array
Gets the column infos.
The column infos.
Gets the number of merged regions.
The number merged regions.
Gets the number of conditional formattings.
The number of conditional formattings.
Gets or Sets the preoffset when using DBCELL records (currently Unused) - this Is
the position of this sheet within the whole file.
the offset of the sheet's BOF within the file.
Get the NEXT RowRecord (from LOC). The first record that is a Row record
(starting at LOC) will be returned.
This method is "loc" sensitive. Meaning you need to Set LOC to where you
want it to start searching. If you don't know do this: SetLoc(GetDimsLoc).
When Adding several rows you can just start at the last one by leaving loc
at what this Sets it to. For this method, Set loc to dimsloc to start with.
subsequent calls will return rows in (physical) sequence or NULL when you Get to the end.
RowRecord representing the next row record or NULL if there are no more
Gets the page settings.
Get the default column width for the sheet (if the columns do not define their own width)
@return default column width
Get the default row height for the sheet (if the rows do not define their own height)
@return default row height
Gets or sets the top row.
The top row.
Gets or sets the left col.
The left col.
Returns the active row
the active row index
@see org.apache.poi.hssf.record.SelectionRecord
Gets or sets the active cell col.
the active column index
@see org.apache.poi.hssf.record.SelectionRecord
Gets the gridset record for this sheet.
The gridset record.
Gets or sets the header.
the HeaderRecord.
Gets or sets a value indicating whether this instance is auto tab color.
true if this instance is auto tab color; otherwise, false.
Gets or sets the footer.
FooterRecord for the sheet.
Returns the PrintSetupRecord.
@return PrintSetupRecord for the sheet.
@return true if gridlines are printed
Returns the PrintGridlinesRecord.
@return PrintGridlinesRecord for the sheet.
Returns the information regarding the currently configured pane (split or freeze).
@return null if no pane configured, or the pane information.
Returns if gridlines are Displayed.
@return whether gridlines are Displayed
Returns if formulas are Displayed.
@return whether formulas are Displayed
Returns if RowColHeadings are Displayed.
@return whether RowColHeadings are Displayed
@return whether an Uncalced record must be Inserted or not at generation
Creates the low evel records for an oval.
The highlevel shape.
The shape id to use for this shape.
Creates the lowerlevel escher records for this shape.
The HSSF shape.
The shape id.
Creates the lowerlevel OBJ records for this shape.
The HSSF shape.
The shape id.
The shape container and it's children that can represent this
shape.
The object record that is associated with this shape.
Low level model implementation of a Workbook. Provides creational methods
for Settings and objects contained in the workbook object.
This file Contains the low level binary records starting at the workbook's BOF and
ending with the workbook's EOF. Use HSSFWorkbook for a high level representation.
The structures of the highlevel API use references to this to perform most of their
operations. Its probably Unwise to use these low level structures directly Unless you
really know what you're doing. I recommend you Read the Microsoft Excel 97 Developer's
Kit (Microsoft Press) and the documentation at http://sc.openoffice.org/excelfileformat.pdf
before even attempting to use this.
@author Luc Girardin (luc dot girardin at macrofocus dot com)
@author Sergei Kozello (sergeikozello at mail.ru)
@author Shawn Laubach (slaubach at apache dot org) (Data Formats)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Brian Sanders (bsanders at risklabs dot com) - custom palette
@author Dan Sherman (dsherman at Isisph.com)
@author Glen Stampoultzis (glens at apache.org)
@see org.apache.poi.hssf.usermodel.HSSFWorkbook
@version 1.0-pre
Excel silently truncates long sheet names to 31 chars.
This constant is used to ensure uniqueness in the first 31 chars
constant used to Set the "codepage" wherever "codepage" is Set in records
(which is duplciated in more than one record)
this Contains the Worksheet record objects
this Contains a reference to the SSTRecord so that new stings can be Added
to it.
holds the "boundsheet" records (aka bundlesheet) so that they can have their
reference to their "BOF" marker
Creates new Workbook with no intitialization --useless right now
@see #CreateWorkbook(List)
Read support for low level
API. Pass in an array of Record objects, A Workbook
object is constructed and passed back with all of its initialization Set
to the passed in records and references to those records held. Unlike Sheet
workbook does not use an offset (its assumed to be 0) since its first in a file.
If you need an offset then construct a new array with a 0 offset or Write your
own ;-p.
@param recs an array of Record objects
@return Workbook object
gets the name comment record
@param nameRecord name record who's comment is required.
@return name comment record or null
if there isn't one for the given name.
Creates an empty workbook object with three blank sheets and all the empty
fields. Use this to Create a workbook from scratch.
Retrieves the Builtin NameRecord that matches the name and index
There shouldn't be too many names to make the sequential search too slow
@param name byte representation of the builtin name to match
@param sheetIndex Index to match
@return null if no builtin NameRecord matches
Removes the specified Builtin NameRecord that matches the name and index
@param name byte representation of the builtin to match
@param sheetIndex zero-based sheet reference
Gets the font record at the given index in the font table. Remember
"There is No Four" (someone at M$ must have gone to Rocky Horror one too
many times)
@param idx the index to look at (0 or greater but NOT 4)
@return FontRecord located at the given index
Creates a new font record and Adds it to the "font table". This causes the
boundsheets to move down one, extended formats to move down (so this function moves
those pointers as well)
@return FontRecord that was just Created
Check if the cloned sheet has drawings. If yes, then allocate a new drawing group ID and
re-generate shape IDs
@param sheet the cloned sheet
Sets the BOF for a given sheet
@param sheetnum the number of the sheet to Set the positing of the bof for
@param pos the actual bof position
Sets the name for a given sheet. If the boundsheet record doesn't exist and
its only one more than we have, go ahead and Create it. If its > 1 more than
we have, except
@param sheetnum the sheet number (0 based)
@param sheetname the name for the sheet
Determines whether a workbook Contains the provided sheet name.
@param name the name to test (case insensitive match)
@param excludeSheetIdx the sheet to exclude from the Check or -1 to include all sheets in the Check.
@return true if the sheet Contains the name, false otherwise.
Sets the name for a given sheet forcing the encoding. This is STILL A BAD IDEA.
Poi now automatically detects Unicode
@deprecated 3-Jan-06 Simply use SetSheetNam e(int sheetnum, String sheetname)
@param sheetnum the sheet number (0 based)
@param sheetname the name for the sheet
Sets the order of appearance for a given sheet.
@param sheetname the name of the sheet to reorder
@param pos the position that we want to Insert the sheet into (0 based)
Gets the name for a given sheet.
@param sheetnum the sheet number (0 based)
@return sheetname the name for the sheet
Gets the hidden flag for a given sheet.
@param sheetnum the sheet number (0 based)
@return True if sheet is hidden
Gets the hidden flag for a given sheet.
Note that a sheet could instead be
set to be very hidden, which is different
({@link #isSheetVeryHidden(int)})
@param sheetnum the sheet number (0 based)
@return True if sheet is hidden
Hide or Unhide a sheet
@param sheetnum The sheet number
@param hidden True to mark the sheet as hidden, false otherwise
Hide or unhide a sheet.
0 = not hidden
1 = hidden
2 = very hidden.
@param sheetnum The sheet number
@param hidden 0 for not hidden, 1 for hidden, 2 for very hidden
Get the sheet's index
@param name sheet name
@return sheet index or -1 if it was not found.
if we're trying to Address one more sheet than we have, go ahead and Add it! if we're
trying to Address >1 more than we have throw an exception!
make the tabid record look like the current situation.
number of bytes written in the TabIdRecord
Retrieves the index of the given font
Returns the StyleRecord for the given
xfIndex, or null if that ExtendedFormat doesn't
have a Style set.
Gets the ExtendedFormatRecord at the given 0-based index
@param index of the Extended format record (0-based)
@return ExtendedFormatRecord at the given index
Creates a new Cell-type Extneded Format Record and Adds it to the end of
ExtendedFormatRecords collection
@return ExtendedFormatRecord that was Created
Adds a string to the SST table and returns its index (if its a duplicate
just returns its index and update the counts) ASSUMES compressed Unicode
(meaning 8bit)
@param string the string to be Added to the SSTRecord
@return index of the string within the SSTRecord
given an index into the SST table, this function returns the corresponding String value
@return String containing the SST String
use this function to Add a Shared String Table to an existing sheet (say
generated by a different java api) without an sst....
@see #CreateSST()
@see org.apache.poi.hssf.record.SSTRecord
Serializes all records int the worksheet section into a big byte array. Use
this to Write the Workbook out.
@param offset of the data to be written
@param data array of bytes to Write this to
Perform any work necessary before the workbook is about to be serialized.
Include in it ant code that modifies the workbook record stream and affects its size.
Creates the BOF record
@see org.apache.poi.hssf.record.BOFRecord
@see org.apache.poi.hssf.record.Record
@return record containing a BOFRecord
Creates the InterfaceHdr record
@see org.apache.poi.hssf.record.InterfaceHdrRecord
@see org.apache.poi.hssf.record.Record
@return record containing a InterfaceHdrRecord
Creates an MMS record
@see org.apache.poi.hssf.record.MMSRecord
@see org.apache.poi.hssf.record.Record
@return record containing a MMSRecord
Creates the InterfaceEnd record
@see org.apache.poi.hssf.record.InterfaceEndRecord
@see org.apache.poi.hssf.record.Record
@return record containing a InterfaceEndRecord
Creates the WriteAccess record containing the logged in user's name
@see org.apache.poi.hssf.record.WriteAccessRecord
@see org.apache.poi.hssf.record.Record
@return record containing a WriteAccessRecord
Creates the Codepage record containing the constant stored in CODEPAGE
@see org.apache.poi.hssf.record.CodepageRecord
@see org.apache.poi.hssf.record.Record
@return record containing a CodepageRecord
Creates the DSF record containing a 0 since HSSF can't even Create Dual Stream Files
@see org.apache.poi.hssf.record.DSFRecord
@see org.apache.poi.hssf.record.Record
@return record containing a DSFRecord
Creates the TabId record containing an array of 0,1,2. This release of HSSF
always has the default three sheets, no less, no more.
@see org.apache.poi.hssf.record.TabIdRecord
@see org.apache.poi.hssf.record.Record
@return record containing a TabIdRecord
Creates the FnGroupCount record containing the Magic number constant of 14.
@see org.apache.poi.hssf.record.FnGroupCountRecord
@see org.apache.poi.hssf.record.Record
@return record containing a FnGroupCountRecord
Creates the WindowProtect record with protect Set to false.
@see org.apache.poi.hssf.record.WindowProtectRecord
@see org.apache.poi.hssf.record.Record
@return record containing a WindowProtectRecord
Creates the Protect record with protect Set to false.
@see org.apache.poi.hssf.record.ProtectRecord
@see org.apache.poi.hssf.record.Record
@return record containing a ProtectRecord
Creates the Password record with password Set to 0.
@see org.apache.poi.hssf.record.PasswordRecord
@see org.apache.poi.hssf.record.Record
@return record containing a PasswordRecord
Creates the ProtectionRev4 record with protect Set to false.
@see org.apache.poi.hssf.record.ProtectionRev4Record
@see org.apache.poi.hssf.record.Record
@return record containing a ProtectionRev4Record
Creates the PasswordRev4 record with password Set to 0.
@see org.apache.poi.hssf.record.PasswordRev4Record
@see org.apache.poi.hssf.record.Record
@return record containing a PasswordRev4Record
Creates the WindowOne record with the following magic values:
horizontal hold - 0x168
vertical hold - 0x10e
width - 0x3a5c
height - 0x23be
options - 0x38
selected tab - 0
Displayed tab - 0
num selected tab- 0
tab width ratio - 0x258
@see org.apache.poi.hssf.record.WindowOneRecord
@see org.apache.poi.hssf.record.Record
@return record containing a WindowOneRecord
Creates the Backup record with backup Set to 0. (loose the data, who cares)
@see org.apache.poi.hssf.record.BackupRecord
@see org.apache.poi.hssf.record.Record
@return record containing a BackupRecord
Creates the HideObj record with hide object Set to 0. (don't hide)
@see org.apache.poi.hssf.record.HideObjRecord
@see org.apache.poi.hssf.record.Record
@return record containing a HideObjRecord
Creates the DateWindow1904 record with windowing Set to 0. (don't window)
@see org.apache.poi.hssf.record.DateWindow1904Record
@see org.apache.poi.hssf.record.Record
@return record containing a DateWindow1904Record
Creates the Precision record with precision Set to true. (full precision)
@see org.apache.poi.hssf.record.PrecisionRecord
@see org.apache.poi.hssf.record.Record
@return record containing a PrecisionRecord
Creates the RefreshAll record with refreshAll Set to true. (refresh all calcs)
@see org.apache.poi.hssf.record.RefreshAllRecord
@see org.apache.poi.hssf.record.Record
@return record containing a RefreshAllRecord
Creates the BookBool record with saveLinkValues Set to 0. (don't save link values)
@see org.apache.poi.hssf.record.BookBoolRecord
@see org.apache.poi.hssf.record.Record
@return record containing a BookBoolRecord
Creates a Font record with the following magic values:
fontheight = 0xc8
attributes = 0x0
color palette index = 0x7fff
bold weight = 0x190
Font Name Length = 5
Font Name = Arial
@see org.apache.poi.hssf.record.FontRecord
@see org.apache.poi.hssf.record.Record
@return record containing a FontRecord
Creates an ExtendedFormatRecord object
@param id the number of the extended format record to Create (meaning its position in
a file as MS Excel would Create it.)
@return record containing an ExtendedFormatRecord
@see org.apache.poi.hssf.record.ExtendedFormatRecord
@see org.apache.poi.hssf.record.Record
Creates an default cell type ExtendedFormatRecord object.
@return ExtendedFormatRecord with intial defaults (cell-type)
Creates a new StyleRecord, for the given Extended
Format index, and adds it onto the end of the
records collection
Creates a StyleRecord object
@param id the number of the style record to Create (meaning its position in
a file as MS Excel would Create it.
@return record containing a StyleRecord
@see org.apache.poi.hssf.record.StyleRecord
@see org.apache.poi.hssf.record.Record
Creates a palette record initialized to the default palette
@return a PaletteRecord instance populated with the default colors
@see org.apache.poi.hssf.record.PaletteRecord
Creates the UseSelFS object with the use natural language flag Set to 0 (false)
@return record containing a UseSelFSRecord
@see org.apache.poi.hssf.record.UseSelFSRecord
@see org.apache.poi.hssf.record.Record
Create a "bound sheet" or "bundlesheet" (depending who you ask) record
Always Sets the sheet's bof to 0. You'll need to Set that yourself.
@param id either sheet 0,1 or 2.
@return record containing a BoundSheetRecord
@see org.apache.poi.hssf.record.BoundSheetRecord
@see org.apache.poi.hssf.record.Record
Creates the Country record with the default country Set to 1
and current country Set to 7 in case of russian locale ("ru_RU") and 1 otherwise
@return record containing a CountryRecord
@see org.apache.poi.hssf.record.CountryRecord
@see org.apache.poi.hssf.record.Record
Creates the ExtendedSST record with numstrings per bucket Set to 0x8. HSSF
doesn't yet know what to do with this thing, but we Create it with nothing in
it hardly just to make Excel happy and our sheets look like Excel's
@return record containing an ExtSSTRecord
@see org.apache.poi.hssf.record.ExtSSTRecord
@see org.apache.poi.hssf.record.Record
Finds the sheet name by his extern sheet index
@param num extern sheet index
@return sheet name
Finds the sheet index for a particular external sheet number.
@param externSheetNumber The external sheet number to Convert
@return The index to the sheet found.
returns the extern sheet number for specific sheet number ,
if this sheet doesn't exist in extern sheet , Add it
@param sheetNumber sheet number
@return index to extern sheet
@param name the name of an external function, typically a name of a UDF
@param udf locator of user-defiend functions to resolve names of VBA and Add-In functions
@return the external name or null
Gets the name record
@param index name index
@return name record
Creates new name
@return new name record
Creates new name
@return new name record
Generates a NameRecord to represent a built-in region
@return a new NameRecord Unless the index is invalid
Removes the name
@param namenum name index
If a {@link NameCommentRecord} is added or the name it references
is renamed, then this will update the lookup cache for it.
Returns a format index that matches the passed in format. It does not tie into HSSFDataFormat.
@param format the format string
@param CreateIfNotFound Creates a new format if format not found
@return the format id of a format that matches or -1 if none found and CreateIfNotFound
Creates a FormatRecord, Inserts it, and returns the index code.
@param format the format string
@return the index code of the format record.
@see org.apache.poi.hssf.record.FormatRecord
@see org.apache.poi.hssf.record.Record
Creates a FormatRecord object
@param id the number of the format record to create (meaning its position in
a file as M$ Excel would create it.)
Returns the first occurance of a record matching a particular sid.
Returns the index of a record matching a particular sid.
@param sid The sid of the record to match
@return The index of -1 if no match made.
Returns the next occurance of a record matching a particular sid.
Finds the primary drawing Group, if one already exists
Creates a primary drawing Group record. If it already
exists then it's modified.
Removes the given font record from the
file's list. This will make all
subsequent font indicies drop by one,
so you'll need to update those yourself!
Removes the given ExtendedFormatRecord record from the
file's list. This will make all
subsequent font indicies drop by one,
so you'll need to update those yourself!
Removes ExtendedFormatRecord record with given index from the file's list. This will make all
subsequent font indicies drop by one,so you'll need to update those yourself!
index of the Extended format record (0-based)
protect a workbook with a password (not encypted, just Sets Writeprotect
flags and the password.
@param password to Set
Removes the Write protect flag
@param reFindex Index to REF entry in EXTERNSHEET record in the Link Table
@param definedNameIndex zero-based to DEFINEDNAME or EXTERNALNAME record
@return the string representation of the defined or external name
Updates named ranges due to moving of cells
Changes an external referenced file to another file.
A formular in Excel which refers a cell in another file is saved in two parts:
The referenced file is stored in an reference table. the row/cell information is saved separate.
This method invokation will only change the reference in the lookup-table itself.
@param oldUrl The old URL to search for and which is to be replaced
@param newUrl The URL replacement
@return true if the oldUrl was found and replaced with newUrl. Otherwise false
Gets the number of font records
@return number of font records in the "font table"
Returns the position of the backup record.
returns the number of boundsheet objects contained in this workbook.
@return number of BoundSheet records
Get the number of ExtendedFormat records contained in this workbook.
@return int count of ExtendedFormat records
lazy initialization
Note - creating the link table causes creation of 1 EXTERNALBOOK and 1 EXTERNALSHEET record
Gets the total number of names
@return number of names
Returns the list of FormatRecords in the workbook.
@return ArrayList of FormatRecords in the notebook
Whether date windowing is based on 1/2/1904 or 1/1/1900.
Some versions of Excel (Mac) can save workbooks using 1904 date windowing.
@return true if using 1904 date windowing
Returns the custom palette in use for this workbook; if a custom palette record
does not exist, then it is Created.
is the workbook protected with a password (not encrypted)?
Get or create RecalcIdRecord
@see org.apache.poi.hssf.usermodel.HSSFWorkbook#setForceFormulaRecalculation(boolean)
List for records in Workbook
Adds the specified pos.
The pos.
The r.
Removes the specified record.
The record.
Removes the specified position.
The position.
Gets or sets the records.
The records.
Gets the count.
The count.
Gets the at the specified index.
Gets or sets the protpos.
The protpos.
Gets or sets the bspos.
The bspos.
Gets or sets the tabpos.
The tabpos.
Gets or sets the fontpos.
The fontpos.
Gets or sets the xfpos.
The xfpos.
Gets or sets the backuppos.
The backuppos.
Gets or sets the palettepos.
The palettepos.
Gets or sets the namepos.
The namepos.
Gets or sets the supbookpos.
The supbookpos.
Gets or sets the externsheet pos.
The externsheet pos.
The escher container record is used to hold escher records. It is abstract and
must be subclassed for maximum benefit.
@author Glen Stampoultzis (glens at apache.org)
@author Michael Zalewski (zalewski at optonline.net)
Constructs a Bar record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Clone the current record, via a call to serialise
it, and another to Create a new record from the
bytes.
May only be used for classes which don't have
internal counts / ids in them. For those which
do, a full record-aware serialise is needed, which
allocates new ids / counts as needed.
If we have a EscherContainerRecord as one of our
children (and most top level escher holders do),
then return that.
Descends into all our children, returning the
first EscherRecord with the given id, or null
if none found
Big drawing Group records are split but it's easier to deal with them
as a whole Group so we need to join them toGether.
Convert raw data to escher records.
Size of record (including 4 byte header)
CFRecordsAggregate - aggregates Conditional Formatting records CFHeaderRecord
and number of up to three CFRuleRecord records toGether to simplify
access to them.
@author Dmitriy Kumshayev
Excel allows up to 3 conditional formating rules
List of CFRuleRecord objects
Create CFRecordsAggregate from a list of CF Records
list of Record objects
Create CFRecordsAggregate from a list of CF Records
list of Record objects
position of CFHeaderRecord object in the list of Record objects
Create a deep Clone of the record
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array.
The offset to begin writing at
The data byte array containing instance data
number of bytes written
@return false if this whole {@link CFHeaderRecord} / {@link CFRuleRecord}s should be deleted
@return sum of sizes of all aggregated records
@author Glen Stampoultzis
Initializes a new instance of the class.
Initializes a new instance of the class.
The rs.
Performs a deep Clone of the record
Inserts a column into the aggregate (at the end of the list).
The column.
Inserts a column into the aggregate (at the position specified
by index
The index.
The columninfo.
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array.
offset to begin writing at
byte array containing instance data
number of bytes written
Visit each of the atomic BIFF records contained in this {@link RecordAggregate} in the order
that they should be written to file. Implementors may or may not return the actual
Records being used to manage POI's internal implementation. Callers should not
assume either way, and therefore only attempt to modify those Records after cloning
Finds the start of column outline group.
The idx.
Finds the end of column outline group.
The idx.
Gets the col info.
The idx.
Determines whether [is column group collapsed] [the specified idx].
The idx.
true if [is column group collapsed] [the specified idx]; otherwise, false.
Determines whether [is column group hidden by parent] [the specified idx].
The idx.
true if [is column group hidden by parent] [the specified idx]; otherwise, false.
Collapses the column.
The column number.
Expands the column.
The column number.
Sets all non null fields into the ci parameter.
Attempts to merge the col info record at the specified index
with either or both of its neighbours
The col info ix.
merges two column info records (if they are adjacent and have the same formatting, etc)
@return false if the two column records could not be merged
Sets all adjacent columns of the same outline level to the specified hidden status.
the col info index of the start of the outline group.
The level.
The hidden.
the column index of the last column in the outline group
Sets the column.
The target column ix.
Index of the xf.
The width.
The level.
The hidden.
The collapsed.
Sets all non null fields into the ci parameter.
Collapses the col info records.
The column index.
Creates an outline Group for the specified columns.
Group from this column (inclusive)
Group to this column (inclusive)
if true the Group will be indented by one level;if false indenting will be Removed by one level.
Finds the ColumnInfoRecord
which contains the specified columnIndex
index of the column (not the index of the ColumnInfoRecord)
/// null
if no column info found for the specified column
It's an aggregate... just made something up
Gets the num columns.
The num columns.
Gets the size of the record.
The size of the record.
Gets the max outline level.
The max outline level.
Holds all the conditional formatting for a workbook sheet.
See OOO exelfileformat.pdf sec 4.12 'Conditional Formatting Table'
@author Josh Micich
Creates an empty ConditionalFormattingTable
@return index of the newly added CF header aggregate
Manages the all the records associated with a 'Custom View Settings' sub-stream.
Includes the Initial USERSVIEWBEGIN(0x01AA) and USERSVIEWEND(0x01AB).
@author Josh Micich
All the records between BOF and EOF
Manages the DVALRecord and DVRecords for a single sheet
See OOO excelfileformat.pdf section 4.14
@author Josh Micich
The list of data validations for the current sheet.
Note - this may be empty (contrary to OOO documentation)
The formula record aggregate is used to join toGether the formula record and it's
(optional) string record and (optional) Shared Formula Record (template Reads, excel optimization).
@author Glen Stampoultzis (glens at apache.org)
The cell value record interface Is implemented by all classes of type Record that
contain cell values. It allows the containing sheet to move through them and Compare
them.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@see org.apache.poi.hssf.model.Sheet
@see org.apache.poi.hssf.record.Record
@see org.apache.poi.hssf.record.RecordFactory
Get the row this cell occurs on
@return the row
Get the column this cell defines within the row
@return the column
caches the calculated result of the formula
Initializes a new instance of the class.
The formula rec.
The string rec.
The SVM.
Should be called by any code which is either deleting this formula cell, or changing
its type. This method gives the aggregate a chance to unlink any shared formula
that may be involved with this cell formula.
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array.
offset to begin writing at
byte array containing instance data.
number of bytes written
Visit each of the atomic BIFF records contained in this {@link RecordAggregate} in the order
that they should be written to file. Implementors may or may not return the actual
{@link Record}s being used to manage POI's internal implementation. Callers should not
assume either way, and therefore only attempt to modify those {@link Record}s after cloning
Sometimes the shared formula flag "seems" to be erroneously set (because the corresponding
SharedFormulaRecord does not exist). Normally this would leave no way of determining
the Ptg tokens for the formula. However as it turns out in these
cases, Excel encodes the unshared Ptg tokens in the right place (inside the FormulaRecord).
So the the only thing that needs to be done is to ignore the erroneous
shared formula flag.
This method may also be used for setting breakpoints to help diagnose issues regarding the
abnormally-set 'shared formula' flags.
The formula.
Determines whether the specified is equal to the current .
The to compare with the current .
true if the specified is equal to the current ; otherwise, false.
The parameter is null.
Returns a that represents the current .
A that represents the current .
Sets the cached string result.
The value.
Sets the cached boolean result.
if set to true [value].
Sets the cached error result.
The error code.
Also checks for a related shared formula and unlinks it if found
Removes an array formula
@return the range of the array formula containing the specified cell. Never null
Get the current Serialized size of the record. Should include the sid and recLength (4 bytes).
The size of the record.
return the non static version of the id for this record.
The sid.
Gets or sets the formula record.
The formula record.
Gets or sets the string record.
The string record.
Gets the string value.
The string value.
@author Josh Micich
Creates an empty aggregate
Reads zero or more consecutive {@link MergeCellsRecord}s
@param rs
Groups the page settings records for a worksheet.
See OOO excelfileformat.pdf sec 4.4 'Page Settings Block'
@author Josh Micich
Creates a PageSettingsBlock with default settings
@return true if the specified Record sid is one belonging to the
'Page Settings Block'.
Sets a page break at the indicated column
Removes a page break at the indicated column
Creates the HCenter Record and sets it to false (don't horizontally center)
Creates the VCenter Record and sets it to false (don't horizontally center)
Creates the PrintSetup Record and sets it to defaults and marks it invalid
@see org.apache.poi.hssf.record.PrintSetupRecord
@see org.apache.poi.hssf.record.Record
@return record containing a PrintSetupRecord
Gets the size of the margin in inches.
@param margin which margin to Get
@return the size of the margin
Sets the size of the margin in inches.
@param margin which margin to Get
@param size the size of the margin
Shifts all the page breaks in the range "count" number of rows/columns
@param breaks The page record to be shifted
@param start Starting "main" value to shift breaks
@param stop Ending "main" value to shift breaks
@param count number of units (rows/columns) to shift by
Sets a page break at the indicated row
@param row
Removes a page break at the indicated row
@param row
Queries if the specified row has a page break
@param row
@return true if the specified row has a page break
Queries if the specified column has a page break
@return true if the specified column has a page break
Shifts the horizontal page breaks for the indicated count
@param startingRow
@param endingRow
@param count
Shifts the vertical page breaks for the indicated count
@param startingCol
@param endingCol
@param count
HEADERFOOTER is new in 2007. Some apps seem to have scattered this record long after
the PageSettingsBlock where it belongs.
This method reads PageSettingsBlock records from the supplied RecordStream until the first non-PageSettingsBlock record is encountered.
As each record is read, it is incorporated into this PageSettingsBlock.
Returns the HeaderRecord.
@return HeaderRecord for the sheet.
Returns the FooterRecord.
@return FooterRecord for the sheet.
Returns the PrintSetupRecord.
@return PrintSetupRecord for the sheet.
@return all the horizontal page breaks, never null
@return the number of row page breaks
@return all the column page breaks, never null
@return the number of column page breaks
holds any continue records found after the PLS record.
This would not be required if PLS was properly interpreted.
Currently, PLS is an {@link UnknownRecord} and does not automatically
include any trailing {@link ContinueRecord}s.
A wrapper for {@link RecordVisitor} which accumulates the sizes of all
records visited.
@author andy
@author Jason Height (jheight at chariot dot net dot au)
Creates a new instance of ValueRecordsAggregate
@param rs record stream with all {@link SharedFormulaRecord}
{@link ArrayRecord}, {@link TableRecord} {@link MergeCellsRecord} Records removed
Handles UnknownRecords which appear within the row/cell records
Returns the number of physical rows within a block
Returns the physical row number of the first row in a block
Returns the physical row number of the end row in a block
Create a row record.
@param row number
@return RowRecord Created for the passed in row number
@see org.apache.poi.hssf.record.RowRecord
Returns the number of row blocks.
The row blocks are goupings of rows that contain the DBCell record
after them
Manages various auxiliary records while constructing a RowRecordsAggregate
@author Josh Micich
cached for optimization purposes
@param firstCells
@param recs list of sheet records (possibly Contains records for other parts of the Excel file)
@param startIx index of first row/cell record for current sheet
@param endIx one past index of last row/cell record for current sheet. It is important
that this code does not inadvertently collect SharedFormulaRecords from any other
sheet (which could happen if endIx is chosen poorly). (see bug 44449)
@param firstCell as extracted from the {@link ExpPtg} from the cell's formula.
@return never null
Gets the {@link SharedValueRecordBase} record if it should be encoded immediately after the
formula record Contained in the specified {@link FormulaRecordAggregate} agg. Note - the
shared value record always appears after the first formula record in the group. For arrays
and tables the first formula is always the in the top left cell. However, since shared
formula groups can be sparse and/or overlap, the first formula may not actually be in the
top left cell.
@return the SHRFMLA, TABLE or ARRAY record for the formula cell, if it is the first cell of
a table or array region. null
if the formula cell is not shared/array/table,
or if the specified formula is not the the first in the group.
Converts all {@link FormulaRecord}s handled by sharedFormulaRecord
to plain unshared formulas
Add specified Array Record.
Removes the {@link ArrayRecord} for the cell group containing the specified cell.
The caller should clear (set blank) all cells in the returned range.
@return the range of the array formula which was just removed. Never null
.
@return the shared ArrayRecord identified by (firstRow, firstColumn). never null
.
Coordinates of the first cell having a formula that uses this shared formula.
This is often but not always the top left cell in the range covered by
{@link #_sfr}
Note - the 'first cell' of a shared formula group is not always the top-left cell
of the enclosing range.
@return true if the specified coordinates correspond to the 'first cell'
of this shared formula group.
Aggregate value records toGether. Things are easier to handle that way.
@author andy
@author Glen Stampoultzis (glens at apache.org)
@author Jason Height (jheight at chariot dot net dot au)
Creates a new instance of ValueRecordsAggregate
Sometimes the shared formula flag "seems" to be erroneously Set, in which case there is no
call to SharedFormulaRecord.ConvertSharedFormulaRecord and hence the
ParsedExpression field of this FormulaRecord will not Get updated.
As it turns out, this is not a problem, because in these circumstances, the existing value
for ParsedExpression is perfectly OK.
This method may also be used for Setting breakpoints to help diagnose Issues regarding the
abnormally-Set 'shared formula' flags.
(see TestValueRecordsAggregate.testSpuriousSharedFormulaFlag()).
The method currently does nothing but do not delete it without Finding a nice home for this
comment.
Tallies a count of the size of the cell records
that are attached to the rows in the range specified.
Returns true if the row has cells attached to it
Serializes the cells that are allocated to a certain row range
ARRAY (0x0221)
Treated in a similar way to SharedFormulaRecord
@author Josh Micich
Common base class for {@link SharedFormulaRecord}, {@link ArrayRecord} and
{@link TableRecord} which are have similarities.
@author Josh Micich
reads only the range (1 {@link CellRangeAddress8Bit}) from the stream
@return true if (rowIx, colIx) is within the range ({@link #Range})
of this shared value object.
@return true if (rowIx, colIx) describes the first cell in this shared value
object's range ({@link #Range})
DOPER Structure for AutoFilter record
author: Tony Qu
get or set the RK record
Gets or sets Length of the string (the string is stored in the rgch field that follows the DOPER structures)
Whether the bBoolErr field contains a Boolean value
Whether the bBoolErr field contains a Error value
Get or sets the boolean value
Get or sets the boolean value
Title: Backup Record
Description: bool specifying whether
the GUI should store a backup of the file.
REFERENCE: PG 287 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a BackupRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Get the backup flag
@return short 0/1 (off/on)
Read an unsigned short from the stream without decrypting
Read an unsigned short from the stream without decrypting
Title: Blank cell record
Description: Represents a column in a row with no value but with styling.
REFERENCE: PG 287 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Creates a new instance of BlankRecord
Constructs a BlankRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array.
@return byte array containing instance data
Get the row this cell occurs on
@return the row
Get the column this cell defines within the row
@return the column
Set the index of the extended format record to style this cell with
@param xf - the 0-based index of the extended format
@see org.apache.poi.hssf.record.ExtendedFormatRecord
return the non static version of the id for this record.
Title: Beginning Of File
Description: Somewhat of a misnomer, its used for the beginning of a Set of
records that have a particular pupose or subject.
Used in sheets and workbooks.
REFERENCE: PG 289 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
for BIFF8 files the BOF is 0x809. For earlier versions it was 0x09 or 0x(biffversion)09
suggested default (0x06 - BIFF8)
suggested default 0x10d3
suggested default 0x07CC (1996)
suggested default for a normal sheet (0x41)
Constructs an empty BOFRecord with no fields Set.
Constructs a BOFRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Version number - for BIFF8 should be 0x06
@see #VERSION
@param version version to be Set
Set the history bit mask (not very useful)
@see #HISTORY_MASK
@param bitmask bitmask to Set for the history
Set the minimum version required to Read this file
@see #VERSION
@param version version to Set
type of object this marks
@see #TYPE_WORKBOOK
@see #TYPE_VB_MODULE
@see #TYPE_WORKSHEET
@see #TYPE_CHART
@see #TYPE_EXCEL_4_MACRO
@see #TYPE_WORKSPACE_FILE
@return short type of object
Get the build that wrote this file
@see #BUILD
@return short build number of the generator of this file
Year of the build that wrote this file
@see #BUILD_YEAR
@return short build year of the generator of this file
Title: Save External Links record (BookBool)
Description: Contains a flag specifying whether the Gui should save externally
linked values from other workbooks.
REFERENCE: PG 289 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a BookBoolRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Get the save ext links flag
@return short 0/1 (off/on)
Creates new BoolErrRecord.
REFERENCE: PG ??? Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Michael P. Harhen
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Append specific debug info (used by {@link #toString()} for the value
contained in this record. Trailing new-line should not be Appended
(superclass does that).
writes out the value data for this cell record
get the index to the ExtendedFormat
@see org.apache.poi.hssf.record.ExtendedFormatRecord
@return index to the XF record
Gets the debug info BIFF record type name (used by {@link #toString()}.
@return the size (in bytes) of the value data for this cell record
If true
, this record represents an error cell value, otherwise this record represents a boolean cell value
Creates new BoolErrRecord
Constructs a BoolErr record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Set the bool value for the cell
@param value representing the bool value
Set the error value for the cell
@param value error representing the error value
this value can only be 0,7,15,23,29,36 or 42
see bugzilla bug 16560 for an explanation
Get the value for the cell
@return bool representing the bool value
Get the error value for the cell
@return byte representing the error value
Indicates whether the call holds a boolean value
@return boolean true if the cell holds a boolean value
Indicates whether the call holds an error value
@return bool true if the cell holds an error value
Record for the bottom margin.
NOTE: This source was automatically generated.
@author Shawn Laubach (slaubach at apache dot org)
The margin interface Is a parent used to define left, right, top and bottom margins.
This allows much of the code to be generic when it comes to handling margins.
NOTE: This source wass automatically generated.
@author Shawn Laubach (slaubach at apache dot org)
Get the margin field for the Margin.
Constructs a BottomMargin record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the margin field for the BottomMargin record.
Title: Bound Sheet Record (aka BundleSheet)
Description: Defines a sheet within a workbook. Basically stores the sheetname
and tells where the Beginning of file record Is within the HSSF
file.
REFERENCE: PG 291 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Sergei Kozello (sergeikozello at mail.ru)
Constructs a BoundSheetRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Converts a List of {@link BoundSheetRecord}s to an array and sorts by the position of their
BOFs.
Get the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS file
@return offset in bytes
Is the sheet very hidden? Different from (normal) hidden
Get the sheetname for this sheet. (this appears in the tabs at the bottom)
@return sheetname the name of the sheet
Title: Calc Count Record
Description: Specifies the maximum times the gui should perform a formula
recalculation. For instance: in the case a formula includes
cells that are themselves a result of a formula and a value
Changes. This Is essentially a failsafe against an infinate
loop in the event the formulas are not independant.
REFERENCE: PG 292 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
@see org.apache.poi.hssf.record.CalcModeRecord
Constructs a CalcCountRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Get the number of iterations to perform
@return iterations
Title: Calc Mode Record
Description: Tells the gui whether to calculate formulas
automatically, manually or automatically
except for tables.
REFERENCE: PG 292 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
@see org.apache.poi.hssf.record.CalcCountRecord
manually calculate formulas (0)
automatically calculate formulas (1)
automatically calculate formulas except for tables (-1)
Constructs a CalcModeRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Set the calc mode flag for formulas
@see #MANUAL
@see #AUTOMATIC
@see #AUTOMATIC_EXCEPT_TABLES
@param calcmode one of the three flags above
Get the calc mode flag for formulas
@see #MANUAL
@see #AUTOMATIC
@see #AUTOMATIC_EXCEPT_TABLES
@return calcmode one of the three flags above
Conditional Formatting Header record (CFHEADER)
@author Dmitriy Kumshayev
Creates new CFHeaderRecord
Conditional Formatting Rule Record.
@author Dmitriy Kumshayev
Creates new CFRuleRecord
Creates a new comparison operation rule
Creates a new comparison operation rule
Creates a new comparison operation rule
@param ptgs may be null
@return encoded size of the formula
called by the class that Is responsible for writing this sucker.
Subclasses should implement this so that their data Is passed back in a
byte array.
@param offset to begin writing at
@param data byte array containing instance data
@return number of bytes written
TODO - Parse conditional format formulas properly i.e. produce tRefN and tAreaN instead of tRef and tArea
this call will produce the wrong results if the formula Contains any cell references
One approach might be to apply the inverse of SharedFormulaRecord.ConvertSharedFormulas(Stack, int, int)
Note - two extra parameters (rowIx &colIx) will be required. They probably come from one of the Region objects.
@return null if formula was null.
TODO - parse conditional format formulas properly i.e. produce tRefN and tAreaN instead of tRef and tArea
this call will produce the wrong results if the formula contains any cell references
One approach might be to apply the inverse of SharedFormulaRecord.convertSharedFormulas(Stack, int, int)
Note - two extra parameters (rowIx & colIx) will be required. They probably come from one of the Region objects.
@return null
if formula was null.
get the stack of the 1st expression as a list
@return list of tokens (casts stack to a list and returns it!)
this method can return null is we are unable to create Ptgs from
existing excel file
callers should check for null!
get the stack of the 2nd expression as a list
@return list of tokens (casts stack to a list and returns it!)
this method can return null is we are unable to create Ptgs from
existing excel file
callers should check for null!
Get the option flags
@return bit mask
Border Formatting Block of the Conditional Formatting Rule Record.
@author Dmitriy Kumshayev
Creates new FontFormatting
Get the type of border to use for the left border of the cell
Get the type of border to use for the right border of the cell
Get the type of border to use for the top border of the cell
Get the type of border to use for the bottom border of the cell
Get the type of border to use for the diagonal border of the cell
Get the color to use for the left border
Get the color to use for the right border
Get the color to use for the top border
Get the color to use for the bottom border
Get the color to use for the diagonal border
true if forward diagonal is on
true if backward diagonal Is on
@author Dmitriy Kumshayev
first range is within the second range
first range encloses or is equal to the second
Intersect this range with the specified range.
@param crB - the specified range
@return code which reflects how the specified range is related to this range.
Possible return codes are:
NO_INTERSECTION - the specified range is outside of this range;
OVERLAP - both ranges partially overlap;
INSIDE - the specified range is inside of this one
ENCLOSES - the specified range encloses (possibly exactly the same as) this range
Do all possible cell merges between cells of the list so that:
if a cell range is completely inside of another cell range, it s removed from the list
if two cells have a shared border, merge them into one bigger cell range
@param cellRangeList
@return updated List of cell ranges
@return the new range(s) to replace the supplied ones. null if no merge is possible
@param crB never a full row or full column range
@return an array including this CellRange and all parts of range
outside of this range
Check if the specified range is located inside of this cell range.
@param crB
@return true if this cell range Contains the argument range inside if it's area
Check if the specified cell range has a shared border with the current range.
@return true if the ranges have a complete shared border (i.e.
the two ranges toher make a simple rectangular region.
Create an enclosing CellRange for the two cell ranges.
@return enclosing CellRange
@return true if a < b
@return true if a <= b
@return true if a > b
@return true if a >= b
Font Formatting Block of the Conditional Formatting Rule Record.
@author Dmitriy Kumshayev
Normal boldness (not bold)
Bold boldness (bold)
Creates new FontFormatting
Gets the height of the font in 1/20th point Units
@return fontheight (in points/20); or -1 if not modified
Get whether the font Is to be italics or not
@return italics - whether the font Is italics or not
@see #GetAttributes()
Get whether the font Is to be stricken out or not
@return strike - whether the font Is stricken out or not
@see #GetAttributes()
Get or set the font weight for this font (100-1000dec or 0x64-0x3e8).
Default Is 0x190 for normal and 0x2bc for bold
Get or set whether the font weight is set to bold or not
Get the type of base or subscript for the font
@return base or subscript option
@see org.apache.poi.hssf.usermodel.HSSFFontFormatting#SS_NONE
@see org.apache.poi.hssf.usermodel.HSSFFontFormatting#SS_SUPER
@see org.apache.poi.hssf.usermodel.HSSFFontFormatting#SS_SUB
Get the type of Underlining for the font
@return font Underlining type
Pattern Formatting Block of the Conditional Formatting Rule Record.
@author Dmitriy Kumshayev
Creates new FontFormatting
Get the Fill pattern
@return Fill pattern
Get the background Fill color
@see org.apache.poi.hssf.usermodel.HSSFPalette#GetColor(short)
@return Fill color
Get the foreground Fill color
@see org.apache.poi.hssf.usermodel.HSSFPalette#GetColor(short)
@return Fill color
* The area format record is used to define the colours and patterns for an area.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a AreaFormat record and s its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
the foreground color field for the AreaFormat record.
the background color field for the AreaFormat record.
the pattern field for the AreaFormat record.
the format flags field for the AreaFormat record.
the forecolor index field for the AreaFormat record.
the backcolor index field for the AreaFormat record.
automatic formatting
@return the automatic field value.
swap foreground and background colours when data is negative
@return the invert field value.
* The area record is used to define a area chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Area record and s its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
the format flags field for the Area record.
series is stacked
@return the stacked field value.
results Displayed as percentages
@return the Display as percentage field value.
Display a shadow for the chart
@return the shadow field value.
* The axis size and location
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a AxisParent record and s its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
the axis type field for the AxisParent record.
@return One of
AXIS_TYPE_MAIN
AXIS_TYPE_SECONDARY
the x field for the AxisParent record.
the y field for the AxisParent record.
the width field for the AxisParent record.
the height field for the AxisParent record.
* The axis record defines the type of an axis.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Axis record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the axis type field for the Axis record.
@return One of
AXIS_TYPE_CATEGORY_OR_X_AXIS
AXIS_TYPE_VALUE_AXIS
AXIS_TYPE_SERIES_AXIS
Get the reserved1 field for the Axis record.
Get the reserved2 field for the Axis record.
Get the reserved3 field for the Axis record.
Get the reserved4 field for the Axis record.
* The bar record is used to define a bar chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Bar record and s its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
the bar space field for the Bar record.
the category space field for the Bar record.
the format flags field for the Bar record.
true to Display horizontal bar charts, false for vertical
@return the horizontal field value.
stack Displayed values
@return the stacked field value.
Display chart values as a percentage
@return the Display as percentage field value.
Display a shadow for the chart
@return the shadow field value.
The begin record defines the start of a block of records for a (grpahing
data object. This record is matched with a corresponding EndRecord.
@see EndRecord
@author Glen Stampoultzis (glens at apache.org)
Constructs a BeginRecord record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
CATLAB - Category Labels (0x0856)
@author Patrick Cheng
ENDBLOCK - Chart Future Record Type End Block (0x0853)
@author Patrick Cheng
ENDOBJECT - Chart Future Record Type End Object (0x0855)
@author Patrick Cheng
Class ChartFormatRecord
@author Glen Stampoultzis (glens at apache.org)
@version %I%, %G%
Constructs a ChartFormatRecord record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
The ChartFrtInfo record specifies the versions of the application that originally created and last saved the file.
* The chart record is used to define the location and size of a chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Chart record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the x field for the Chart record.
Get the y field for the Chart record.
Get the width field for the Chart record.
Get the height field for the Chart record.
STARTBLOCK - Chart Future Record Type Start Block (0x0852)
@author Patrick Cheng
STARTOBJECT - Chart Future Record Type Start Object (0x0854)
@author Patrick Cheng
The CrtLink record is written but unused.
* The data format record is used to index into a series.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a DataFormat record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the point number field for the DataFormat record.
Get the series index field for the DataFormat record.
Get the series number field for the DataFormat record.
Get the format flags field for the DataFormat record.
Set true to use excel 4 colors.
@return the use excel 4 colors field value.
DATALABEXT - Chart Data Label Extension (0x086A)
@author Patrick Cheng
* The dat record is used to store options for the chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Dat record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Sets the horizontal border field value.
has a horizontal border
has a horizontal border
@return the horizontal border field value.
Sets the vertical border field value.
has vertical border
has vertical border
@return the vertical border field value.
Sets the border field value.
data table has a border
data table has a border
@return the border field value.
Sets the show series key field value.
shows the series key
shows the series key
@return the show series key field value.
Size of record (exluding 4 byte header)
Get the options field for the Dat record.
The end record defines the end of a block of records for a (Graphing)
data object. This record is matched with a corresponding BeginRecord.
@see BeginRecord
@author Glen Stampoultzis (glens at apache.org)
Constructs a EndRecord record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
* The font basis record stores various font metrics.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a FontBasis record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the x Basis field for the FontBasis record.
Get the y Basis field for the FontBasis record.
Get the height basis field for the FontBasis record.
Get the scale field for the FontBasis record.
Get the index to font table field for the FontBasis record.
* The frame record indicates whether there is a border around the Displayed text of a chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Frame record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the border type field for the Frame record.
@return One of
BORDER_TYPE_REGULAR
BORDER_TYPE_SHADOW
Get the options field for the Frame record.
excel calculates the size automatically if true
@return the auto size field value.
excel calculates the position automatically
@return the auto position field value.
* Defines a legend for a chart.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org)
Constructs a Legend record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the x axis upper left field for the Legend record.
Get the y axis upper left field for the Legend record.
Get the x size field for the Legend record.
Get the y size field for the Legend record.
Get the type field for the Legend record.
@return One of
TYPE_BOTTOM
TYPE_CORNER
TYPE_TOP
TYPE_RIGHT
TYPE_LEFT
TYPE_UNDOCKED
Get the spacing field for the Legend record.
@return One of
SPACING_CLOSE
SPACING_MEDIUM
SPACING_OPEN
Get the options field for the Legend record.
automatic positioning (1=docked)
@return the auto position field value.
excel 5 only (true)
@return the auto series field value.
position of legend on the x axis is automatic
@return the auto x positioning field value.
position of legend on the y axis is automatic
@return the auto y positioning field value.
vertical or horizontal legend (1 or 0 respectively). Always 0 if not automatic.
@return the vertical field value.
1 if chart Contains data table
@return the data table field value.
* Describes a line format record. The line format record controls how a line on a chart appears.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a LineFormat record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the line color field for the LineFormat record.
Get the line pattern field for the LineFormat record.
@return One of
LINE_PATTERN_SOLID
LINE_PATTERN_DASH
LINE_PATTERN_DOT
LINE_PATTERN_DASH_DOT
LINE_PATTERN_DASH_DOT_DOT
LINE_PATTERN_NONE
LINE_PATTERN_DARK_GRAY_PATTERN
LINE_PATTERN_MEDIUM_GRAY_PATTERN
LINE_PATTERN_LIGHT_GRAY_PATTERN
Get the weight field for the LineFormat record.
specifies the thickness of the line.
@return One of
WEIGHT_HAIRLINE
WEIGHT_NARROW
WEIGHT_MEDIUM
WEIGHT_WIDE
Get the format field for the LineFormat record.
Get the colour palette index field for the LineFormat record.
automatic format
@return the auto field value.
draw tick marks
@return the draw ticks field value.
book marks this as reserved = 0 but it seems to do something
@return the Unknown field value.
* The number format index record indexes format table. This applies to an axis.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a NumberFormatIndex record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the format index field for the NumberFormatIndex record.
* Links text to an object on the chart or identifies it as the title.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org)
Constructs a ObjectLink record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the anchor id field for the ObjectLink record.
@return One of
ANCHOR_ID_CHART_TITLE
ANCHOR_ID_Y_AXIS
ANCHOR_ID_X_AXIS
ANCHOR_ID_SERIES_OR_POINT
ANCHOR_ID_Z_AXIS
Get the link 1 field for the ObjectLink record.
Get the link 2 field for the ObjectLink record.
* preceeds and identifies a frame as belonging to the plot area.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org)
Constructs a PlotArea record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
* The plot growth record specifies the scaling factors used when a font is scaled.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a PlotGrowth record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the horizontalScale field for the PlotGrowth record.
Get the verticalScale field for the PlotGrowth record.
pecifies positioning mode for position information saved in a Pos record.
Relative position to the chart, in points.
Absolute width and height in points. It can only be applied to the mdBotRt field of Pos.
Owner of Pos determines how to interpret the position data.
Offset to default position, in 1/1000th of the plot area size.
Relative position to the chart, in SPRC.
specifies the size and position for a legend, an attached label, or the plot area, as specified by the primary axis group.
specifies the positioning mode for the upper-left corner of a legend, an attached label, or the plot area.
specifies the positioning mode for the lower-right corner of a legend, an attached label, or the plot area
specifies a position. The meaning is specified in the earlier table showing the valid combinations mdTopLt and mdBotRt by type.
specifies a width. The meaning is specified in the earlier table showing the valid combinations mdTopLt and mdBotRt by type.
specifies a position. The meaning is specified in the earlier table showing the valid combinations mdTopLt and mdBotRt by type.
specifies a height. The meaning is specified in the earlier table showing the valid combinations mdTopLt and mdBotRt by type.
* The series chart Group index record stores the index to the CHARTFORMAT record (0 based).
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a SeriesChartGroupIndex record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the chart Group index field for the SeriesChartGroupIndex record.
* links a series to its position in the series list.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org)
Constructs a SeriesIndex record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the index field for the SeriesIndex record.
* The series label record defines the type of label associated with the data format record.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a SeriesLabels record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the format flags field for the SeriesLabels record.
show actual value of the data point
@return the show actual field value.
show value as percentage of total (pie charts only)
@return the show percent field value.
show category label/value as percentage (pie charts only)
@return the label as percentage field value.
show smooth line
@return the smoothed line field value.
Display category label
@return the show label field value.
??
@return the show bubble sizes field value.
* The series list record defines the series Displayed as an overlay to the main chart record.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a SeriesList record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the series numbers field for the SeriesList record.
* The series record describes the overall data for a series.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Series record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the category data type field for the Series record.
@return One of
CATEGORY_DATA_TYPE_DATES
CATEGORY_DATA_TYPE_NUMERIC
CATEGORY_DATA_TYPE_SEQUENCE
CATEGORY_DATA_TYPE_TEXT
Get the values data type field for the Series record.
@return One of
VALUES_DATA_TYPE_DATES
VALUES_DATA_TYPE_NUMERIC
VALUES_DATA_TYPE_SEQUENCE
VALUES_DATA_TYPE_TEXT
Get the num categories field for the Series record.
Get the num values field for the Series record.
Get the bubble series type field for the Series record.
@return One of
BUBBLE_SERIES_TYPE_DATES
BUBBLE_SERIES_TYPE_NUMERIC
BUBBLE_SERIES_TYPE_SEQUENCE
BUBBLE_SERIES_TYPE_TEXT
Get the num bubble values field for the Series record.
* Defines a series name
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org)
the actual text cannot be longer than 255 characters
Constructs a SeriesText record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the id field for the SeriesText record.
Get the text field for the SeriesText record.
* Indicates the chart-group index for a series. The order probably defines the mapping. So the 0th record probably means the 0th series. The only field in this of course defines which chart Group the 0th series (for instance) would map to. Confusing? Well thats because it Is. (p 522 BCG)
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org)
Constructs a SeriesToChartGroup record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the chart Group index field for the SeriesToChartGroup record.
Section [2.4.324]. The Text record specifies the properties of an attached label and specifies the beginning of
a collection of records as defined by the chart sheet substream ABNF. This collection of records specifies an attached label.
Left-alignment if iReadingOrder specifies left-to-right reading order; otherwise, right-alignment
Center-alignment
Right-alignment if iReadingOrder specifies left-to-right reading order; otherwise, left-alignment
Justify-alignment
distributed alignment
distributed alignment
Transparent background
Opaque background
Constructs a Text record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the horizontal alignment field for the Text record.
@return One of
HORIZONTAL_ALIGNMENT_LEFT
HORIZONTAL_ALIGNMENT_CENTER
HORIZONTAL_ALIGNMENT_BOTTOM
HORIZONTAL_ALIGNMENT_JUSTIFY
Get the vertical alignment field for the Text record.
@return One of
VERTICAL_ALIGNMENT_TOP
VERTICAL_ALIGNMENT_CENTER
VERTICAL_ALIGNMENT_BOTTOM
VERTICAL_ALIGNMENT_JUSTIFY
Get the Display mode field for the Text record.
@return One of
DISPLAY_MODE_TRANSPARENT
DISPLAY_MODE_OPAQUE
Get the rgbColor field for the Text record.
Get the x field for the Text record.
Get the y field for the Text record.
Set the width field for the Text record.
Get the height field for the Text record.
Get the options1 field for the Text record.
Get the index of color value field for the Text record.
Get the options2 field for the Text record.
Get the text rotation field for the Text record.
true = automaticly selected colour, false = user-selected
@return the auto color field value.
true = draw legend
@return the show key field value.
false = text is category label
@return the show value field value.
@return the auto generated text field value.
@return the generated field value.
@return the auto label deleted field value.
@return the auto background field value.
@return the show category label as percentage field value.
@return the show value as percentage field value.
@return the show bubble sizes field value.
@return the show label field value.
@return the data label placement field value.
* The Tick record defines how tick marks and label positioning/formatting
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver(acoliver at apache.org)
Constructs a Tick record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the major tick type field for the Tick record.
Get the minor tick type field for the Tick record.
Get the label position field for the Tick record.
Get the background field for the Tick record.
Get the label color rgb field for the Tick record.
Get the zero 1 field for the Tick record.
Get the zero 2 field for the Tick record.
Get the options field for the Tick record.
Get the tick color field for the Tick record.
Get the zero 3 field for the Tick record.
use the quote Unquote automatic color for text
@return the auto text color field value.
use the quote Unquote automatic color for text background
@return the auto text background field value.
rotate text (0=none, 1=normal, 2=90 degrees counterclockwise, 3=90 degrees clockwise)
@return the rotation field value.
automatically rotate the text
@return the autorotate field value.
* The Units record describes Units.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Units record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the Units field for the Units record.
* The value range record defines the range of the value axis.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a ValueRange record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the minimum axis value field for the ValueRange record.
Get the maximum axis value field for the ValueRange record.
Get the major increment field for the ValueRange record.
Get the minor increment field for the ValueRange record.
Get the category axis cross field for the ValueRange record.
Get the options field for the ValueRange record.
automatic minimum value selected
@return the automatic minimum field value.
automatic maximum value selected
@return the automatic maximum field value.
automatic major Unit selected
@return the automatic major field value.
automatic minor Unit selected
@return the automatic minor field value.
category crossing point is automatically selected
@return the automatic category crossing field value.
use logarithmic scale
@return the logarithmic scale field value.
values are reverses in graph
@return the values in reverse field value.
category axis to cross at maximum value
@return the cross category axis at maximum field value.
reserved, must equal 1 (excel dev. guide says otherwise)
@return the reserved field value.
Title: Codepage Record
Description: the default CharSet. for the workbook
REFERENCE: PG 293 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
the likely correct value for CODEPAGE (at least for US versions). We could use
some help with international versions (which we do not have access to documentation
for)
Constructs a CodepageRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Get the codepage for this workbook
@see #CODEPAGE
@return codepage - the codepage to Set
Title: COLINFO Record
Description: Defines with width and formatting for a range of columns
REFERENCE: PG 293 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a ColumnInfo record and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
@return true if the format, options and column width match
Get the first column this record defines formatting info for
@return the first column index (0-based)
Get the last column this record defines formatting info for
@return the last column index (0-based)
Get the columns' width in 1/256 of a Char width
@return column width
Get the columns' default format info
@return the extended format index
@see org.apache.poi.hssf.record.ExtendedFormatRecord
Get the options bitfield - use the bitSetters instead
@return the bitfield raw value
Get whether or not these cells are hidden
@return whether the cells are hidden.
@see #SetOptions(short)
Get the outline level for the cells
@see #SetOptions(short)
@return outline level for the cells
Get whether the cells are collapsed
@return wether the cells are collapsed
@see #SetOptions(short)
Class POIFSWriterEvent
@author Marc Johnson (mjohnson at apache dot org)
@version %I%, %G%
namespace scoped constructor
@param stream the DocumentOutputStream, freshly opened
@param path the path of the document
@param documentName the name of the document
@param limit the limit, in bytes, that can be written to the
stream
@return the DocumentOutputStream, freshly opened
@return the document's path
@return the document's name
@return the limit on writing, in bytes
EventArgs for POIFSWriter
author: Tony Qu
Initializes a new instance of the class.
the POIFSDocumentWriter, freshly opened
the path of the document
the name of the document
the limit, in bytes, that can be written to the stream
Gets the limit on writing, in bytes
The limit.
Gets the document's name
The name.
Gets the document's path
The path.
the POIFSDocumentWriter, freshly opened
The stream.
Interface POIFSWriterListener
@author Marc Johnson (mjohnson at apache dot org)
@version %I%, %G%
Process a POIFSWriterEvent that this listener had registered
for
@param event the POIFSWriterEvent
This abstract class describes a way to read, store, chain
and free a series of blocks (be they Big or Small ones)
Returns the size of the blocks managed through the block store.
Load the block at the given offset.
Extends the file if required to hold blocks up to
the specified offset, and return the block from there.
Returns the BATBlock that handles the specified offset,
and the relative index within it
Works out what block follows the specified one.
Changes the record of what block follows the specified one.
Finds a free block, and returns its offset.
This method will extend the file/stream if needed, and if doing
so, allocate new FAT blocks to address the extra space.
Creates a Detector for loops in the chain
Used to detect if a chain has a loop in it, so
we can bail out with an error rather than
spinning away for ever...
This class provides methods to read a DocumentEntry managed by a
{@link POIFSFileSystem} or {@link NPOIFSFileSystem} instance.
It Creates the appropriate one, and delegates, allowing us to
work transparently with the two.
returned by read operations if we're at end of document
For use by downstream implementations
Create an InputStream from the specified DocumentEntry
@param document the DocumentEntry to be read
@exception IOException if the DocumentEntry cannot be opened (like, maybe it has
been deleted?)
Create an InputStream from the specified Document
@param document the Document to be read
Create an InputStream from the specified Document
@param document the Document to be read
Tests if this input stream supports the mark and reset methods.
@return true
always
Repositions this stream to the position at the time the mark() method was
last called on this input stream. If mark() has not been called this
method repositions the stream to its beginning.
This class provides a wrapper over an OutputStream so that Document
Writers can't accidently go over their size limits
@author Marc Johnson (mjohnson at apache dot org)
Create a DocumentOutputStream
@param stream the OutputStream to which the data is actually
read
@param limit the maximum number of bytes that can be written
Writes the specified byte to this output stream. The general
contract for write is that one byte is written to the output
stream. The byte to be written is the eight low-order bits of
the argument b. The 24 high-order bits of b are ignored.
@param b the byte.
@exception IOException if an I/O error occurs. In particular,
an IOException may be thrown if the
output stream has been closed, or if the
Writer tries to write too much data.
Writes b.Length bytes from the specified byte array
to this output stream.
@param b the data.
@exception IOException if an I/O error occurs.
Writes len bytes from the specified byte array starting at
offset off to this output stream. The general contract for
Write(b, off, len) is that some of the bytes in the array b are
written to the output stream in order; element b[off] is the
first byte written and b[off+len-1] is the last byte written by
this operation.
the data.
the start offset in the data.
the number of bytes to Write.
Flushes this output stream and forces any buffered output bytes to be written out
Closes this output stream and releases any system resources
associated with this stream. The general contract of close is
that it closes the output stream. A closed stream cannot
perform output operations and cannot be reopened.
@exception IOException if an I/O error occurs.
write the rest of the document's data (fill in at the end)
@param totalLimit the actual number of bytes the corresponding
document must fill
@param fill the byte to fill remaining space with
@exception IOException on I/O error
This class provides methods to read a DocumentEntry managed by a
{@link NPOIFSFileSystem} instance.
current offset into the Document
current block count
current marked offset into the Document (used by mark and Reset)
and the block count for it
the Document's size
have we been closed?
the actual Document
Create an InputStream from the specified DocumentEntry
@param document the DocumentEntry to be read
@exception IOException if the DocumentEntry cannot be opened (like, maybe it has
been deleted?)
Create an InputStream from the specified Document
@param document the Document to be read
Repositions this stream to the position at the time the mark() method was
last called on this input stream. If mark() has not been called this
method repositions the stream to its beginning.
This class manages a document in the NIO POIFS filesystem.
This is the {@link NPOIFSFileSystem} version.
Interface for a drill-down viewable object. Such an object has
content that may or may not be displayed, at the discretion of the
viewer. The content is returned to the viewer as an array or as an
Iterator, and the object provides a clue as to which technique the
viewer should use to get its content.
A POIFSViewable object is also expected to provide a short
description of itself, that can be used by a viewer when the
viewable object is collapsed.
@author Marc Johnson (mjohnson at apache dot org)
Provides a short description of the object to be used when a
POIFSViewable object has not provided its contents.
true if [prefer array]; otherwise, false.
Gets the short description.
The short description.
Get an array of objects, some of which may implement POIFSViewable
The viewable array.
Give viewers a hint as to whether to call ViewableArray or ViewableIterator
The viewable iterator.
Constructor for an existing Document
Constructor for a new Document
@param name the name of the POIFSDocument
@param stream the InputStream we read data from
Get an array of objects, some of which may implement POIFSViewable
@return an array of Object; may not be null, but may be empty
Get an Iterator of objects, some of which may implement POIFSViewable
@return an Iterator; may not be null, but may have an empty back end
store
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
@return short description
@return size of the document
@return the instance's DocumentProperty
This is the main class of the POIFS system; it manages the entire
life cycle of the filesystem.
This is the new NIO version
Convenience method for clients that want to avoid the auto-close behaviour of the constructor.
What big block size the file uses. Most files
use 512 bytes, but a few use 4096
Constructor, intended for writing
Create a POIFSFileSystem from an InputStream. Normally the stream is read until
EOF. The stream is always closed.
Some streams are usable After reaching EOF (typically those that return true
for markSupported()). In the unlikely case that the caller has such a stream
and needs to use it After this constructor completes, a work around is to wrap the
stream in order to trap the close() call. A convenience method (
CreateNonClosingInputStream()) has been provided for this purpose:
InputStream wrappedStream = POIFSFileSystem.CreateNonClosingInputStream(is);
HSSFWorkbook wb = new HSSFWorkbook(wrappedStream);
is.Reset();
doSomethingElse(is);
Note also the special case of MemoryStream for which the close()
method does nothing.
MemoryStream bais = ...
HSSFWorkbook wb = new HSSFWorkbook(bais); // calls bais.Close() !
bais.Reset(); // no problem
doSomethingElse(bais);
@param stream the InputStream from which to read the data
@exception IOException on errors Reading, or on invalid data
@param stream the stream to be closed
@param success false
if an exception is currently being thrown in the calling method
Read and process the PropertiesTable and the
FAT / XFAT blocks, so that we're Ready to
work with the file
Load the block at the given offset.
Load the block at the given offset,
extending the file if needed
Returns the BATBlock that handles the specified offset,
and the relative index within it
Works out what block follows the specified one.
Changes the record of what block follows the specified one.
Finds a free block, and returns its offset.
This method will extend the file if needed, and if doing
so, allocate new FAT blocks to Address the extra space.
Returns the MiniStore, which performs a similar low
level function to this, except for the small blocks.
add a new POIFSDocument to the FileSytem
@param document the POIFSDocument being Added
add a new DirectoryProperty to the FileSystem
@param directory the DirectoryProperty being Added
Create a new document to be Added to the root directory
@param stream the InputStream from which the document's data
will be obtained
@param name the name of the new POIFSDocument
@return the new DocumentEntry
@exception IOException on error creating the new POIFSDocument
create a new DocumentEntry in the root entry; the data will be
provided later
@param name the name of the new DocumentEntry
@param size the size of the new DocumentEntry
@param Writer the Writer of the new DocumentEntry
@return the new DocumentEntry
@exception IOException
create a new DirectoryEntry in the root directory
@param name the name of the new DirectoryEntry
@return the new DirectoryEntry
@exception IOException on name duplication
Write the filesystem out to the open file. Will thrown an
{@link ArgumentException} if opened from an
{@link InputStream}.
@exception IOException thrown on errors writing to the stream
Write the filesystem out
@param stream the OutputStream to which the filesystem will be
written
@exception IOException thrown on errors writing to the stream
Has our in-memory objects write their state
to their backing blocks
Closes the FileSystem, freeing any underlying files, streams
and buffers. After this, you will be unable to read or
write from the FileSystem.
open a document in the root entry's list of entries
@param documentName the name of the document to be opened
@return a newly opened DocumentInputStream
@exception IOException if the document does not exist or the
name is that of a DirectoryEntry
remove an entry
@param entry to be Removed
Get an array of objects, some of which may implement
POIFSViewable
@return an array of Object; may not be null, but may be empty
Get an Iterator of objects, some of which may implement
POIFSViewable
@return an Iterator; may not be null, but may have an empty
back end store
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
@return short description
@return The Big Block size, normally 512 bytes, sometimes 4096 bytes
@return The Big Block size, normally 512 bytes, sometimes 4096 bytes
For unit Testing only! Returns the underlying
properties table
Get the root entry
@return the root entry
This class handles the MiniStream (small block store)
in the NIO case for {@link NPOIFSFileSystem}
Load the block at the given offset.
Load the block, extending the underlying stream if needed
Returns the BATBlock that handles the specified offset,
and the relative index within it
Works out what block follows the specified one.
Changes the record of what block follows the specified one.
Finds a free block, and returns its offset.
This method will extend the file if needed, and if doing
so, allocate new FAT blocks to Address the extra space.
Writes the SBATs to their backing blocks
This handles Reading and writing a stream within a
{@link NPOIFSFileSystem}. It can supply an iterator
to read blocks, and way to write out to existing and
new blocks.
Most users will want a higher level version of this,
which deals with properties to track which stream
this is.
This only works on big block streams, it doesn't
handle small block ones.
This uses the new NIO code
TODO Implement a streaming write method, and append
Constructor for an existing stream. It's up to you
to know how to Get the start block (eg from a
{@link HeaderBlock} or a {@link Property})
Constructor for a new stream. A start block won't
be allocated until you begin writing to it.
What block does this stream start at?
Will be {@link POIFSConstants#END_OF_CHAIN} for a
new stream that hasn't been written to yet.
Returns an iterator that'll supply one {@link ByteBuffer}
per block in the stream.
Updates the contents of the stream to the new
Set of bytes.
Note - if this is property based, you'll still
need to update the size in the property yourself
Frees all blocks in the stream
This class provides methods to read a DocumentEntry managed by a
{@link POIFSFileSystem} instance.
@author Marc Johnson (mjohnson at apache dot org)
current offset into the Document
current marked offset into the Document (used by mark and Reset)
the Document's size
have we been closed?
the actual Document
the data block Containing the current stream pointer
Create an InputStream from the specified DocumentEntry
@param document the DocumentEntry to be read
@exception IOException if the DocumentEntry cannot be opened (like, maybe it has
been deleted?)
Create an InputStream from the specified Document
@param document the Document to be read
Repositions this stream to the position at the time the mark() method was
last called on this input stream. If mark() has not been called this
method repositions the stream to its beginning.
This class manages a document in the POIFS filesystem.
@author Marc Johnson (mjohnson at apache dot org)
This interface defines behaviors for objects managed by the Block
Allocation Table (BAT).
@author Marc Johnson (mjohnson at apache dot org)
Gets the number of BigBlock's this instance uses
count of BigBlock instances
Sets the start block for this instance
index into the array of BigBlock instances making up the the filesystem
An interface for persisting block storage of POIFS components.
@author Marc Johnson (mjohnson at apache dot org)
Writes the blocks.
The stream.
Initializes a new instance of the class.
the name of the POIFSDocument
the InputStream we read data from
Constructor from small blocks
the name of the POIFSDocument
the small blocks making up the POIFSDocument
the actual length of the POIFSDocument
read data from the internal stores
the buffer to write to
the offset into our storage to read from
Writes the blocks.
The stream.
Gets the number of BigBlock's this instance uses
count of BigBlock instances
Gets the document property.
The document property.
Provides a short description of the object to be used when a
POIFSViewable object has not provided its contents.
true if [prefer array]; otherwise, false.
Gets the short description.
The short description.
Gets the size.
The size.
Gets the small blocks.
The small blocks.
Sets the start block for this instance
index into the array of BigBlock instances making up the the filesystem
Get an array of objects, some of which may implement POIFSViewable
The viewable array.
Give viewers a hint as to whether to call ViewableArray or ViewableIterator
The viewable iterator.
A POIFS backed by a byte array.
Common definition of how we read and write bytes
Close the underlying stream
Copies the contents to the specified Stream
A POIFS DataSource backed by a File
Reads a sequence of bytes from this FileStream starting at the given file position.
The file position at which the transfer is to begin;
Writes a sequence of bytes to this FileStream from the given Stream,
starting at the given file position.
The Stream from which bytes are to be transferred
The file position at which the transfer is to begin;
must be non-negative
The block containing the archive header
@author Marc Johnson (mjohnson at apache dot org)
Constants used in reading/writing the Header block
@author Marc Johnson (mjohnson at apache dot org)
What big block Size the file uses. Most files
use 512 bytes, but a few use 4096
Number of small block allocation table blocks (int)
(Number of MiniFAT Sectors in Microsoft parlance)
create a new HeaderBlockReader from an Stream
the source Stream
Alerts the short read.
The read.
The expected size.
Get start of Property Table
the index of the first block of the Property Table
Gets start of small block allocation table
The SBAT start.
Gets number of BAT blocks
The BAT count.
Gets the BAT array.
The BAT array.
Gets the XBAT count.
The XBAT count.
@return XBAT count
Gets the index of the XBAT.
The index of the XBAT.
Gets The Big Block Size, normally 512 bytes, sometimes 4096 bytes
The size of the big block.
@return
Common interface for Excel text extractors, covering
HSSF and XSSF
Should sheet names be included? Default is true
Should we return the formula itself, and not
the result it produces? Default is false
Should cell comments be included? Default is false
Retreives the text contents of the file
Formats a date value.
@author Ken Arnold, Industrious Media LLC
This is the abstract supertype for the various cell formatters.
@author Ken Arnold, Industrious Media LLC
The original specified format.
This is the locale used to Get a consistent format result from which to
work.
Creates a new formatter object, storing the format in {@link #format}.
@param format The format.
Format a value according the format string.
@param toAppendTo The buffer to append to.
@param value The value to format.
Format a value according to the type, in the most basic way.
@param toAppendTo The buffer to append to.
@param value The value to format.
Formats the value, returning the resulting string.
@param value The value to format.
@return The value, formatted.
Formats the value in the most basic way, returning the resulting string.
@param value The value to format.
@return The value, formatted.
Returns the input string, surrounded by quotes.
@param str The string to quote.
@return The input string, surrounded by quotes.
Creates a new date formatter with the given specification.
@param format The format.
{@inheritDoc}
{@inheritDoc}
For a date, this is "mm/d/y".
Objects of this class represent a single part of a cell format expression.
Each cell can have up to four of these for positive, zero, negative, and text
values.
Each format part can contain a color, a condition, and will always contain a
format specification. For example "[Red][>=10]#" has a color
([Red]), a condition (>=10) and a format specification
(#).
This class also Contains patterns for matching the subparts of format
specification. These are used internally, but are made public in case other
code has use for them.
@author Ken Arnold, Industrious Media LLC
Pattern for the color part of a cell format part.
Pattern for the condition part of a cell format part.
Pattern for the format specification part of a cell format part.
Pattern for an entire cell single part.
Within {@link #FORMAT_PAT}, the group number for the matched color.
Within {@link #FORMAT_PAT}, the group number for the operator in the
condition.
Within {@link #FORMAT_PAT}, the group number for the value in the
condition.
Within {@link #FORMAT_PAT}, the group number for the format
specification.
Create an object to represent a format part.
@param desc The string to Parse.
Returns true if this format part applies to the given value. If
the value is a number and this is part has a condition, returns
true only if the number passes the condition. Otherwise, this
allways return true.
@param valueObject The value to Evaluate.
@return true if this format part applies to the given value.
Returns the number of the first group that is the same as the marker
string. The search starts with group 1.
@param pat The pattern to use.
@param str The string to match against the pattern.
@param marker The marker value to find the group of.
@return The matching group number.
@throws ArgumentException No group matches the marker.
Returns the color specification from the matcher, or null if
there is none.
@param m The matcher for the format part.
@return The color specification or null.
Returns the condition specification from the matcher, or null if
there is none.
@param m The matcher for the format part.
@return The condition specification or null.
Returns the CellFormatType object implied by the format specification for
the format part.
@param matcher The matcher for the format part.
@return The CellFormatType.
Returns the formatter object implied by the format specification for the
format part.
@param matcher The matcher for the format part.
@return The formatter.
Returns the type of format.
@param fdesc The format specification
@return The type of format.
Returns a version of the original string that has any special characters
quoted (or escaped) as appropriate for the cell format type. The format
type object is queried to see what is special.
@param repl The original string.
@param type The format type representation object.
@return A version of the string with any special characters Replaced.
@see CellFormatType#isSpecial(char)
Apply this format part to the given value. This returns a {@link
CellFormatResult} object with the results.
@param value The value to apply this format part to.
@return A {@link CellFormatResult} object Containing the results of
Applying the format to the value.
Apply this format part to the given value, Applying the result to the
given label.
@param label The label
@param value The value to apply this format part to.
@return true if the
Expands a character. This is only partly done, because we don't have the
correct info. In Excel, this would be expanded to fill the rest of the
cell, but we don't know, in general, what the "rest of the cell" is1.
@param part The character to be repeated is the second character in this
string.
@return The character repeated three times.
Returns the string from the group, or "" if the group is
null.
@param m The matcher.
@param g The group number.
@return The group or "".
Returns the CellFormatType object implied by the format specification for
the format part.
@return The CellFormatType.
Returns true if this format part has a condition.
@return true if this format part has a condition.
This class : printing out an elapsed time format.
@author Ken Arnold, Industrious Media LLC
Creates a elapsed time formatter.
@param pattern The pattern to Parse.
{@inheritDoc}
{@inheritDoc}
For a date, this is "mm/d/y".
Format a value according to the standard Excel behavior. This "standard" is
not explicitly documented by Microsoft, so the behavior is determined by
experimentation; see the tests.
An Excel format has up to four parts, Separated by semicolons. Each part
specifies what to do with particular kinds of values, depending on the number
of parts given:
- One part (example: [Green]#.##)
If the value is a number, display according to this one part (example: green text,
with up to two decimal points). If the value is text, display it as is.
- Two parts (example: [Green]#.##;[Red]#.##)
If the value is a positive number or zero, display according to the first part (example: green
text, with up to two decimal points); if it is a negative number, display
according to the second part (example: red text, with up to two decimal
points). If the value is text, display it as is.
- Three parts (example: [Green]#.##;[Black]#.##;[Red]#.##)
If the value is a positive number, display according to the first part (example: green text, with up to
two decimal points); if it is zero, display according to the second part
(example: black text, with up to two decimal points); if it is a negative
number, display according to the third part (example: red text, with up to
two decimal points). If the value is text, display it as is.
- Four parts (example: [Green]#.##;[Black]#.##;[Red]#.##;[@])
If the value is a positive number, display according to the first part (example: green text,
with up to two decimal points); if it is zero, display according to the
second part (example: black text, with up to two decimal points); if it is a
negative number, display according to the third part (example: red text, with
up to two decimal points). If the value is text, display according to the
fourth part (example: text in the cell's usual color, with the text value
surround by brackets).
In Addition to these, there is a general format that is used when no format
is specified. This formatting is presented by the {@link #GENERAL_FORMAT}
object.
@author Ken Arnold, Industrious Media LLC
Maps a format string to its Parsed version for efficiencies sake.
Returns a {@link CellFormat} that applies the given format. Two calls
with the same format may or may not return the same object.
@param format The format.
@return A {@link CellFormat} that applies the given format.
Creates a new object.
@param format The format.
Returns the result of Applying the format to the given value. If the
value is a number (a type of {@link Number} object), the correct number
format type is chosen; otherwise it is considered a text object.
@param value The value
@return The result, in a {@link CellFormatResult}.
Returns the result of applying the format to the given date.
@param date The date.
@param numericValue The numeric value for the date.
@return The result, in a {@link CellFormatResult}.
Fetches the appropriate value from the cell, and returns the result of
Applying it to the appropriate format. For formula cells, the computed
value is what is used.
@param c The cell.
@return The result, in a {@link CellFormatResult}.
Uses the result of Applying this format to the value, Setting the text
and color of a label before returning the result.
@param label The label to apply to.
@param value The value to Process.
@return The result, in a {@link CellFormatResult}.
Uses the result of applying this format to the given date, setting the text
and color of a label before returning the result.
@param label The label to apply to.
@param date The date.
@param numericValue The numeric value for the date.
@return The result, in a {@link CellFormatResult}.
Fetches the appropriate value from the cell, and uses the result, Setting
the text and color of a label before returning the result.
@param label The label to apply to.
@param c The cell.
@return The result, in a {@link CellFormatResult}.
Returns the {@link CellFormatPart} that applies to the value. Result
depends on how many parts the cell format has, the cell value and any
conditions. The value must be a {@link Number}.
@param value The value.
@return The {@link CellFormatPart} that applies to the value.
Returns the ultimate cell type, following the results of formulas. If
the cell is a {@link Cell#CELL_TYPE_FORMULA}, this returns the result of
{@link Cell#getCachedFormulaResultType()}. Otherwise this returns the
result of {@link Cell#getCellType()}.
@param cell The cell.
@return The ultimate type of this cell.
Returns true if the other object is a {@link CellFormat} object
with the same format.
@param obj The other object.
@return true if the two objects are Equal.
Returns a hash code for the format.
@return A hash code for the format.
Format a value as it would be were no format specified. This is also
used when the format specified is General.
This object represents a condition in a cell format.
@author Ken Arnold, Industrious Media LLC
Returns an instance of a condition object.
@param opString The operator as a string. One of "<",
"<=", ">", ">=",
"=", "==", "!=", or
"<>".
@param constStr The constant (such as "12").
@return A condition object for the given condition.
Returns true if the given value passes the constraint's test.
@param value The value to compare against.
@return true if the given value passes the constraint's test.
This object Contains the result of Applying a cell format or cell format part
to a value.
@author Ken Arnold, Industrious Media LLC
@see CellFormatPart#Apply(Object)
@see CellFormat#Apply(Object)
Creates a new format result object.
@param applies The value for {@link #applies}.
@param text The value for {@link #text}.
@param textColor The value for {@link #textColor}.
This is true if no condition was given that applied to the
value, or if the condition is satisfied. If a condition is relevant, and
when applied the value fails the test, this is false.
The resulting text. This will never be null.
The color the format Sets, or null if the format Sets no color.
This will always be null if {@link #applies} is false.
The different kinds of formats that the formatter understands.
@author Ken Arnold, Industrious Media LLC
The general (default) format; also used for "General".
A numeric format.
A date format.
An elapsed time format.
A text format.
Returns true if the format is special and needs to be quoted.
@param ch The character to test.
@return true if the format is special and needs to be quoted.
Returns a new formatter of the appropriate type, for the given pattern.
The pattern must be appropriate for the type.
@param pattern The pattern to use.
@return A new formatter of the appropriate type, for the given pattern.
A formatter for the default "General" cell format.
@author Ken Arnold, Industrious Media LLC
Creates a new general formatter.
The general style is not quite the same as any other, or any combination
of others.
@param toAppendTo The buffer to append to.
@param value The value to format.
Equivalent to {@link #formatValue(StringBuilder,Object)}. {@inheritDoc}.
This class : printing out a value using a number format.
@author Ken Arnold, Industrious Media LLC
Creates a new cell number formatter.
@param format The format to Parse.
{@inheritDoc}
{@inheritDoc}
For a number, this is "#" for integer values, and "#.#"
for floating-point values.
The CellNumberFormatter.simpleValue() method uses the SIMPLE_NUMBER
CellFormatter defined here. The CellFormat.GENERAL_FORMAT CellFormat
no longer uses the SIMPLE_NUMBER CellFormatter.
Note that the simpleValue()/SIMPLE_NUMBER CellFormatter format
("#" for integer values, and "#.#" for floating-point values) is
different from the 'General' format for numbers ("#" for integer
values and "#.#########" for floating-point values).
This class is used to mark where the special characters in the format
are, as opposed to the other characters that are simply printed.
This class represents a single modification to a result string. The way
this works is complicated, but so is numeric formatting. In general, for
most formats, we use a DecimalFormat object that will Put the string out
in a known format, usually with all possible leading and trailing zeros.
We then walk through the result and the orginal format, and note any
modifications that need to be made. Finally, we go through and apply
them all, dealing with overlapping modifications.
Based on org.apache.Commons.math.fraction.Fraction from Apache Commons-Math.
YK: The only reason of having this inner class is to avoid dependency on the Commons-Math jar.
The denominator.
The numerator.
Create a fraction given the double value and either the maximum error
allowed or the maximum number of denominator digits.
@param value the double value to convert to a fraction.
@param epsilon maximum error allowed. The resulting fraction is within
epsilon
of value
, in absolute terms.
@param maxDenominator maximum denominator value allowed.
@param maxIterations maximum number of convergents
@throws Exception if the continued fraction failed to
converge.
Create a fraction given the double value and maximum denominator.
References:
@param value the double value to convert to a fraction.
@param maxDenominator The maximum allowed value for denominator
@throws Exception if the continued fraction failed to
converge
Access the denominator.
@return the denominator.
Access the numerator.
@return the numerator.
This class : printing out text.
@author Ken Arnold, Industrious Media LLC
{@inheritDoc}
{@inheritDoc}
For text, this is just printing the text.
Implementation of Excel 'Analysis ToolPak' function EDATE()
Adds a specified number of months to the specified date.
Syntax
EDATE(date, number)
@author Tomas Herceg
To support Constant Values (2.5.7) as required by the CRN record.
This class is also used for two dimensional arrays which are encoded by
EXTERNALNAME (5.39) records and Array tokens.
@author Josh Micich
@return encoded size without the 'type' code byte
Represents a constant error code value as encoded in a constant values array.
This class is a type-safe wrapper for a 16-bit int value performing a similar job to
ErrorEval
@author Josh Micich
Initializes a new instance of the class.
The error code.
Values the of.
The error code.
Returns a that represents the current .
A that represents the current .
Gets the error code.
The error code.
Gets the text.
The text.
Title: Continue Record - Helper class used primarily for SST Records
Description: handles overflow for prior record in the input
stream; content Is tailored to that prior record
@author Marc Johnson (mjohnson at apache dot org)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Csaba Nagy (ncsaba at yahoo dot com)
@version 2.0-pre
default constructor
Main constructor -- kinda dummy because we don't validate or fill fields
@param in the RecordInputstream to Read the record from
Writes the full encoding of a Continue record without making an instance
@param initialDataByte (optional - often used for unicode flag).
If supplied, this will be written before srcData
@return the total number of bytes written
Debugging toString
@return string representation
Clone this record.
Get the data for continuation
@return byte array containing all of the continued data
Common superclass of all records that can produce {@link ContinueRecord}s while being Serialized.
@author Josh Micich
Serializes this record's content to the supplied data output.
The standard BIFF header (ushort sid, ushort size) has been handled by the superclass, so
only BIFF data should be written by this method. Simple data types can be written with the
standard {@link LittleEndianOutput} methods. Methods from {@link ContinuableRecordOutput}
can be used to Serialize strings (with {@link ContinueRecord}s being written as required).
If necessary, implementors can explicitly start {@link ContinueRecord}s (regardless of the
amount of remaining space).
@param out a data output stream
@return the total Length of the encoded record(s)
(Note - if any {@link ContinueRecord} is required, this result includes the
size of those too)
An augmented {@link LittleEndianOutput} used for serialization of {@link ContinuableRecord}s.
This class keeps track of how much remaining space is available in the current BIFF record and
can start new {@link ContinueRecord}s as required.
@author Josh Micich
@author Josh Micich
Terminates the last record (also updates its 'ushort size' field)
Terminates the current record and starts a new {@link ContinueRecord} (regardless
of how much space is still available in the current record).
Writes the 'optionFlags' byte and encoded character data of a unicode string. This includes:
- byte optionFlags
- encoded character data (in "ISO-8859-1" or "UTF-16LE" encoding)
Notes:
- The value of the 'is16bitEncoded' flag is determined by the actual character data
of text
- The string options flag is never separated (by a {@link ContinueRecord}) from the
first chunk of character data it refers to.
- The 'ushort Length' field is assumed to have been explicitly written earlier. Hence,
there may be an intervening {@link ContinueRecord}
Writes a unicode string complete with header and character data. This includes:
- ushort Length
- byte optionFlags
- ushort numberOfRichTextRuns (optional)
- ushort extendedDataSize (optional)
- encoded character data (in "ISO-8859-1" or "UTF-16LE" encoding)
The following bits of the 'optionFlags' byte will be set as appropriate:
Mask | Description |
0x01 | is16bitEncoded |
0x04 | hasExtendedData |
0x08 | isRichText |
Notes:
- The value of the 'is16bitEncoded' flag is determined by the actual character data
of text
- The string header fields are never separated (by a {@link ContinueRecord}) from the
first chunk of character data (i.e. the first character is always encoded in the same
record as the string header).
**
@return total number of bytes written so far (including all BIFF headers)
@return number of remaining bytes of space in current record
Implementors of this interface allow client code to 'delay' writing to a certain section of a
data output stream.
A typical application is for writing BIFF records when the size is not known until well after
the header has been written. The client code can call
to reserve two bytes of the output for the 'ushort size' header field. The delayed output can
be written at any stage.
@author Josh Micich
Creates an output stream intended for outputting a sequence of size bytes.
Allows the writing of BIFF records when the 'ushort size' header field is not known in advance.
When the client is finished writing data, it calls {@link #terminate()}, at which point this
class updates the 'ushort size' with its value.
@author Josh Micich
for writing the 'ushort size' field once its value is known
Finishes writing the current record and updates 'ushort size' field.
After this method is called, only {@link #getTotalSize()} may be called.
includes 4 byte header
Title: Country Record (aka WIN.INI country)
Description: used for localization. Currently HSSF always Sets this to 1
and it seems to work fine even in Germany. (es geht's auch fuer Deutschland)
REFERENCE: PG 298 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a CountryRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
Gets the default country
@return country ID (1 = US)
Gets the current country
@return country ID (1 = US)
XCT ?CRN Count
REFERENCE: 5.114
@author Josh Micich
return the non static version of the id for this record.
Title: CRN
Description: This record stores the contents of an external cell or cell range
REFERENCE: 5.23
@author josh micich
return the non static version of the id for this record.
@author Josh Micich
Reads an unsigned short value without decrypting
Reads an unsigned short value without decrypting
Create using the default password and a specified docId
@param docId 16 bytes
@return true if the keyDigest is compatible with the specified saltData and saltHash
The {@link RC4} instance needs to be Changed every 1024 bytes.
@param keyBlockNo used to seed the newly Created {@link RC4}
Stores the BIFF8 encryption/decryption password for the current thread. This has been done
using a {@link ThreadLocal} in order to avoid further overloading the various public APIs
(e.g. {@link HSSFWorkbook}) that need this functionality.
@return the BIFF8 encryption/decryption password for the current thread.
null
if it is currently unSet.
Used for both encrypting and decrypting BIFF8 streams. The internal
{@link RC4} instance is renewed (re-keyed) every 1024 bytes.
@author Josh Micich
This field is used to keep track of when to change the {@link RC4}
instance. The change occurs every 1024 bytes. Every byte passed over is
counted.
TODO: Additionally, the lbPlyPos (position_of_BOF) field of the BoundSheet8 record MUST NOT be encrypted.
@return true if record type specified by sid is never encrypted
Used when BIFF header fields (sid, size) are being Read. The internal
{@link RC4} instance must step even when unencrypted bytes are read
Simple implementation of the alleged RC4 algorithm.
Inspired by wikipedia's RC4 article
@author Josh Micich
Populates this fields data from the byte array passed in1.
@param in the RecordInputstream to Read the record from
Appends the string representation of this field to the supplied
StringBuilder.
@param str The string buffer to Append to.
Converts this field to it's byte array form.
@param offset The offset into the byte array to start writing to.
@param data The data array to Write to.
@return The number of bytes written.
@return The size of this field in bytes. This operation Is not valid
Until after the call to FillField()
Title: Date Window 1904 Flag record
Description: Flag specifying whether 1904 date windowing Is used.
(tick toc tick toc...BOOM!)
REFERENCE: PG 280 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a DateWindow1904 record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Gets whether or not to use 1904 date windowing (which means you'll be screwed in 2004)
@return window flag - 0/1 (false,true)
Title: DBCell Record
Description: Used by Excel and other MS apps to quickly Find rows in the sheets.
REFERENCE: PG 299/440 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height
@version 2.0-pre
Constructs a DBCellRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
offset from the start of this DBCellRecord to the start of the first cell in
the next DBCell block.
return the cell offset in the array
@param index of the cell offset to retrieve
@return celloffset from the celloffset array
@returns the size of the Group of DBCellRecords needed to encode
the specified number of blocks and rows
Gets offset from the start of this DBCellRecord to the start of the first cell in
the next DBCell block.
@return rowoffset to the start of the first cell in the next DBCell block
Get the number of cell offsets in the celloffset array
@return number of cell offsets
Title: Default Column Width Record
Description: Specifies the default width for columns that have no specific
width Set.
REFERENCE: PG 302 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
The default column width is 8 characters
Constructs a DefaultColumnWidth record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the default column width
@return defaultwidth for columns
Title: Default Row Height Record
Description: Row height for rows with Undefined or not explicitly defined
heights.
REFERENCE: PG 301 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
The default row height for empty rows is 255 twips (255 / 20 == 12.75 points)
Constructs a DefaultRowHeight record and Sets its fields appropriately.
the RecordInputstream to Read the record from
Get the default row height
Title: Delta Record
Description: controls the accuracy of the calculations
REFERENCE: PG 303 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a Delta record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the maximum Change
@return maxChange - maximum rounding error
Title: Dimensions Record
Description: provides the minumum and maximum bounds
of a sheet.
REFERENCE: PG 303 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a Dimensions record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the first row number for the sheet
@return row - first row on the sheet
Get the last row number for the sheet
@return row - last row on the sheet
Get the first column number for the sheet
@return column - first column on the sheet
Get the last col number for the sheet
@return column - last column on the sheet
Process the bytes into escher records.
(Not done by default in case we break things,
Unless you Set the "poi.deSerialize.escher"
system property)
Size of record (including 4 byte headers for all sections)
DrawingRecord (0x00EC)
Cloning of drawing records must be executed through HSSFPatriarch, because all id's must be changed
@return cloned drawing records
This Is purely for the biff viewer. During normal operations we don't want
to be seeing this.
Title: double Stream Flag Record
Description: tells if this Is a double stream file. (always no for HSSF generated files)
double Stream files contain both BIFF8 and BIFF7 workbooks.
REFERENCE: PG 305 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a DBCellRecord and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Title: DATAVALIDATIONS Record
Description: used in data validation ;
This record Is the list header of all data validation records (0x01BE) in the current sheet.
@author Dragos Buleandra (dragos.buleandra@trade2b.ro)
Options of the DVAL
Horizontal position of the dialog
Vertical position of the dialog
Object ID of the drop down arrow object for list boxes ;
in our case this will be always FFFF , Until
MSODrawingGroup and MSODrawing records are implemented
Number of following DV Records
Constructs a DVAL record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
@return the field_1_options
@return the Horizontal position of the dialog
@return the the Vertical position of the dialog
Get Object ID of the drop down arrow object for list boxes
Get number of following DV records
Title: DATAVALIDATION Record (0x01BE)
Description: This record stores data validation Settings and a list of cell ranges
which contain these Settings. The data validation Settings of a sheet
are stored in a sequential list of DV records. This list Is followed by
DVAL record(s)
@author Dragos Buleandra (dragos.buleandra@trade2b.ro)
@version 2.0-pre
Option flags
Title of the prompt box
Title of the error box
Text of the prompt box
Text of the error box
Not used - Excel seems to always write 0x3FE0
Formula data for first condition (RPN token array without size field)
Not used - Excel seems to always write 0x0000
Formula data for second condition (RPN token array without size field)
Cell range address list with all affected ranges
Option flags field
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
Constructs a DV record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
When entered via the UI, Excel translates empty string into "\0"
While it is possible to encode the title/text as empty string (Excel doesn't exactly crash),
the resulting tool-tip text / message box looks wrong. It is best to do the same as the
Excel UI and encode 'not present' as "\0".
Clones the object. Uses serialisation, as the
contents are somewhat complex
Get the condition data type
@return the condition data type
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
Get the condition error style
@return the condition error style
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
return true if in list validations the string list Is explicitly given in the formula, false otherwise
@return true if in list validations the string list Is explicitly given in the formula, false otherwise
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
return true if empty values are allowed in cells, false otherwise
@return if empty values are allowed in cells, false otherwise
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
return true if a prompt window should appear when cell Is selected, false otherwise
@return if a prompt window should appear when cell Is selected, false otherwise
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
return true if an error window should appear when an invalid value Is entered in the cell, false otherwise
@return if an error window should appear when an invalid value Is entered in the cell, false otherwise
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
Get the condition operator
@return the condition operator
@see org.apache.poi.hssf.util.HSSFDataValidation utility class
Gets the option flags field.
@return options - the option flags field
End Of File record.
Description: Marks the end of records belonging to a particular object in the
HSSF File
REFERENCE: PG 307 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a EOFRecord record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
This class Is used to aggregate the MSODRAWING and OBJ record
combinations. This Is necessary due to the bizare way in which
these records are Serialized. What happens Is that you Get a
combination of MSODRAWING -> OBJ -> MSODRAWING -> OBJ records
but the escher records are Serialized _across_ the MSODRAWING
records.
It Gets even worse when you start looking at TXO records.
So what we do with this class Is aggregate lazily. That Is
we don't aggregate the MSODRAWING -> OBJ records Unless we
need to modify them.
At first document contains 4 types of records which belong to drawing layer.
There are can be such sequence of record:
DrawingRecord
ContinueRecord
...
ContinueRecord
ObjRecord | TextObjectRecord
.....
ContinueRecord
...
ContinueRecord
ObjRecord | TextObjectRecord
NoteRecord
...
NoteRecord
To work with shapes we have to read data from Drawing and Continue records into single array of bytes and
build escher(office art) records tree from this array.
Each shape in drawing layer matches corresponding ObjRecord
Each textbox matches corresponding TextObjectRecord
ObjRecord contains information about shape. Thus each ObjRecord corresponds EscherContainerRecord(SPGR)
EscherAggrefate contains also NoteRecords
NoteRecords must be serial
@author Glen Stampoultzis (glens at apache.org)
Maps shape container objects to their OBJ records
list of "tail" records that need to be Serialized after all drawing Group records
Calculates the string representation of this record. This Is
simply a dump of all the records.
Calculates the xml representation of this record. This is
simply a dump of all the records.
@param tab - string which must be added before each line (used by default '\t')
@return xml representation of the all aggregated records
@param sid - record sid we want to check if it belongs to drawing layer
@return true if record is instance of DrawingRecord or ContinueRecord or ObjRecord or TextObjRecord
Serializes this aggregate to a byte array. Since this Is an aggregate
record it will effectively Serialize the aggregated records.
@param offset The offset into the start of the array.
@param data The byte array to Serialize to.
@return The number of bytes Serialized.
@param drawingData - escher records saved into single byte array
@param writtenEscherBytes - count of bytes already saved into drawing records (we should know it to decide create
drawing or continue record)
@param pos current position of data array
@param data - array of bytes where drawing records must be serialized
@param i - number of shape, saved into data array
@return offset of data array after serialization
How many bytes do the raw escher records contain.
@param records List of escher records
@return the number of bytes
@param records list of records to look into
@param loc - location of the record which sid must be returned
@return sid of the record with selected location
create base tree with such structure:
EscherDgContainer
-EscherSpgrContainer
--EscherSpContainer
---EscherSpRecord
---EscherSpgrRecord
---EscherSpRecord
-EscherDgRecord
id of DgRecord and SpRecord are empty and must be set later by HSSFPatriarch
Unused since this Is an aggregate record. Use CreateAggregate().
@see #CreateAggregate
Converts the Records into UserModel
objects on the bound HSSFPatriarch
Associates an escher record to an OBJ record or a TXO record.
ClientData or Textbox record
Obj or TextObj record
Remove echerRecord and associated to it Obj or TextObj record
clientData or textbox record to be removed
@param obj - ObjRecord with id == NoteRecord.id
@return null if note record is not found else returns note record with id == obj.id
@return Returns the current sid.
@return record size, including header size of obj, text, note, drawing, continue records
@return unmodifiable copy of tail records. We need to access them when building shapes.
Every HSSFComment shape has a link to a NoteRecord from the tailRec collection.
Title: Extended Format Record
Description: Probably one of the more complex records. There are two breeds:
Style and Cell.
It should be noted that fields in the extended format record are
somewhat arbitrary. Almost all of the fields are bit-level, but
we name them as best as possible by functional Group. In some
places this Is better than others.
REFERENCE: PG 426 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructor ExtendedFormatRecord
Constructs an ExtendedFormat record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Clones all the style information from another
ExtendedFormatRecord, onto this one. This
will then hold all the same style options.
If The source ExtendedFormatRecord comes from
a different Workbook, you will need to sort
out the font and format indicies yourself!
Will consider two different records with the same
contents as Equals, as the various indexes
that matter are embedded in the records
Get the index to the FONT record (which font to use 0 based)
Get the index to the Format record (which FORMAT to use 0-based)
Gets the options bitmask - you can also use corresponding option bit Getters
(see other methods that reference this one)
Get whether the cell Is locked or not
Get whether the cell Is hidden or not
Get whether the cell Is a cell or style XFRecord
Get some old holdover from lotus 123. Who cares, its all over for Lotus.
RIP Lotus.
for cell XF types this Is the parent style (usually 0/normal). For
style this should be NULL.
Get the alignment options bitmask. See corresponding bitGetter methods
that reference this one.
Get the horizontal alignment of the cell.
Get whether to wrap the text in the cell
Get the vertical alignment of text in the cell
Docs just say this Is for far east versions.. (I'm guessing it
justifies for right-to-left Read languages)
Get the degree of rotation. (I've not actually seen this used anywhere)
Get the indent options bitmask (see corresponding bit Getters that reference
this field)
Get indention (not sure of the Units, think its spaces)
Get whether to shrink the text to fit
Get whether to merge cells
Get the Reading order for far east versions (0 - Context, 1 - Left to right,
2 - right to left) - We could use some help with support for the far east.
Get whether or not to use the format in this XF instead of the parent XF.
Get whether or not to use the font in this XF instead of the parent XF.
Get whether or not to use the alignment in this XF instead of the parent XF.
Get whether or not to use the border in this XF instead of the parent XF.
Get whether or not to use the pattern in this XF instead of the parent XF.
(foregrount/background)
Get whether or not to use the locking/hidden in this XF instead of the parent XF.
Get the border options bitmask (see the corresponding bit Getter methods
that reference back to this one)
Get the borderline style for the left border
Get the borderline style for the right border
Get the borderline style for the top border
Get the borderline style for the bottom border
Get the palette options bitmask (see the individual bit Getter methods that
reference this one)
Get the palette index for the left border color
Get the palette index for the right border color
Get the Additional palette options bitmask (see individual bit Getter methods
that reference this method)
Get the palette index for the top border
Get the palette index for the bottom border
Get for diagonal borders
Get the diagonal border line style
Not sure what this Is for (maybe Fill lines?) 1 = down, 2 = up, 3 = both, 0 for none..
Get the Additional Fill pattern
Get the Fill palette options bitmask (see indivdual bit Getters that
reference this method)
Get the foreground palette color index
Get the background palette color index
EXTERNALNAME
@author Josh Micich
'rgoper' / 'Last received results of the DDE link'
(seems to be only applicable to DDE links)
Logically this is a 2-D array, which has been flattened into 1-D array here.
(logical) number of columns in the {@link #_ddeValues} array
(logical) number of rows in the {@link #_ddeValues} array
Convenience Function to determine if the name Is a built-in name
For OLE and DDE, links can be either 'automatic' or 'manual'
only for OLE and DDE
DDE links only. If true, this denotes the 'StdDocumentName'
@return the standard String representation of this name
index to External Book Block (which starts with a EXTERNALBOOK record)
a Constructor for making new sub record
@param in the RecordInputstream to Read the record from
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array.
@param offset to begin writing at
@param data byte array containing instance data
@return number of bytes written
Title: Extern Sheet
Description: A List of Inndexes to SupBook
REFERENCE:
@author Libin Roman (Vista Portal LDT. Developer)
@version 1.0-pre
Constructs a Extern Sheet record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
@return index of newly added ref
Adds REF struct (ExternSheetSubRecord)
@param rec REF struct
@return -1 if not found
called by the class that Is responsible for writing this sucker.
Subclasses should implement this so that their data Is passed back in a
byte array.
@param offset to begin writing at
@param data byte array containing instance data
@return number of bytes written
returns the number of REF Records, which is in model
@return number of REF records
@return number of REF structures
return the non static version of the id for this record.
Title: A sub Record for Extern Sheet
Description: Defines a named range within a workbook.
REFERENCE:
@author Libin Roman (Vista Portal LDT. Developer)
@version 1.0-pre
a Constractor for making new sub record
Constructs a Extern Sheet Sub Record record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Sets the Index to the sup book
@param index sup book index
Gets the index to sup book
@return sup book index
Sets the index to first sheet in supbook
@param index index to first sheet
Gets the index to first sheet from supbook
@return index to first supbook
Sets the index to last sheet in supbook
@param index index to last sheet
Gets the index to last sheet in supbook
@return index to last supbook
called by the class that Is responsible for writing this sucker.
Subclasses should implement this so that their data Is passed back in a
byte array.
@param offset to begin writing at
@param data byte array containing instance data
@return number of bytes written
returns the record size
return the non static version of the id for this record.
Extended SST table info subrecord
Contains the elements of "info" in the SST's array field
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
@see org.apache.poi.hssf.record.ExtSSTRecord
Creates new ExtSSTInfoSubRecord
Title: Extended Static String Table
Description: This record Is used for a quick Lookup into the SST record. This
record breaks the SST table into a Set of buckets. The offsets
to these buckets within the SST record are kept as well as the
position relative to the start of the SST record.
REFERENCE: PG 313 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at apache dot org)
@version 2.0-pre
@see org.apache.poi.hssf.record.ExtSSTInfoSubRecord
Constructs a EOFRecord record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Given a number of strings (in the sst), returns the size of the extsst record
Returns the size of this record
Title: File Pass Record
Description: Indicates that the record after this record are encrypted. HSSF does not support encrypted excel workbooks
and the presence of this record will cause Processing to be aborted.
REFERENCE: PG 420 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Jason Height (jheight at chariot dot net dot au)
@version 3.0-pre
Title: FILESHARING
Description: stores the encrypted Readonly for a workbook (Write protect)
This functionality Is accessed from the options dialog box available when performing 'Save As'.
REFERENCE: PG 314 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
Constructs a FileSharing record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Clone this record.
Get the Readonly
@return short representing if this Is Read only (1 = true)
@returns password hashed with hashPassword() (very lame)
@returns username of the user that Created the file
Title: Function Group Count Record
Description: Number of built in function Groups in the current version of the
SpReadsheet (probably only used on Windoze)
REFERENCE: PG 315 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
suggested default (14 dec)
Constructs a FnGroupCount record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the number of built-in functions
@return number of built-in functions
Title: Font Record - descrbes a font in the workbook (index = 0-3,5-infinity - skip 4)
Description: An element in the Font Table
REFERENCE: PG 315 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a Font record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Clones all the font style information from another
FontRecord, onto this one. This
will then hold all the same font style options.
Does this FontRecord have all the same font
properties as the supplied FontRecord?
Note that {@link #equals(Object)} will check
for exact objects, while this will check
for exact contents, because normally the
font record's position makes a big
difference too.
Only returns two for the same exact object -
creating a second FontRecord with the same
properties won't be considered equal, as
the record's position in the record stream
matters.
Set the font to be italics or not
@param italics - whether the font Is italics or not
@see #SetAttributes(short)
Set the font to be stricken out or not
@param strike - whether the font Is stricken out or not
@see #SetAttributes(short)
whether to use the mac outline font style thing (mac only) - Some mac person
should comment this instead of me doing it (since I have no idea)
@param mac - whether to do that mac font outline thing or not
@see #SetAttributes(short)
whether to use the mac shado font style thing (mac only) - Some mac person
should comment this instead of me doing it (since I have no idea)
@param mac - whether to do that mac font shadow thing or not
@see #SetAttributes(short)
Set the type of Underlining for the font
Set the font family (TODO)
@param f family
Set the Char Set
@param charSet - CharSet
Set the name of the font
@param fn - name of the font (i.e. "Arial")
Gets the height of the font in 1/20th point Units
@return fontheight (in points/20)
Get the font attributes (see individual bit Getters that reference this method)
@return attribute - the bitmask
Get the font's color palette index
@return cpi - font color index
Get the bold weight for this font (100-1000dec or 0x64-0x3e8). Default Is
0x190 for normal and 0x2bc for bold
@return bw - a number between 100-1000 for the fonts "boldness"
Get the type of base or subscript for the font
@return base or subscript option
Title: Footer Record
Description: Specifies the footer for a sheet
REFERENCE: PG 317 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Shawn Laubach (slaubach at apache dot org) Modified 3/14/02
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Common header/footer base class
@author Josh Micich
get the length of the footer string
@return length of the footer string
Initializes a new instance of the class.
the RecordInputstream to Read the record from
Returns a that represents the current .
A that represents the current .
return the non static version of the id for this record.
Title: Format Record
Description: describes a number format -- those goofy strings like $(#,###)
REFERENCE: PG 317 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Shawn M. Laubach (slaubach at apache dot org)
@version 2.0-pre
Constructs a Format record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the format index code (for built in formats)
@return the format index code
@see org.apache.poi.hssf.model.Workbook
Get the format string
@return the format string
Manages the cached formula result values of other types besides numeric.
Excel encodes the same 8 bytes that would be field_4_value with various NaN
values that are decoded/encoded by this class.
deliberately chosen by Excel in order to encode other values within Double NaNs
@return null if the double value encoded by valueLongBits
is a normal (non NaN) double value.
Formula Record.
REFERENCE: PG 317/444 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Since the NaN support seems sketchy (different constants) we'll store and spit it out directly
Creates new FormulaRecord
Constructs a Formula record and Sets its fields appropriately.
Note - id must be 0x06 (NOT 0x406 see MSKB #Q184647 for an
"explanation of this bug in the documentation) or an exception
will be throw upon validation
@param in the RecordInputstream to Read the record from
@return true if this {@link FormulaRecord} is followed by a
{@link StringRecord} representing the cached text result of the formula
evaluation.
Get the calculated value of the formula
@return calculated value
Get the option flags
@return bitmask
Get the stack as a list
@return list of tokens (casts stack to a list and returns it!)
this method can return null Is we are Unable to Create Ptgs from
existing excel file
callers should Check for null!
Title: GridSet Record.
Description: flag denoting whether the user specified that gridlines are used when
printing.
REFERENCE: PG 320 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a GridSet record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether the gridlines are shown during printing.
@return gridSet - true if gridlines are NOT printed, false if they are.
Title: Guts Record
Description: Row/column gutter sizes
REFERENCE: PG 320 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a Guts record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the size of the gutter that appears at the left of the rows
@return gutter size in screen Units
Get the size of the gutter that appears at the above the columns
@return gutter size in screen Units
Get the maximum outline level for the row gutter.
@return maximum outline level
Get the maximum outline level for the col gutter.
@return maximum outline level
Title: HCenter record
Description: whether to center between horizontal margins
REFERENCE: PG 320 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs an HCenter record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether or not to horizonatally center this sheet.
@return center - t/f
The HEADERFOOTER record stores information Added in Office Excel 2007 for headers/footers.
@author Yegor Kozlov
construct a HeaderFooterRecord record. No fields are interpreted and the record will
be Serialized in its original form more or less
@param in the RecordInputstream to read the record from
spit the record out AS IS. no interpretation or identification
If this header belongs to a specific sheet view , the sheet view?s GUID will be saved here.
If it is zero, it means the current sheet. Otherwise, this field MUST match the guid field
of the preceding {@link UserSViewBegin} record.
@return the sheet view's GUID
@return whether this record belongs to the current sheet
Title: Header Record
Description: Specifies a header for a sheet
REFERENCE: PG 321 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Shawn Laubach (slaubach at apache dot org) Modified 3/14/02
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs an Header record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Title: Hide Object Record
Description: flag defines whether to hide placeholders and object
REFERENCE: PG 321 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs an HideObj record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Set hide object options
@param hide options
@see #HIDE_ALL
@see #SHOW_PLACEHOLDERS
@see #SHOW_ALL
Get hide object options
@return hide options
@see #HIDE_ALL
@see #SHOW_PLACEHOLDERS
@see #SHOW_ALL
HorizontalPageBreak record that stores page breaks at rows
This class Is just used so that SID Compares work properly in the RecordFactory
@see PageBreakRecord
@author Danny Mui (dmui at apache dot org)
Record that Contains the functionality page _breaks (horizontal and vertical)
The other two classes just specifically Set the SIDS for record creation.
REFERENCE: Microsoft Excel SDK page 322 and 420
@see HorizontalPageBreakRecord
@see VerticalPageBreakRecord
@author Danny Mui (dmui at apache dot org)
Adds the page break at the specified parameters
@param main Depending on sid, will determine row or column to put page break (zero-based)
@param subFrom No user-interface to Set (defaults to minumum, 0)
@param subTo No user-interface to Set
Removes the break indicated by the parameter
@param main (zero-based)
Retrieves the region at the row/column indicated
@param main FIXME: Document this!
@return The Break or null if no break exists at the row/col specified.
Since both records store 2byte integers (short), no point in
differentiating it in the records.
The subs (rows or columns, don't seem to be able to Set but excel Sets
them automatically)
@param in the RecordInputstream to Read the record from
The HyperlinkRecord wraps an HLINK-record
from the Excel-97 format.
Supports only external links for now (eg http://)
@author Mark Hissink Muller mark@hissinkmuller.nl
@author Yegor Kozlov (yegor at apache dot org)
Link flags
Tail of a URL link
Tail of a file link
cell range of this hyperlink
16-byte GUID
Some sort of options for file links.
Link options. Can include any of HLINK_* flags.
Test label
Moniker. Makes sense only for URL and file links
in 8:3 DOS format No Unicode string header,
always 8-bit characters, zero-terminated
Link
Text describing a place in document. In Excel UI, this is appended to the
address, (after a '#' delimiter).
This field is optional. If present, the {@link #HLINK_PLACE} must be set.
Remaining bytes
Create a new hyperlink
Read hyperlink from input stream
@param in the stream to Read from
Initialize a new url link
Initialize a new file link
Initialize a new document link
Return the column of the first cell that Contains the hyperlink
@return the 0-based column of the first cell that Contains the hyperlink
Set the column of the last cell that Contains the hyperlink
@return the 0-based column of the last cell that Contains the hyperlink
Return the row of the first cell that Contains the hyperlink
@return the 0-based row of the first cell that Contains the hyperlink
Return the row of the last cell that Contains the hyperlink
@return the 0-based row of the last cell that Contains the hyperlink
Returns a 16-byte guid identifier. Seems to always equal {@link STD_MONIKER}
@return 16-byte guid identifier
Returns a 16-byte moniker.
@return 16-byte moniker
Return text label for this hyperlink
@return text to Display
Hypelink Address. Depending on the hyperlink type it can be URL, e-mail, patrh to a file, etc.
@return the Address of this hyperlink
Link options. Must be a combination of HLINK_* constants.
Label options
Options for a file link
Title: Index Record
Description: Occurs right after BOF, tells you where the DBCELL records are for a sheet
Important for locating cells
NOT USED IN THIS RELEASE
REFERENCE: PG 323 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs an Index record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Returns the size of an INdexRecord when it needs to index the specified number of blocks
Title: Interface End Record
Description: Shows where the Interface Records end (MMS)
(has no fields)
REFERENCE: PG 324 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs an InterfaceEnd record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
for test TestInterfaceEndRecord.TestCreate()
Title: Interface Header Record
Description: Defines the beginning of Interface records (MMS)
REFERENCE: PG 324 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
suggested (and probably correct) default
Constructs an Codepage record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Title: Iteration Record
Description: Tells whether to iterate over forumla calculations or not
(if a formula Is dependant upon another formula's result)
(odd feature for something that can only have 32 elements in
a formula!)
REFERENCE: PG 325 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs an Iteration record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether or not to iterate for calculations
@return whether iterative calculations are turned off or on
Label Record - Read only support for strings stored directly in the cell.. Don't
use this (except to Read), use LabelSST instead
REFERENCE: PG 325 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
@see org.apache.poi.hssf.record.LabelSSTRecord
Creates new LabelRecord
Constructs an Label record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
THROWS A RUNTIME EXCEPTION.. USE LABELSSTRecords. YOU HAVE NO REASON to use LABELRecord!!
Get the number of Chars this string Contains
@return number of Chars
Is this Uncompressed Unicode (16bit)? Or just 8-bit compressed?
@return IsUnicode - True for 16bit- false for 8bit
Get the value
@return the text string
@see #GetStringLength
Title: Label SST Record
Description: Refers to a string in the shared string table and Is a column
value.
REFERENCE: PG 325 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs an LabelSST record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the index to the string in the SSTRecord
@return index of string in the SST Table
@see org.apache.poi.hssf.record.SSTRecord
Record for the left margin.
NOTE: This source was automatically generated.
@author Shawn Laubach (slaubach at apache dot org)
Constructs a LeftMargin record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the margin field for the LeftMargin record.
Not implemented yet. May commit it anyway just so people can see
where I'm heading.
@author Glen Stampoultzis (glens at apache.org)
Title: Merged Cells Record
Description: Optional record defining a square area of cells to "merged" into
one cell.
REFERENCE: NONE (UNDOCUMENTED PRESENTLY)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
sometimes the regions array is shared with other MergedCellsRecords
Constructs a MergedCellsRecord and Sets its fields appropriately
@param in the RecordInputstream to Read the record from
@return MergedRegion at the given index representing the area that is Merged (r1,c1 - r2,c2)
Get the number of merged areas. If this drops down to 0 you should just go
ahead and delete the record.
@return number of areas
Title: MMS Record
Description: defines how many Add menu and del menu options are stored
in the file. Should always be Set to 0 for HSSF workbooks
REFERENCE: PG 328 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a MMS record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Set number of Add menu options (Set to 0)
@param am number of Add menu options
Set number of del menu options (Set to 0)
@param dm number of del menu options
Title: Mulitple Blank cell record
Description: Represents a Set of columns in a row with no value but with styling.
In this release we have Read-only support for this record type.
The RecordFactory Converts this to a Set of BlankRecord objects.
REFERENCE: PG 329 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@version 2.0-pre
@see org.apache.poi.hssf.record.BlankRecord
Creates new MulBlankRecord
Constructs a MulBlank record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
returns the xf index for column (coffset = column - field_2_first_col)
@param coffset the column (coffset = column - field_2_first_col)
@return the XF index for the column
Get the row number of the cells this represents
@return row number
starting column (first cell this holds in the row)
@return first column number
ending column (last cell this holds in the row)
@return first column number
Get the number of columns this Contains (last-first +1)
@return number of columns (last - first +1)
Used to store multiple RK numbers on a row. 1 MulRk = Multiple Cell values.
HSSF just Converts this into multiple NUMBER records. Read-ONLY SUPPORT!
REFERENCE: PG 330 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Creates new MulRKRecord
Constructs a MulRK record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
returns the xf index for column (coffset = column - field_2_first_col)
@return the XF index for the column
returns the rk number for column (coffset = column - field_2_first_col)
@return the value (decoded into a double)
starting column (first cell this holds in the row)
@return first column number
ending column (last cell this holds in the row)
@return first column number
Get the number of columns this Contains (last-first +1)
@return number of columns (last - first +1)
Title: NAMECMT Record (0x0894)
Description: Defines a comment associated with a specified name.
REFERENCE:
@author Andrew Shirley (aks at corefiling.co.uk)
@param ris the RecordInputstream to read the record from
return the non static version of the id for this record.
@return the name of the NameRecord to which this comment applies.
@return the text of the comment.
Title: Name Record (aka Named Range)
Description: Defines a named range within a workbook.
REFERENCE:
@author Libin Roman (Vista Portal LDT. Developer)
@author Sergei Kozello (sergeikozello at mail.ru)
@author Glen Stampoultzis (glens at apache.org)
@version 1.0-pre
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
Included for completeness sake, not implemented
One-based extern index of sheet (resolved via LinkTable). Zero if this is a global name
the one based sheet number.
Creates new NameRecord
Constructs a Name record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Constructor to Create a built-in named region
@param builtin Built-in byte representation for the name record, use the public constants
@param index
Indicates that the defined name refers to a user-defined function.
This attribute is used when there is an add-in or other code project associated with the file.
@param function true indicates the name refers to a function.
called by the class that Is responsible for writing this sucker.
Subclasses should implement this so that their data Is passed back in a
@param offset to begin writing at
@param data byte array containing instance data
@return number of bytes written
@see Object#ToString()
Creates a human Readable name for built in types
@return Unknown if the built-in name cannot be translated
@return function Group
@see FnGroupCountRecord
Gets the option flag
@return option flag
returns the keyboard shortcut
@return keyboard shortcut
**
@return true if name has a formula (named range or defined value)
@return true if name Is hidden
@return true if name Is a function
@return true if name Is a command
@return true if function macro or command macro
@return true if array formula or user defined
Convenience Function to determine if the name Is a built-in name
Gets the name
@return name
Gets the Built In Name
@return the built in Name
Gets the definition, reference (Formula)
@return definition -- can be null if we cant Parse ptgs
Get the custom menu text
@return custom menu text
Gets the description text
@return description text
Get the help topic text
@return gelp topic text
Gets the status bar text
@return status bar text
For named ranges, and built-in names
@return the 1-based sheet number.
Gets the extern sheet number
@return extern sheet index
return the non static version of the id for this record.
NOTE: Comment Associated with a Cell (1Ch)
@author Yegor Kozlov
Flag indicating that the comment Is hidden (default)
Flag indicating that the comment Is visible
Saves padding byte value to reduce delta during round-trip serialization.
The documentation is not clear about how padding should work. In any case
Excel(2007) does something different.
Construct a new NoteRecord and
Fill its data with the default values
Constructs a NoteRecord and Fills its fields
from the supplied RecordInputStream.
@param in the stream to Read from
Serialize the record data into the supplied array of bytes
@param offset offset in the data
@param data the data to Serialize into
@return size of the record
Convert this record to string.
Used by BiffViewer and other utulities.
@return id of this record.
Size of record
Return the row that Contains the comment
@return the row that Contains the comment
Return the column that Contains the comment
@return the column that Contains the comment
Options flags.
@return the options flag
@see #NOTE_VISIBLE
@see #NOTE_HIDDEN
Object id for OBJ record that Contains the comment
Name of the original comment author
@return the name of the original author of the comment
For unit testing only!
Contains a numeric cell value.
REFERENCE: PG 334 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Creates new NumberRecord
Constructs a Number record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the value for the cell
@return double representing the value
Title: Object Protect Record
Description: Protect embedded object with the lamest "security" ever invented.
This record tells "I want to protect my objects" with lame security. It
appears in conjunction with the PASSWORD and PROTECT records as well as its
scenario protect cousin.
REFERENCE: PG 368 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
Constructs a Protect record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether the sheet Is protected or not
@return whether to protect the sheet or not
The obj record is used to hold various graphic objects and controls.
@author Glen Stampoultzis (glens at apache.org)
used when POI has no idea what is going on
Excel seems to tolerate padding to quad or double byte length
Constructs a OBJ record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Some XLS files have ObjRecords with nearly 8Kb of excessive padding. These were probably
written by a version of POI (around 3.1) which incorrectly interpreted the second short of
the ftLbs subrecord (0x1FEE) as a length, and read that many bytes as padding (other bugs
helped allow this to occur).
Excel reads files with this excessive padding OK, truncating the over-sized ObjRecord back
to the its proper size. POI does the same.
Size of record (excluding 4 byte header)
PaletteRecord - Supports custom palettes.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Brian Sanders (bsanders at risklabs dot com) - custom palette editing
@version 2.0-pre
The standard size of an XLS palette
The byte index of the first color
Constructs a PaletteRecord record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Dangerous! Only call this if you intend to replace the colors!
Returns the color value at a given index
@return the RGB triplet for the color, or null if the specified index
does not exist
Sets the color value at a given index
If the given index Is greater than the current last color index,
then black Is Inserted at every index required to make the palette continuous.
@param byteIndex the index to Set; if this index Is less than 0x8 or greater than
0x40, then no modification Is made
Creates the default palette as PaletteRecord binary data
@see org.apache.poi.hssf.model.Workbook#createPalette
PColor - element in the list of colors - consider it a "struct"
* Describes the frozen and Unfozen panes.
* NOTE: This source Is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Pane record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the x field for the Pane record.
Get the y field for the Pane record.
Get the top row field for the Pane record.
Get the left column field for the Pane record.
Get the active pane field for the Pane record.
@return One of
ACTIVE_PANE_LOWER_RIGHT
ACTIVE_PANE_UPPER_RIGHT
ACTIVE_PANE_LOWER_LEFT
ACTIVE_PANE_UPPER_LEFT
Title: Password Record
Description: stores the encrypted password for a sheet or workbook (HSSF doesn't support encryption)
REFERENCE: PG 371 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a Password record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Clone this record.
Get the password
@return short representing the password
Title: Protection Revision 4 password Record
Description: Stores the (2 byte??!!) encrypted password for a shared
workbook
REFERENCE: PG 374 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a PasswordRev4 (PROT4REVPASS) record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
set the password
@param pw representing the password
SXDI - Data Item (0x00C5)
@author Patrick Cheng
SXVDEX - Extended PivotTable View Fields (0x0100)
@author Patrick Cheng
the value of the cchSubName field when the subName is not present
SXPI - Page Item (0x00B6)
@author Patrick Cheng
Index to the View Item SXVI(0x00B2) record
Index to the {@link ViewFieldsRecord} SXVD(0x00B1) record
Object ID for the drop-down arrow
SXIDSTM - Stream ID (0x00D5)
@author Patrick Cheng
SXVIEW - View Definition (0x00B0)
@author Patrick Cheng
SXVD - View Fields (0x00B1)
@author Patrick Cheng
the value of the cchName field when the name is not present
5 shorts
values for the {@link ViewFieldsRecord#sxaxis} field
SXVS - View Source (0x00E3)
@author Patrick Cheng
Title: Precision Record
Description: defines whether to store with full precision or what's Displayed by the gui
(meaning have really screwed up and skewed figures or only think you do!)
REFERENCE: PG 372 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a Precision record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether to use full precision or just skew all you figures all to hell.
@return fullprecision - or not
Title: Print Gridlines Record
Description: whether to print the gridlines when you enjoy you spReadsheet on paper.
REFERENCE: PG 373 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a PrintGridlines record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether or not to print the gridlines (and make your spReadsheet ugly)
@return make spReadsheet ugly - Y/N
Title: Print Headers Record
Description: Whether or not to print the row/column headers when you
enjoy your spReadsheet in the physical form.
REFERENCE: PG 373 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a PrintHeaders record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether to print the headers - y/n
true if [print headers]; otherwise, false.
Title: Print Setup Record
Description: Stores print Setup options -- bogus for HSSF (and marked as such)
REFERENCE: PG 385 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a PrintSetup (SetUP) record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Title: Protection Revision 4 Record
Description: describes whether this is a protected shared/tracked workbook
( HSSF does not support encryption because we don't feel like going to jail )
REFERENCE: PG 373 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a ProtectionRev4 record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether the this is protected shared/tracked workbook or not
@return whether to protect the workbook or not
Title: Protect Record
Description: defines whether a sheet or workbook is protected (HSSF DOES NOT SUPPORT ENCRYPTION)
(kindly ask the US government to stop having arcane stupid encryption laws and we'll support it)
(after all terrorists will all use US-legal encrypton right??)
HSSF now supports the simple "protected" sheets (where they are not encrypted and open office et al
ignore the password record entirely).
REFERENCE: PG 373 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
Constructs a Protect record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether the sheet is protected or not
@return whether to protect the sheet or not
Title: Recalc Id Record
Description: This record Contains an ID that marks when a worksheet was last
recalculated. It's an optimization Excel uses to determine if it
needs to recalculate the spReadsheet when it's opened. So far, only
the two values 0xC1 0x01 0x00 0x00 0x80 0x38 0x01 0x00
(do not recalculate) and 0xC1 0x01 0x00 0x00 0x60 0x69 0x01
0x00 have been seen. If the field isNeeded Is
Set to false (default), then this record Is swallowed during the
serialization Process
REFERENCE: http://chicago.sourceforge.net/devel/docs/excel/biff8.html
@author Luc Girardin (luc dot girardin at macrofocus dot com)
@version 2.0-pre
@see org.apache.poi.hssf.model.Workbook
An unsigned integer that specifies the recalculation engine identifier
of the recalculation engine that performed the last recalculation.
If the value is less than the recalculation engine identifier associated with the application,
the application will recalculate the results of all formulas on
this workbook immediately after loading the file
Constructs a RECALCID record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Title: Record Factory
Description: Takes a stream and outputs an array of Record objects.
@deprecated use {@link org.apache.poi.hssf.eventmodel.EventRecordFactory} instead
@see org.apache.poi.hssf.eventmodel.EventRecordFactory
@author Andrew C. Oliver (acoliver at apache dot org)
@author Marc Johnson (mjohnson at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Csaba Nagy (ncsaba at yahoo dot com)
cache of the recordsToMap();
Debug / diagnosis method
Gets the POI implementation class for a given sid. Only a subset of the any BIFF
records are actually interpreted by POI. A few others are known but not interpreted
(see {@link UnknownRecord#getBiffName(int)}).
@return the POI implementation class for the specified record sid.
null
if the specified record is not interpreted by POI.
Changes the default capacity (10000) to handle larger files
Create an array of records from an input stream
@param in the InputStream from which the records will be
obtained
@return an array of Records Created from the InputStream
@exception RecordFormatException on error Processing the
InputStream
Converts a {@link MulBlankRecord} into an equivalent array of {@link BlankRecord}s
RK record is a slightly smaller alternative to NumberRecord
POI likes NumberRecord better
The rk.
Converts a MulRKRecord into an equivalent array of NumberRecords
The MRK.
A "create" method is used instead of the usual constructor if the created record might
be of a different class to the declaring class.
A stream based way to get at complete records, with
as low a memory footprint as possible.
This handles Reading from a RecordInputStream, turning
the data into full records, processing continue records
etc.
Most users should use {@link HSSFEventFactory} /
{@link HSSFListener} and have new records pushed to
them, but this does allow for a "pull" style of coding.
Temporarily stores a group of {@link Record}s, for future return by {@link #nextRecord()}.
This is used at the start of the workbook stream, and also when the most recently read
underlying record is a {@link MulRKRecord}
used to help iterating over the unread records
The most recent record that we gave to the user
The most recent DrawingRecord seen
@param shouldIncludeContinueRecords caller can pass false if loose
{@link ContinueRecord}s should be skipped (this is sometimes useful in event based
processing).
Returns the next (complete) record from the
stream, or null if there are no more.
@return the next {@link Record} from the multiple record group as expanded from
a recently read {@link MulRKRecord}. null
if not present.
@return the next available record, or null
if
this pass didn't return a record that's
suitable for returning (eg was a continue record).
Keeps track of the sizes of the Initial records up to and including {@link FilePassRecord}
Needed for protected files because each byte is encrypted with respect to its absolute
position from the start of the stream.
@return last record scanned while looking for encryption info.
This will typically be the first or second record Read. Possibly null
if stream was empty
false in some test cases
Title: Record Input Stream
Description: Wraps a stream and provides helper methods for the construction of records.
@author Jason Height (jheight @ apache dot org)
Maximum size of a single record (minus the 4 byte header) without a continue
Header {@link LittleEndianInput} facet of the wrapped {@link InputStream}
Data {@link LittleEndianInput} facet of the wrapped {@link InputStream}
the record identifier of the BIFF record currently being read
This method will Read a byte from the current record
@return the sid of the next record or {@link #INVALID_SID_VALUE} if at end of stream
Moves to the next record in the stream.
Note: The auto continue flag is Reset to true
Reads an 8 bit, signed value
Reads a 16 bit, signed value
Reads an 8 bit, Unsigned value
Reads a 16 bit,un- signed value.
@return
given a byte array of 16-bit Unicode Chars, compress to 8-bit and
return a string
{ 0x16, 0x00 } -0x16
@param Length the Length of the string
@return the Converted string
@exception ArgumentException if len is too large (i.e.,
there is not enough data in string to Create a String of that
Length)
Returns the remaining bytes for the current record.
@return The remaining bytes of the current record.
Reads all byte data for the current record, including any
that overlaps into any following continue records.
@deprecated Best to write a input stream that wraps this one where there Is
special sub record that may overlap continue records.
@return sid of next record. Can be called after hasNextRecord()
The remaining number of bytes in the current record.
@return The number of bytes remaining in the current record
Returns true iif a Continue record is next in the excel stream _currentDataOffset
@return True when a ContinueRecord is next.
Title: RefMode Record
Description: Describes which reference mode to use
REFERENCE: PG 376 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a RefMode record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the reference mode to use (HSSF uses/assumes A1)
@return mode to use
@see #USE_A1_MODE
@see #USE_R1C1_MODE
Title: Refresh All Record
Description: Flag whether to refresh all external data when loading a sheet.
(which hssf doesn't support anyhow so who really cares?)
REFERENCE: PG 376 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a RefreshAll record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether to refresh all external data when loading a sheet
@return refreshall or not
Record for the right margin. * NOTE: This source was automatically generated. * @author Shawn Laubach (slaubach at apache dot org)
Constructs a RightMargin record and Sets its fields appropriately. * * @param id id must be 0x27 or an exception * will be throw upon validation * @param size size the size of the data area of the record * @param data data of the record (should not contain sid/len)
Get the margin field for the RightMargin record.
Title: RK Record
Description: An internal 32 bit number with the two most significant bits
storing the type. This is part of a bizarre scheme to save disk
space and memory (gee look at all the other whole records that
are in the file just "cause"..,far better to waste Processor
cycles on this then leave on of those "valuable" records out).
We support this in Read-ONLY mode. HSSF Converts these to NUMBER records
REFERENCE: PG 376 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
@see org.apache.poi.hssf.record.NumberRecord
Constructs a RK record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the type of the number
@return one of these values:
- RK_IEEE_NUMBER
- RK_IEEE_NUMBER_TIMES_100
- RK_INTEGER
- RK_INTEGER_TIMES_100
Extract the value of the number
The mechanism for determining the value is dependent on the two
low order bits of the raw number. If bit 1 is Set, the number
is an integer and can be cast directly as a double, otherwise,
it's apparently the exponent and mantissa of a double (and the
remaining low-order bits of the double's mantissa are 0's).
If bit 0 is Set, the result of the conversion to a double Is
divided by 100; otherwise, the value is left alone.
[Insert picture of Screwy Squirrel in full Napoleonic regalia]
@return the value as a proper double (hey, it could
happen)
Title: Row Record
Description: stores the row information for the sheet.
REFERENCE: PG 379 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
The maximum row number that excel can handle (zero based) ie 65536 rows Is
max number of rows.
16 bit options flags
Constructs a Row record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the logical row number for this row (0 based index)
@return row - the row number
Get the logical col number for the first cell this row (0 based index)
@return col - the col number
Get the logical col number for the last cell this row plus one (0 based index)
@return col - the last col number + 1
Get the height of the row
@return height of the row
Get whether to optimize or not (Set to 0)
@return optimize (Set to 0)
Gets the option bitmask. (use the individual bit Setters that refer to this
method)
@return options - the bitmask
Get the outline level of this row
@return ol - the outline level
@see #GetOptionFlags()
Get whether or not to colapse this row
@return c - colapse or not
@see #GetOptionFlags()
Get whether or not to Display this row with 0 height
@return - z height is zero or not.
@see #GetOptionFlags()
Get whether the font and row height are not compatible
@return - f -true if they aren't compatible (damn not logic)
@see #GetOptionFlags()
Get whether the row has been formatted (even if its got all blank cells)
@return formatted or not
@see #GetOptionFlags()
if the row is formatted then this is the index to the extended format record
@see org.apache.poi.hssf.record.ExtendedFormatRecord
@return index to the XF record or bogus value (undefined) if Isn't formatted
Title: Save Recalc Record
Description: defines whether to recalculate before saving (Set to true)
REFERENCE: PG 381 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs an SaveRecalc record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether to recalculate formulas/etc before saving or not
@return recalc - whether to recalculate or not
Title: Scenario Protect Record
Description: I have no idea what a Scenario is or why on would want to
protect it with the lamest "security" ever invented. However this record tells
excel "I want to protect my scenarios" (0xAF) with lame security. It appears
in conjunction with the PASSWORD and PROTECT records as well as its object
protect cousin.
REFERENCE: PG 383 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
Constructs a Protect record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether the sheet is protected or not
@return whether to protect the sheet or not
* Specifies the window's zoom magnification. If this record Isn't present then the windows zoom is 100%. see p384 Excel Dev Kit
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Andrew C. Oliver (acoliver at apache.org)
Constructs a SCL record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the numerator field for the SCL record.
Get the denominator field for the SCL record.
Title: Selection Record
Description: shows the user's selection on the sheet
for Write Set num refs to 0
TODO : Fully implement reference subrecords.
REFERENCE: PG 291 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@author Glen Stampoultzis (glens at apache.org)
Constructs a Selection record and Sets its fields appropriately.
the RecordInputstream to Read the record from
Gets or sets the pane this is for.
The pane.
Gets or sets the active cell row.
row number of active cell
Gets or sets the active cell's col
number of active cell
Gets or sets the active cell's reference number
ref number of active cell
Title: SharedFormulaRecord
Description: Primarily used as an excel optimization so that multiple similar formulas
are not written out too many times. We should recognize this record and
Serialize as Is since this Is used when Reading templates.
Note: the documentation says that the SID Is BC where biffviewer reports 4BC. The hex dump shows
that the two byte sid representation to be 'BC 04' that Is consistent with the other high byte
record types.
@author Danny Mui at apache dot org
@param in the RecordInputstream to Read the record from
print a sort of string representation ([SHARED FORMULA RECORD] id = x [/SHARED FORMULA RECORD])
@return the equivalent {@link Ptg} array that the formula would have, were it not shared.
Handles the task of deserializing a SST string. The two main entry points are
@author Glen Stampoultzis (glens at apache.org)
@author Jason Height (jheight at apache.org)
This Is the starting point where strings are constructed. Note that
strings may span across multiple continuations. Read the SST record
carefully before beginning to hack.
Title: Static String Table Record
Description: This holds all the strings for LabelSSTRecords.
REFERENCE: PG 389 Microsoft Excel 97 Developer's Kit (ISBN:
1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Marc Johnson (mjohnson at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@see org.apache.poi.hssf.record.LabelSSTRecord
@see org.apache.poi.hssf.record.ContinueRecord
how big can an SST record be? As big as any record can be: 8228 bytes
standard record overhead: two shorts (record id plus data space size)
SST overhead: the standard record overhead, plus the number of strings and the number of Unique strings -- two ints
how much data can we stuff into an SST record? That would be _max minus the standard SST record overhead
Union of strings in the SST and EXTSST
according to docs ONLY SST
Offsets from the beginning of the SST record (even across continuations)
Offsets relative the start of the current SST or continue record
default constructor
Constructs an SST record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Add a string.
@param string string to be Added
@return the index of that string in the table
Get a particular string by its index
@param id index into the array of strings
@return the desired string
Return a debugging string representation
@return string representation
@return hashcode
@return an iterator of the strings we hold. All instances are
UnicodeStrings
called by the class that Is responsible for writing this sucker.
Subclasses should implement this so that their data Is passed back in a
byte array.
@return size
Creates an extended string record based on the current contents of
the current SST record. The offset within the stream to the SST record
Is required because the extended string record points directly to the
strings in the SST record.
NOTE: THIS FUNCTION MUST ONLY BE CALLED AFTER THE SST RECORD HAS BEEN
SERIALIZED.
@param sstOffset The offset in the stream to the start of the
SST record.
@return The new SST record.
Calculates the size in bytes of the EXTSST record as it would be if the
record was Serialized.
@return The size of the ExtSST record in bytes.
@return number of strings
@return number of Unique strings
@return sid
@return count of the strings we hold.
This class handles serialization of SST records. It utilizes the record processor
class write individual records. This has been refactored from the SSTRecord class.
@author Glen Stampoultzis (glens at apache.org)
OffSets from the beginning of the SST record (even across continuations)
OffSets relative the start of the current SST or continue record
Supports the STRING record structure.
@author Glen Stampoultzis (glens at apache.org)
Constructs a String record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
called by the class that Is responsible for writing this sucker.
Subclasses should implement this so that their data Is passed back in a
byte array.
@param offset to begin writing at
@param data byte array containing instance data
@return number of bytes written
return the non static version of the id for this record.
@return The string represented by this record.
Title: Style Record
Description: Describes a builtin to the gui or user defined style
REFERENCE: PG 390 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author aviks : string fixes for UserDefined Style
@version 2.0-pre
Constructs a Style record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
if this is a builtin style set the number of the built in style
@param builtinStyleId style number (0-7)
Get the actual index of the style extended format record
@see #Index
@return index of the xf record
Get the style's name
@return name of the style
@see #NameLength
Get the row or column level of the style (if builtin 1||2)
* The common object data record is used to store all common preferences for an excel object.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a CommonObjectData record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
Get the object type field for the CommonObjectData record.
Get the object id field for the CommonObjectData record.
Get the option field for the CommonObjectData record.
Get the reserved1 field for the CommonObjectData record.
Get the reserved2 field for the CommonObjectData record.
Get the reserved3 field for the CommonObjectData record.
true if object is locked when sheet has been protected
@return the locked field value.
object appears when printed
@return the printable field value.
whether object uses an automatic Fill style
@return the autoFill field value.
whether object uses an automatic line style
@return the autoline field value.
A sub-record within the OBJ record which stores a reference to an object
stored in a Separate entry within the OLE2 compound file.
@author Daniel Noll
either an area or a cell ref
Formulas often have a single non-zero trailing byte.
This is in a similar position to he pre-streamId padding
It is unknown if the value is important (it seems to mirror a value a few bytes earlier)
Constructs an EmbeddedObjectRef record and Sets its fields appropriately.
@param in the record input stream.
Gets the stream ID containing the actual data. The data itself
can be found under a top-level directory entry in the OLE2 filesystem
under the name "MBDxxxxxxxx" where xxxxxxxx is
this ID converted into hex (in big endian order, funnily enough.)
@return the data stream ID. Possibly null
* The end data record is used to denote the end of the subrecords.
* NOTE: This source is automatically generated please do not modify this file. Either subclass or
* Remove the record in src/records/definitions.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a End record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
* The Group marker record is used as a position holder for Groups.
* @author Glen Stampoultzis (glens at apache.org)
Constructs a Group marker record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Size of record (exluding 4 byte header)
From [MS-XLS].pdf 2.5.147 FtLbsData:
An unsigned integer that indirectly specifies whether
some of the data in this structure appear in a subsequent Continue record.
If _cbFContinued is 0x00, all of the fields in this structure except sid and _cbFContinued
MUST NOT exist. If this entire structure is Contained within the same record,
then _cbFContinued MUST be greater than or equal to the size, in bytes,
of this structure, not including the four bytes for the ft and _cbFContinued fields
a formula that specifies the range of cell values that are the items in this list.
An unsigned integer that specifies the number of items in the list.
An unsigned integer that specifies the one-based index of the first selected item in this list.
A value of 0x00 specifies there is no currently selected item.
flags that tell what data follows
An ObjId that specifies the edit box associated with this list.
A value of 0x00 specifies that there is no edit box associated with this list.
An optional LbsDropData that specifies properties for this dropdown control.
This field MUST exist if and only if the Containing Obj?s cmo.ot is equal to 0x14.
An optional array of strings where each string specifies an item in the list.
The number of elements in this array, if it exists, MUST be {@link #_cLines}
An optional array of bools that specifies
which items in the list are part of a multiple selection
@param in the stream to read data from
@param cbFContinued the seconf short in the record header
@param cmoOt the Containing Obj's {@link CommonObjectDataSubRecord#field_1_objectType}
@return a new instance of LbsDataSubRecord to construct auto-filters
@see org.apache.poi.hssf.model.ComboboxShape#createObjRecord(org.apache.poi.hssf.usermodel.HSSFSimpleShape, int)
@return the formula that specifies the range of cell values that are the items in this list.
@return the number of items in the list
This structure specifies properties of the dropdown list control
Combo dropdown control
Combo Edit dropdown control
Simple dropdown control (just the dropdown button)
An unsigned integer that specifies the style of this dropdown.
An unsigned integer that specifies the number of lines to be displayed in the dropdown.
An unsigned integer that specifies the smallest width in pixels allowed for the dropdown window
a string that specifies the current string value in the dropdown
Optional, undefined and MUST be ignored.
This field MUST exist if and only if the size of str in bytes is an odd number
Represents a NoteStructure (0xD) sub record.
The docs say nothing about it. The Length of this record is always 26 bytes.
@author Yegor Kozlov
Construct a new NoteStructureSubRecord and
Fill its data with the default values
Constructs a NoteStructureSubRecord and Sets its fields appropriately.
Convert this record to string.
Used by BiffViewer and other utulities.
Serialize the record data into the supplied array of bytes
@param offset offset in the data
@param data the data to Serialize into
@return size of the record
Size of record
@return id of this record.
FtSbs structure
Title: Sup Book (EXTERNALBOOK)
Description: A External Workbook Description (Suplemental Book)
Its only a dummy record for making new ExternSheet Record
REFERENCE: 5.38
@author Libin Roman (Vista Portal LDT. Developer)
@author Andrew C. Oliver (acoliver@apache.org)
Constructs a Extern Sheet record and Sets its fields appropriately.
@param id id must be 0x16 or an exception will be throw upon validation
@param size the size of the data area of the record
@param data data of the record (should not contain sid/len)
Title: Sheet Tab Index Array Record
Description: Contains an array of sheet id's. Sheets always keep their ID
regardless of what their name Is.
REFERENCE: PG 412 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a TabID record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Set the tab array. (0,1,2).
@param array of tab id's {0,1,2}
Get the tab array. (0,1,2).
@return array of tab id's {0,1,2}
DATATABLE (0x0236)
TableRecord - The record specifies a data table.
This record Is preceded by a single Formula record that
defines the first cell in the data table, which should
only contain a single Ptg, {@link TblPtg}.
See p536 of the June 08 binary docs
TABLESTYLES (0x088E)
@author Patrick Cheng
expect tRef, tRef3D, tArea, tArea3D or tName
Not clear if needed . Excel seems to be OK if this byte is not present.
Value is often the same as the earlier firstColumn byte.
Get the text orientation field for the TextObjectBase record.
@return a TextOrientation
@return the Horizontal text alignment field value.
@return the Vertical text alignment field value.
Text has been locked
@return the text locked field value.
Record for the top margin.
NOTE: This source was automatically generated.
@author Shawn Laubach (slaubach at apache dot org)
Constructs a TopMargin record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the margin field for the TopMargin record.
Title: Uncalced Record
If this record occurs in the Worksheet Substream, it indicates that the formulas have not
been recalculated before the document was saved.
@author Olivier Leprince
Default constructor
Read constructor
Title: Unknown Record (for debugging)
Description: Unknown record just tells you the sid so you can figure out
what records you are missing. Also helps us Read/modify sheets we
don't know all the records to. (HSSF leaves these alone!)
Company: SuperLink Software, Inc.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@author Glen Stampoultzis (glens at apache.org)
@param id id of the record -not Validated, just stored for serialization
@param data the data
construct an Unknown record. No fields are interperated and the record will
be Serialized in its original form more or less
@param in the RecordInputstream to Read the record from
spit the record out AS IS. no interpretation or identification
print a sort of string representation ([UNKNOWN RECORD] id = x [/UNKNOWN RECORD])
These BIFF record types are known but still uninterpreted by POI
@return the documented name of this BIFF record type, null
if unknown to POI
@return true if the unknown record id has been observed in POI unit tests
Unlike the other Record.Clone methods this Is a shallow Clone
The UserSViewBegin record specifies Settings for a custom view associated with the sheet.
This record also marks the start of custom view records, which save custom view Settings.
Records between {@link UserSViewBegin} and {@link UserSViewEnd} contain Settings for the custom view,
not Settings for the sheet itself.
@author Yegor Kozlov
construct an UserSViewBegin record. No fields are interpreted and the record will
be Serialized in its original form more or less
@param in the RecordInputstream to read the record from
spit the record out AS IS. no interpretation or identification
@return Globally unique identifier for the custom view
The UserSViewEnd record marks the end of the Settings for a custom view associated with the sheet
@author Yegor Kozlov
construct an UserSViewEnd record. No fields are interpreted and the record will
be Serialized in its original form more or less
@param in the RecordInputstream to read the record from
spit the record out AS IS. no interpretation or identification
Title: Use Natural Language Formulas Flag
Description: Tells the GUI if this was written by something that can use
"natural language" formulas. HSSF can't.
REFERENCE: PG 420 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a UseSelFS record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Title: VCenter record
Description: tells whether to center the sheet between vertical margins
REFERENCE: PG 420 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a VCENTER record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get whether to center vertically or not
@return vcenter or not
VerticalPageBreak record that stores page breaks at columns
This class Is just used so that SID Compares work properly in the RecordFactory
@see PageBreakRecord
@author Danny Mui (dmui at apache dot org)
@param in the RecordInputstream to Read the record from
Title: Window1 Record
Description: Stores the attributes of the workbook window. This Is basically
so the gui knows how big to make the window holding the spReadsheet
document.
REFERENCE: PG 421 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a WindowOne record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the horizontal position of the window (in 1/20ths of a point)
@return h - horizontal location
Get the vertical position of the window (in 1/20ths of a point)
@return v - vertical location
Get the width of the window
@return width
Get the height of the window
@return height
Get the options bitmask (see bit Setters)
@return o - the bitmask
Get whether the window Is hidden or not
@return Ishidden or not
Get whether the window has been iconized or not
@return iconize or not
Get whether to Display the horizontal scrollbar or not
@return Display or not
Get whether to Display the vertical scrollbar or not
@return Display or not
Get whether to Display the tabs or not
@return Display or not
@return the index of the currently Displayed sheet
deprecated May 2008
@deprecated - Misleading name - use GetActiveSheetIndex()
@return the first visible sheet in the worksheet tab-bar.
I.E. the scroll position of the tab-bar.
deprecated May 2008
@deprecated - Misleading name - use GetFirstVisibleTab()
Get the number of selected tabs
@return number of tabs
ratio of the width of the tabs to the horizontal scrollbar
@return ratio
Title: Window Protect Record
Description: flags whether workbook windows are protected
REFERENCE: PG 424 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
Constructs a WindowProtect record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Is this window protected or not
@return protected or not
Title: Window Two Record
Description: sheet window Settings
REFERENCE: PG 422 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a WindowTwo record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the options bitmask or just use the bit Setters.
@return options
Get whether the window should Display formulas
@return formulas or not
Get whether the window should Display gridlines
@return gridlines or not
Get whether the window should Display row and column headings
@return headings or not
Get whether the window should freeze panes
@return freeze panes or not
Get whether the window should Display zero values
@return zeros or not
Get whether the window should Display a default header
@return header or not
Is this arabic?
@return arabic or not
Get whether the outline symbols are displaed
@return symbols or not
freeze Unsplit panes or not
@return freeze or not
sheet tab Is selected
@return selected or not
Is the sheet currently Displayed in the window
@return Displayed or not
deprecated May 2008
@deprecated use IsActive()
was the sheet saved in page break view
@return pagebreaksaved or not
Get the top row visible in the window
@return toprow
Get the leftmost column Displayed in the window
@return leftmost
Get the palette index for the header color
@return color
zoom magification in page break view
@return zoom
Get the zoom magnification in normal view
@return zoom
Get the reserved bits - why would you do this?
@return reserved stuff -probably garbage
Title: Write Access Record
Description: Stores the username of that who owns the spReadsheet generator
(on Unix the user's login, on Windoze its the name you typed when
you installed the thing)
REFERENCE: PG 424 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@version 2.0-pre
this record is always padded to a constant length
Constructs a WriteAccess record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get the username for the user that Created the report. HSSF uses the logged in user. On
natively Created M$ Excel sheet this would be the name you typed in when you installed it
in most cases.
@return username of the user who Is logged in (probably "tomcat" or "apache")
Title: Write Protect Record
Description: Indicated that the sheet/workbook Is Write protected.
REFERENCE: PG 425 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@version 3.0-pre
Constructs a WriteAccess record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Title: WSBool Record.
Description: stores workbook Settings (aka its a big "everything we didn't
put somewhere else")
REFERENCE: PG 425 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (gstamp@iprimus.com.au)
@author Jason Height (jheight at chariot dot net dot au)
@version 2.0-pre
Constructs a WSBool record and Sets its fields appropriately.
@param in the RecordInputstream to Read the record from
Get first byte (see bit Getters)
Whether to show automatic page breaks or not
Whether sheet is a dialog sheet or not
Get if row summaries appear below detail in the outline
Get if col summaries appear right of the detail in the outline
Get the second byte (see bit Getters)
fit to page option is on
Whether to display the guts or not
whether alternate expression evaluation is on
whether alternative formula entry is on
Has methods for construction of a chart object.
@author Glen Stampoultzis (glens at apache.org)
Creates a bar chart. API needs some work. :)
NOTE: Does not yet work... checking it in just so others
can take a look.
Returns all the charts for the given sheet.
NOTE: You won't be able to do very much with
these charts yet, as this is very limited support
Set value range (basic Axis Options)
@param axisIndex 0 - primary axis, 1 - secondary axis
@param minimum minimum value; Double.NaN - automatic; null - no change
@param maximum maximum value; Double.NaN - automatic; null - no change
@param majorUnit major unit value; Double.NaN - automatic; null - no change
@param minorUnit minor unit value; Double.NaN - automatic; null - no change
Get the X offset of the chart
Get the Y offset of the chart
Get the width of the chart. {@link ChartRecord}
Get the height of the chart. {@link ChartRecord}
Returns the series of the chart
Returns the chart's title, if there is one,
or null if not
A series in a chart
@return record with data names
@return record with data values
@return record with data category labels
@return record with data secondary category labels
@return record with series
See {@link SeriesRecord}
Returns the series' title, if there is one,
or null if not
Contains raw Excel error codes (as defined in OOO's excelfileformat.pdf (2.5.6)
@author Michael Harhen
#NULL! - Intersection of two cell ranges is empty
#DIV/0! - Division by zero
#VALUE! - Wrong type of operand
#REF! - Illegal or deleted cell reference
#NAME? - Wrong function or range name
#NUM! - Value range overflow
#N/A - Argument or function not available
Gets standard Excel error literal for the specified error code.
@throws ArgumentException if the specified error code is not one of the 7
standard error codes
The error code.
Determines whether [is valid code] [the specified error code].
The error code.
true if the specified error code is a standard Excel error code.; otherwise, false.
A class describing attributes of the Big Block Size
Returns the value that Gets written into the
header.
Is the power of two that corresponds to the
size of the block, eg 512 => 9
A repository for constants shared by POI classes.
@author Marc Johnson (mjohnson at apache dot org)
Most files use 512 bytes as their big block size
Some use 4096 bytes
Most files use 512 bytes as their big block size
Most files use 512 bytes as their big block size
How big a block in the small block stream is. Fixed size
How big a single property is
The minimum size of a document before it's stored using
Big Blocks (normal streams). Smaller documents go in the
Mini Stream (SBAT / Small Blocks)
The highest sector number you're allowed, 0xFFFFFFFA
Indicates the sector holds a FAT block (0xFFFFFFFD)
Indicates the sector holds a DIFAT block (0xFFFFFFFC)
Indicates the sector is the end of a chain (0xFFFFFFFE)
Indicates the sector is not used (0xFFFFFFFF)
The first 4 bytes of an OOXML file, used in detection
This class contains methods used to inspect POIFSViewable objects
@author Marc Johnson (mjohnson at apache dot org)
Inspect an object that may be viewable, and drill down if told to
the object to be viewed
if true and the object implements POIFSViewable, inspect the objects' contents
how far in to indent each string
string to use for indenting
a List of Strings holding the content
Indents the specified indent level.
how far in to indent each string
string to use for indenting
The data.
An event-driven Reader for POIFS file systems. Users of this class
first Create an instance of it, then use the RegisterListener
methods to Register POIFSReaderListener instances for specific
documents. Once all the listeners have been Registered, the Read()
method is called, which results in the listeners being notified as
their documents are Read.
@author Marc Johnson (mjohnson at apache dot org)
Initializes a new instance of the class.
Read from an InputStream and Process the documents we Get
the InputStream from which to Read the data
POIFSDocument list
Register a POIFSReaderListener for all documents
@param listener the listener to be registered
@exception NullPointerException if listener is null
@exception IllegalStateException if read() has already been
called
Register a POIFSReaderListener for a document in the root
directory
@param listener the listener to be registered
@param name the document name
@exception NullPointerException if listener is null or name is
null or empty
@exception IllegalStateException if read() has already been
called
Register a POIFSReaderListener for a document in the specified
directory
@param listener the listener to be registered
@param path the document path; if null, the root directory is
assumed
@param name the document name
@exception NullPointerException if listener is null or name is
null or empty
@exception IllegalStateException if read() has already been
called
Processes the properties.
The small_blocks.
The big_blocks.
The properties.
The path.
Class POIFSReaderEvent
@author Marc Johnson (mjohnson at apache dot org)
@version %I%, %G%
package scoped constructor
@param stream the DocumentInputStream, freshly opened
@param path the path of the document
@param documentName the name of the document
@return the DocumentInputStream, freshly opened
@return the document's path
@return the document's name
EventArgs for POIFSReader
author: Tony Qu
Interface POIFSReaderListener
@author Marc Johnson (mjohnson at apache dot org)
@version %I%, %G%
Process a POIFSReaderEvent that this listener had Registered
for
@param event the POIFSReaderEvent
A registry for POIFSReaderListeners and the DocumentDescriptors of
the documents those listeners are interested in
@author Marc Johnson (mjohnson at apache dot org)
@version %I%, %G%
Construct the registry
Register a POIFSReaderListener for a particular document
@param listener the listener
@param path the path of the document of interest
@param documentName the name of the document of interest
Register for all documents
@param listener the listener who wants to Get all documents
Get am iterator of listeners for a particular document
@param path the document path
@param name the name of the document
@return an Iterator POIFSReaderListeners; may be empty
Represents a cell being used for forked Evaluation that has had a value Set different from the
corresponding cell in the shared master workbook.
@author Josh Micich
Abstracts a cell for the purpose of formula evaluation. This interface represents both formula
and non-formula cells.
Implementors of this class must implement {@link #HashCode()} and {@link #Equals(Object)}
To provide an identity relationship based on the underlying HSSF or XSSF cell
For POI internal use only
@author Josh Micich
corresponding cell from master workbook
Represents a sheet being used for forked Evaluation. Initially, objects of this class contain
only the cells from the master workbook. By calling {@link #getOrCreateUpdatableCell(int, int)},
the master cell object is logically Replaced with a {@link ForkedEvaluationCell} instance, which
will be used in all subsequent Evaluations.
@author Josh Micich
Abstracts a sheet for the purpose of formula evaluation.
For POI internal use only
@author Josh Micich
@return null if there is no cell at the specified coordinates
Only cells which have been split are Put in this map. (This has been done to conserve memory).
Represents a workbook being used for forked Evaluation. Most operations are delegated to the
shared master workbook, except those that potentially involve cell values that may have been
updated After a call to {@link #getOrCreateUpdatableCell(String, int, int)}.
@author Josh Micich
Abstracts a workbook for the purpose of formula evaluation.
For POI internal use only
@author Josh Micich
@return -1 if the specified sheet is from a different book
@return null if externSheetIndex refers To a sheet inside the current workbook
An alternative workbook Evaluator that saves memory in situations where a single workbook is
concurrently and independently Evaluated many times. With standard formula Evaluation, around
90% of memory consumption is due to loading of the {@link HSSFWorkbook} or {@link NPOI.xssf.usermodel.XSSFWorkbook}.
This class enables a 'master workbook' to be loaded just once and shared between many Evaluation
clients. Each Evaluation client Creates its own {@link ForkedEvaluator} and can Set cell values
that will be used for local Evaluations (and don't disturb Evaluations on other Evaluators).
@author Josh Micich
@deprecated (Sep 2009) (reduce overloading) use {@link #Create(Workbook, IStabilityClassifier, UDFFinder)}
@param udfFinder pass null
for default (AnalysisToolPak only)
Sets the specified cell to the supplied value
@param sheetName the name of the sheet Containing the cell
@param rowIndex zero based
@param columnIndex zero based
Copies the values of all updated cells (modified by calls to {@link
#updateCell(String, int, int, ValueEval)}) to the supplied workbook.
Typically, the supplied workbook is a writable copy of the 'master workbook',
but at the very least it must contain sheets with the same names.
If cell Contains a formula, the formula is Evaluated and returned,
else the CellValue simply copies the appropriate cell value from
the cell and also its cell type. This method should be preferred over
EvaluateInCell() when the call should not modify the contents of the
original cell.
@param sheetName the name of the sheet Containing the cell
@param rowIndex zero based
@param columnIndex zero based
@return null
if the supplied cell is null
or blank
Coordinates several formula Evaluators together so that formulas that involve external
references can be Evaluated.
@param workbookNames the simple file names used to identify the workbooks in formulas
with external links (for example "MyData.xls" as used in a formula "[MyData.xls]Sheet1!A1")
@param Evaluators all Evaluators for the full Set of workbooks required by the formulas.
contribute by Pavel Egorov
https://github.com/xoposhiy/npoi/commit/27b34a2389030c7115a666ace65daafda40d61af
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@param arg any {@link ValueEval}, potentially {@link BlankEval} or {@link ErrorEval}.
Encapsulates logic to convert shared formulaa into non shared equivalent
Creates a non shared formula from the shared formula counterpart, i.e.
Converts the shared formula into the equivalent {@link org.apache.poi.ss.formula.ptg.Ptg} array that it would have,
were it not shared.
@param ptgs parsed tokens of the shared formula
@param formulaRow
@param formulaColumn
No diagional border
Backward diagional border, from left-top to right-bottom
Forward diagional border, from right-top to left-bottom
Both forward and backward diagional border
Returns point value at specified index.
@param index index to value from
@return point value at specified index.
@throws {@code IndexOutOfBoundsException} if index
parameter not in range {@code 0 <= index <= pointCount}
Return number of points contained by data source.
@return number of points contained by data source
Returns {@code true} if charts data source is valid cell range.
@return {@code true} if charts data source is valid cell range
Returns {@code true} if data source points should be treated as numbers.
@return {@code true} if data source points should be treated as numbers
Returns formula representation of the data source. It is only applicable
for data source that is valid cell range.
@return formula representation of the data source
@throws {@code UnsupportedOperationException} if the data source is not a
reference.
the different types of possible underline formatting
@author Gisella Bronzetti
Single-line underlining under each character in the cell.
The underline is drawn through the descenders of
characters such as g and p..
Double-line underlining under each character in the
cell. underlines are drawn through the descenders of
characters such as g and p.
Single-line accounting underlining under each
character in the cell. The underline is drawn under the
descenders of characters such as g and p.
Double-line accounting underlining under each
character in the cell. The underlines are drawn under
the descenders of characters such as g and p.
No underline.
Implementation of a BlockingInputStream to provide data to
RawDataBlock that expects data in 512 byte chunks. Useful to read
data from slow (ie, non FileInputStream) sources, for example when
Reading an OLE2 Document over a network.
Possible extentions: add a timeout. Curently a call to Read(byte[]) on this
class is blocking, so use at your own peril if your underlying stream blocks.
@author Jens Gerhard
@author aviks - documentation cleanups.
We had to revert to byte per byte Reading to keep
with slow network connections on one hand, without
missing the end-of-file.
This is the only method that does its own thing in this class
everything else is delegated to aggregated stream.
THIS IS A BLOCKING BLOCK READ!!!
Returns the number of elements between the current position and the limit.
The number of elements remaining in this buffer
Tells whether there are any elements between the current position and the limit.
true if, and only if, there is at least one element remaining in this buffer
Simple implementation of DirectoryEntry
@author Marc Johnson (mjohnson at apache dot org)
Abstract implementation of Entry
Extending classes should override isDocument() or isDirectory(), as
appropriate
Extending classes must override isDeleteOK()
@author Marc Johnson (mjohnson at apache dot org)
Create a DocumentNode. ThIs method Is not public by design; it
Is intended strictly for the internal use of extending classes
the Property for this Entry
the parent of this entry
Delete this Entry. ThIs operation should succeed, but there are
special circumstances when it will not:
If this Entry Is the root of the Entry tree, it cannot be
deleted, as there Is no way to Create another one.
If this Entry Is a directory, it cannot be deleted unless it Is
empty.
true if the Entry was successfully deleted, else false
Rename this Entry. ThIs operation will fail if:
There Is a sibling Entry (i.e., an Entry whose parent Is the
same as this Entry's parent) with the same name.
ThIs Entry Is the root of the Entry tree. Its name Is dictated
by the Filesystem and many not be Changed.
the new name for this Entry
true if the operation succeeded, else false
grant access to the property
the property backing this entry
Is this the root of the tree?
true if this instance is root; otherwise, false.
extensions use this method to verify internal rules regarding
deletion of the underlying store.
true if it's ok to Delete the underlying store; otherwise, false.
Get the name of the Entry
The name.
Get the name of the Entry
@return name
Is this a DirectoryEntry?
true if the Entry Is a DirectoryEntry; otherwise, false.
Is this a DocumentEntry?
true if the Entry Is a DocumentEntry; otherwise, false.
Get this Entry's parent (the DocumentEntry that owns this
Entry). All Entry objects, except the root Entry, has a parent.
this Entry's parent; null iff this Is the root Entry
Create a DirectoryNode. This method Is not public by design; it
Is intended strictly for the internal use of this package
the DirectoryProperty for this DirectoryEntry
the POIFSFileSystem we belong to
the parent of this entry
open a document in the directory's entry's list of entries
the name of the document to be opened
a newly opened DocumentStream
Create a new DocumentEntry; the data will be provided later
the name of the new documentEntry
the new DocumentEntry
Change a contained Entry's name
the original name
the new name
true if the operation succeeded, else false
Deletes the entry.
the EntryNode to be Deleted
true if the entry was Deleted, else false
get a specified Entry by name
the name of the Entry to obtain.
the specified Entry, if it is directly contained in
this DirectoryEntry
Create a new DirectoryEntry
the name of the new DirectoryEntry
the name of the new DirectoryEntry
Gets the path.
this directory's path representation
get an iterator of the Entry instances contained directly in
this instance (in other words, children only; no grandchildren
etc.)
The entries.never null, but hasNext() may return false
immediately (i.e., this DirectoryEntry is empty). All
objects retrieved by next() are guaranteed to be
implementations of Entry.
is this DirectoryEntry empty?
true if this instance contains no Entry instances; otherwise, false.
find out how many Entry instances are contained directly within
this DirectoryEntry
number of immediately (no grandchildren etc.) contained
Entry instances
Gets or Sets the storage clsid for the directory entry
The storage ClassID.
Is this a DirectoryEntry?
true if the Entry Is a DirectoryEntry, else false
extensions use this method to verify internal rules regarding
deletion of the underlying store.
true if it's ok to Delete the underlying store, else
false
Get an array of objects, some of which may implement POIFSViewable
an array of Object; may not be null, but may be empty
Get an Iterator of objects, some of which may implement
POIFSViewable
an Iterator; may not be null, but may have an empty
back end store
Give viewers a hint as to whether to call GetViewableArray or
GetViewableIterator
true if a viewer should call GetViewableArray; otherwise, falseif
a viewer should call GetViewableIterator
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
The short description.
Class DocumentDescriptor
@author Marc Johnson (mjohnson at apache dot org)
Initializes a new instance of the class.
the Document path
the Document name
equality. Two DocumentDescriptor instances are equal if they
have equal paths and names
the object we're checking equality for
true if the object is equal to this object
Serves as a hash function for a particular type.
hashcode
Returns a that represents the current .
A that represents the current .
Gets the path.
The path.
Gets the name.
The name.
This interface defines methods specific to Document objects
managed by a Filesystem instance.
@author Marc Johnson (mjohnson at apache dot org)
get the size of the document, in bytes
size in bytes
Simple implementation of DocumentEntry
@author Marc Johnson (mjohnson at apache dot org)
create a DocumentNode. This method Is not public by design; it
Is intended strictly for the internal use of this package
@param property the DocumentProperty for this DocumentEntry
@param parent the parent of this entry
get the POIFSDocument
@return the internal POIFSDocument
get the zize of the document, in bytes
@return size in bytes
Is this a DocumentEntry?
@return true if the Entry Is a DocumentEntry, else false
extensions use this method to verify internal rules regarding
deletion of the underlying store.
@return true if it's ok to delete the underlying store, else
false
Get an array of objects, some of which may implement
POIFSViewable
@return an array of Object; may not be null, but may be empty
Get an Iterator of objects, some of which may implement
POIFSViewable
@return an Iterator; may not be null, but may have an empty
back end store
Give viewers a hint as to whether to call getViewableArray or
getViewableIterator
@return true if a viewer should call getViewableArray, false if
a viewer should call getViewableIterator
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
@return short description
This exception is thrown when we try to open a file that's actually
an Office 2007+ XML file, rather than an OLE2 file (which is what
POI works with)
@author Nick Burch
Represents an Ole10Native record which is wrapped around certain binary
files being embedded in OLE2 documents.
@author Rainer Schwarze
Creates an instance of this class from an embedded OLE Object. The OLE Object is expected
to include a stream "{01}Ole10Native" which Contains the actual
data relevant for this class.
poifs POI Filesystem object
Returns an instance of this class
Creates an instance of this class from an embedded OLE Object. The OLE Object is expected
to include a stream "{01}Ole10Native" which contains the actual
data relevant for this class.
directory POI Filesystem object
Returns an instance of this class
Creates an instance and Fills the fields based on the data in the given buffer.
@param data The buffer Containing the Ole10Native record
@param offset The start offset of the record in the buffer
@throws Ole10NativeException on invalid or unexcepted data format
Creates an instance and Fills the fields based on the data in the given buffer.
@param data The buffer Containing the Ole10Native record
@param offset The start offset of the record in the buffer
@param plain Specified 'plain' format without filename
@throws Ole10NativeException on invalid or unexcepted data format
Returns flags1 - currently unknown - usually 0x0002.
@return the flags1
Returns the label field - usually the name of the file (without directory) but
probably may be any name specified during packaging/embedding the data.
@return the label
Returns the fileName field - usually the name of the file being embedded
including the full path.
@return the fileName
Returns flags2 - currently unknown - mostly 0x0000.
@return the flags2
Returns unknown1 field - currently unknown.
@return the unknown1
Returns the unknown2 field - currently being a byte[3] - mostly {0, 0, 0}.
@return the unknown2
Returns the command field - usually the name of the file being embedded
including the full path, may be a command specified during embedding the file.
@return the command
Returns the size of the embedded file. If the size is 0 (zero), no data has been
embedded. To be sure, that no data has been embedded, check whether
{@link #getDataBuffer()} returns null
.
@return the dataSize
Returns the buffer Containing the embedded file's data, or null
if no data was embedded. Note that an embedding may provide information about
the data, but the actual data is not included. (So label, filename etc. are
available, but this method returns null
.)
@return the dataBuffer
Returns the flags3 - currently unknown.
@return the flags3
Returns the value of the totalSize field - the total length of the structure
is totalSize + 4 (value of this field + size of this field).
@return the totalSize
Class POIFSDocumentPath
@author Marc Johnson (mjohnson at apache dot org)
simple constructor for the path of a document that is in the
root of the POIFSFileSystem. The constructor that takes an
array of Strings can also be used to create such a
POIFSDocumentPath by passing it a null or empty String array
constructor for the path of a document that is not in the root
of the POIFSFileSystem
the Strings making up the path to a document.
The Strings must be ordered as they appear in
the directory hierarchy of the the document
-- the first string must be the name of a
directory in the root of the POIFSFileSystem,
and every Nth (for N > 1) string thereafter
must be the name of a directory in the
directory identified by the (N-1)th string.
If the components parameter is null or has
zero length, the POIFSDocumentPath is
appropriate for a document that is in the
root of a POIFSFileSystem
constructor that adds additional subdirectories to an existing
path
the existing path
the additional subdirectory names to be added
equality. Two POIFSDocumentPath instances are equal if they
have the same number of component Strings, and if each
component String is equal to its coresponding component String
the object we're checking equality for
true if the object is equal to this object
get the specified component
which component (0 ... length() - 1)
the nth component;
Serves as a hash function for a particular type.
A hash code for the current .
Returns a that represents the current .
A that represents the current .
Gets the length.
the number of components
Returns the path's parent or null if this path
is the root path.
path of parent, or null if this path is the root path
This class provides methods to read a DocumentEntry managed by a
Filesystem instance.
@author Marc Johnson (mjohnson at apache dot org)
Create an InputStream from the specified DocumentEntry
the DocumentEntry to be read
Create an InputStream from the specified Document
the Document to be read
Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
Reads some number of bytes from the input stream and stores
them into the buffer array b. The number of bytes actually read
is returned as an integer. The definition of this method in
java.io.InputStream allows this method to block, but it won't.
If b is null, a NullPointerException is thrown. If the length
of b is zero, then no bytes are read and 0 is returned;
otherwise, there is an attempt to read at least one byte. If no
byte is available because the stream is at end of file, the
value -1 is returned; otherwise, at least one byte is read and
stored into b.
The first byte read is stored into element b[0], the next one
into b[1], and so on. The number of bytes read is, at most,
equal to the length of b. Let k be the number of bytes actually
read; these bytes will be stored in elements b[0] through
b[k-1], leaving elements b[k] through b[b.length-1] unaffected.
If the first byte cannot be read for any reason other than end
of file, then an IOException is thrown. In particular, an
IOException is thrown if the input stream has been closed.
The read(b) method for class InputStream has the same effect as:
the buffer into which the data is read.
the total number of bytes read into the buffer, or -1
if there is no more data because the end of the stream
has been reached.
Reads up to len bytes of data from the input stream into an
array of bytes. An attempt is made to read as many as len
bytes, but a smaller number may be read, possibly zero. The
number of bytes actually read is returned as an integer.
The definition of this method in java.io.InputStream allows it
to block, but it won't.
If b is null, a NullPointerException is thrown.
If off is negative, or len is negative, or off+len is greater
than the length of the array b, then an
IndexOutOfBoundsException is thrown.
If len is zero, then no bytes are read and 0 is returned;
otherwise, there is an attempt to read at least one byte. If no
byte is available because the stream is at end of file, the
value -1 is returned; otherwise, at least one byte is read and
stored into b.
The first byte read is stored into element b[off], the next one
into b[off+1], and so on. The number of bytes read is, at most,
equal to len. Let k be the number of bytes actually read; these
bytes will be stored in elements b[off] through b[off+k-1],
leaving elements b[off+k] through b[off+len-1] unaffected.
In every case, elements b[0] through b[off] and elements
b[off+len] through b[b.length-1] are unaffected.
If the first byte cannot be read for any reason other than end
of file, then an IOException is thrown. In particular, an
IOException is thrown if the input stream has been closed.
the buffer into which the data is read.
the start offset in array b at which the data is
written.
the maximum number of bytes to read.
the total number of bytes read into the buffer, or -1
if there is no more data because the end of the stream
has been reached.
Reads the next byte of data from the input stream. The value
byte is returned as an int in the range 0 to 255. If no byte is
available because the end of the stream has been reached, the
value -1 is returned. The definition of this method in
java.io.InputStream allows this method to block, but it won't.
the next byte of data, or -1 if the end of the stream
is reached.
When overridden in a derived class, sets the position within the current stream.
A byte offset relative to the parameter.
A value of type indicating the reference point used to obtain the new position.
The new position within the current stream.
An I/O error occurs.
The stream does not support seeking, such as if the stream is constructed from a pipe or console output.
Methods were called after the stream was closed.
Skips the specified n.
The n.
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
An array of bytes. This method copies bytes from to the current stream.
The zero-based byte offset in at which to begin copying bytes to the current stream.
The number of bytes to be written to the current stream.
The sum of and is greater than the buffer length.
is null.
or is negative.
An I/O error occurs.
The stream does not support writing.
Methods were called after the stream was closed.
at the end Of document.
Returns the number of bytes that can be read (or skipped over)
from this input stream without blocking by the next caller of a
method for this input stream. The next caller might be the same
thread or or another thread.
the number of bytes that can be read from this input
stream without blocking.
When overridden in a derived class, gets a value indicating whether the current stream supports reading.
true if the stream supports reading; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
true if the stream supports seeking; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports writing.
true if the stream supports writing; otherwise, false.
When overridden in a derived class, gets the length in bytes of the stream.
A long value representing the length of the stream in bytes.
A class derived from Stream does not support seeking.
Methods were called after the stream was closed.
When overridden in a derived class, gets or sets the position within the current stream.
The current position within the stream.
An I/O error occurs.
The stream does not support seeking.
Methods were called after the stream was closed.
This class provides a wrapper over an OutputStream so that Document
writers can't accidently go over their size limits
@author Marc Johnson (mjohnson at apache dot org)
Create a POIFSDocumentWriter
the OutputStream to which the data is actually
the maximum number of bytes that can be written
Closes this output stream and releases any system resources
associated with this stream. The general contract of close is
that it closes the output stream. A closed stream cannot
perform output operations and cannot be reopened.
Flushes this output stream and forces any buffered output bytes
to be written out.
Writes b.length bytes from the specified byte array
to this output stream.
the data.
Writes len bytes from the specified byte array starting at
offset off to this output stream. The general contract for
write(b, off, len) is that some of the bytes in the array b are
written to the output stream in order; element b[off] is the
first byte written and b[off+len-1] is the last byte written by
this operation.
If b is null, a NullPointerException is thrown.
If off is negative, or len is negative, or off+len is greater
than the length of the array b, then an
IndexOutOfBoundsException is thrown.
the data.
the start offset in the data.
the number of bytes to write.
Writes the specified byte to this output stream. The general
contract for write is that one byte is written to the output
stream. The byte to be written is the eight low-order bits of
the argument b. The 24 high-order bits of b are ignored.
the byte.
write the rest of the document's data (fill in at the end)
the actual number of bytes the corresponding
document must fill
the byte to fill remaining space with
When overridden in a derived class, gets a value indicating whether the current stream supports reading.
true if the stream supports reading; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
true if the stream supports seeking; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports writing.
true if the stream supports writing; otherwise, false.
When overridden in a derived class, gets the length in bytes of the stream.
A long value representing the length of the stream in bytes.
A class derived from Stream does not support seeking.
Methods were called after the stream was closed.
When overridden in a derived class, gets or sets the position within the current stream.
The current position within the stream.
An I/O error occurs.
The stream does not support seeking.
Methods were called after the stream was closed.
This is the main class of the POIFS system; it manages the entire
life cycle of the filesystem.
@author Marc Johnson (mjohnson at apache dot org)
Convenience method for clients that want to avoid the auto-Close behaviour of the constructor.
The stream.
A convenience method (
CreateNonClosingInputStream()) has been provided for this purpose:
StreamwrappedStream = POIFSFileSystem.CreateNonClosingInputStream(is);
HSSFWorkbook wb = new HSSFWorkbook(wrappedStream);
is.reset();
doSomethingElse(is);
What big block size the file uses. Most files
use 512 bytes, but a few use 4096
Initializes a new instance of the class. intended for writing
Create a POIFSFileSystem from an Stream. Normally the stream is Read until
EOF. The stream is always Closed. In the unlikely case that the caller has such a stream and
needs to use it after this constructor completes, a work around is to wrap the
stream in order to trap the Close() call.
the Streamfrom which to Read the data
@param stream the stream to be Closed
@param success false if an exception is currently being thrown in the calling method
Checks that the supplied Stream(which MUST
support mark and reset, or be a PushbackInputStream)
has a POIFS (OLE2) header at the start of it.
If your Streamdoes not support mark / reset,
then wrap it in a PushBackInputStream, then be
sure to always use that, and not the original!
An Streamwhich supports either mark/reset, or is a PushbackStream
true if [has POIFS header] [the specified inp]; otherwise, false.
Create a new document to be Added to the root directory
the Streamfrom which the document's data will be obtained
the name of the new POIFSDocument
the new DocumentEntry
Create a new DocumentEntry in the root entry; the data will be
provided later
the name of the new DocumentEntry
the size of the new DocumentEntry
the Writer of the new DocumentEntry
the new DocumentEntry
Create a new DirectoryEntry in the root directory
the name of the new DirectoryEntry
the new DirectoryEntry
open a document in the root entry's list of entries
@param documentName the name of the document to be opened
@return a newly opened DocumentInputStream
@exception IOException if the document does not exist or the
name is that of a DirectoryEntry
Writes the file system.
the OutputStream to which the filesystem will be
written
Add a new POIFSDocument
the POIFSDocument being Added
Add a new DirectoryProperty
The directory.
Removes the specified entry.
The entry.
Get the root entry
The root.
Get an array of objects, some of which may implement
POIFSViewable
an array of Object; may not be null, but may be empty
Get an Iterator of objects, some of which may implement
POIFSViewable
an Iterator; may not be null, but may have an empty
back end store
Give viewers a hint as to whether to call GetViewableArray or
GetViewableIterator
true if a viewer should call GetViewableArray, false if
a viewer should call GetViewableIterator
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
The short description.
Gets The Big Block size, normally 512 bytes, sometimes 4096 bytes
The size of the big block.
This interface defines methods for finding and setting sibling
Property instances
@author Marc Johnson (mjohnson at apache dot org)
Gets or sets the previous child.
The previous child.
Gets or sets the next child.
The next child.
Trivial extension of Property for POIFSDocuments
@author Marc Johnson (mjohnson at apache dot org)
This abstract base class is the ancestor of all classes
implementing POIFS Property behavior.
@author Marc Johnson (mjohnson at apache dot org)
Initializes a new instance of the class.
Constructor from byte data
index number
byte data
offset into byte data
Write the raw data to an OutputStream.
the OutputStream to which the data Should be
written.
does the length indicate a small document?
length in bytes
true if the length Is less than
_big_block_minimum_bytes; otherwise, false.
Perform whatever activities need to be performed prior to
writing
Determines whether the specified index Is valid
value to be checked
true if the index Is valid; otherwise, false.
Gets or sets the start block for the document referred to by this
Property.
the start block index
Based on the currently defined size, Should this property use
small blocks?
true if the size Is less than _big_block_minimum_bytes
Gets or sets the name of this property
property name
Gets a value indicating whether this instance is directory.
true if a directory type Property; otherwise, false.
Gets or sets the storage class ID for this property stream. ThIs Is the Class ID
of the COM object which can read and write this property stream
Storage Class ID
Set the property type. Makes no attempt to validate the value.
the property type (root, file, directory)
Sets the color of the node.
the node color (red or black)
Sets the child property.
the child property's index in the Property Table
Get the child property (its index in the Property Table)
The index of the child.
Gets or sets the size of the document associated with this Property
the size of the document, in bytes
Gets or sets the index.
The index.
Get the index for this Property
@return the index of this Property within its Property Table
Gets the index of the next child.
The index of the next child.
Gets the index of the previous child.
The index of the previous child.
Gets or sets the previous child.
the new 'previous' child; may be null, which has
the effect of saying there Is no 'previous' child
Gets or sets the next Child
the new 'next' child; may be null, which has the
effect of saying there Is no 'next' child
Get an array of objects, some of which may implement
POIFSViewable
an array of Object; may not be null, but may be empty
Get an Iterator of objects, some of which may implement POIFSViewable
may not be null, but may have an empty
back end store
Give viewers a hint as to whether to call GetViewableArray or
GetViewableIterator
true if a viewer Should call GetViewableArray; otherwise, false
if a viewer Should call GetViewableIterator
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
The short description.
Behavior for parent (directory) properties
@author Marc Johnson27591@hotmail.com
Add a new child to the collection of children
the new child to be added; must not be null
Get an iterator over the children of this Parent
all elements are instances of Property.
Sets the previous child.
Sets the next child.
Initializes a new instance of the class.
the name of the directory
Initializes a new instance of the class.
index number
byte data
offset into byte data
Change a Property's name
the Property whose name Is being Changed.
the new name for the Property
true if the name Change could be made, else false
Delete a Property
the Property being Deleted
true if the Property could be Deleted, else false
Perform whatever activities need to be performed prior to
writing
Add a new child to the collection of children
the new child to be added; must not be null
Gets a value indicating whether this instance is directory.
true if a directory type Property; otherwise, false.
Get an iterator over the children of this Parent; all elements
are instances of Property.
Iterator of children; may refer to an empty collection
Directory Property Comparer
Object equality, implemented as object identity
Object we're being Compared to
true if identical, else false
Compare method. Assumes both parameters are non-null
instances of Property. One property is less than another if
its name is shorter than the other property's name. If the
names are the same length, the property whose name comes
before the other property's name, alphabetically, is less
than the other property.
first object to compare, better be a Property
second object to compare, better be a Property
negative value if o1 smaller than o2,
zero if o1 equals o2,
positive value if o1 bigger than o2.
Trivial extension of Property for POIFSDocuments
@author Marc Johnson (mjohnson at apache dot org)
Initializes a new instance of the class.
POIFSDocument name
POIFSDocument size
Initializes a new instance of the class.
index number
byte data
offset into byte data
Perform whatever activities need to be performed prior to
writing
Gets or sets the document.
the associated POIFSDocument
Determines whether this instance is directory.
true if this instance is directory; otherwise, false.
Constants used by Properties namespace
Convert raw data blocks to an array of Property's
The blocks to be converted
the converted List of Property objects. May contain
nulls, but will not be null
Default constructor
reading constructor (used when we've read in a file and we want
to extract the property table from it). Populates the
properties thoroughly
@param startBlock the first block of the property table
@param blockList the list of blocks
@exception IOException if anything goes wrong (which should be
a result of the input being NFG)
Prepare to be written Leon
Write the storage to an Stream
@param stream the Stream to which the stored data should
be written
@exception IOException on problems writing to the specified
stream
Return the number of BigBlock's this instance uses
@return count of BigBlock instances
Initializes a new instance of the class.
index number
byte data
offset into byte data
Gets or sets the size of the document associated with this Property
the size of the document, in bytes
A block of block allocation table entries. BATBlocks are created
only through a static factory method: createBATBlocks.
@author Marc Johnson (mjohnson at apache dot org)
Abstract base class of all POIFS block storage classes. All
extensions of BigBlock should write 512 bytes of data when
requested to write their data.
This class has package scope, as there is no reason at this time to
make the class public.
@author Marc Johnson (mjohnson at apache dot org)
Default implementation of write for extending classes that
contain their data in a simple array of bytes.
the OutputStream to which the data should be written.
the byte array of to be written.
Write the block's data to an OutputStream
the OutputStream to which the stored data should be written
Write the storage to an OutputStream
the OutputStream to which the stored data should be written
For a regular fat block, these are 128 / 1024
next sector values.
For a XFat (DIFat) block, these are 127 / 1023
next sector values, then a chaining value.
Does this BATBlock have any free sectors in it?
Where in the file are we?
Create a single instance initialized with default values
Create a single instance initialized (perhaps partially) with entries
@param entries the array of block allocation table entries
@param start_index the index of the first entry to be written
to the block
@param end_index the index, plus one, of the last entry to be
written to the block (writing is for all index
k, start_index <= k < end_index)
Create a single BATBlock from the byte buffer, which must hold at least
one big block of data to be read.
**
Create an array of BATBlocks from an array of int block
allocation table entries
the poifs bigBlockSize
the array of int entries
the newly created array of BATBlocks
Create an array of XBATBlocks from an array of int block
allocation table entries
the array of int entries
the start block of the array of XBAT blocks
the newly created array of BATBlocks
Calculate how many BATBlocks are needed to hold a specified
number of BAT entries.
the number of entries
the number of BATBlocks needed
Calculate how many XBATBlocks are needed to hold a specified
number of BAT entries.
the number of entries
the number of XBATBlocks needed
Calculates the maximum size of a file which is addressable given the
number of FAT (BAT) sectors specified. (We don't care if those BAT
blocks come from the 109 in the header, or from header + XBATS, it
won't affect the calculation)
The actual file size will be between [size of fatCount-1 blocks] and
[size of fatCount blocks].
For 512 byte block sizes, this means we may over-estimate by up to 65kb.
For 4096 byte block sizes, this means we may over-estimate by up to 4mb
Create a single instance initialized (perhaps partially) with entries
the array of block allocation table entries
the index of the first entry to be written
to the block
the index, plus one, of the last entry to be
written to the block (writing is for all index
k, start_index less than k less than end_index)
Write the block's data to an Stream
the Stream to which the stored data should
be written
Gets the entries per block.
The number of entries per block
Gets the entries per XBAT block.
number of entries per XBAT block
Gets the XBAT chain offset.
offset of chain index of XBAT block
Does this BATBlock have any free sectors in it, or
is it full?
Retrieve where in the file we live
This class manages and creates the Block Allocation Table, which is
basically a set of linked lists of block indices.
Each block of the filesystem has an index. The first block, the
header, is skipped; the first block after the header is index 0,
the next is index 1, and so on.
A block's index is also its index into the Block Allocation
Table. The entry that it finds in the Block Allocation Table is the
index of the next block in the linked list of blocks making up a
file, or it is set to -2: end of list.
@author Marc Johnson (mjohnson at apache dot org)
create a BlockAllocationTableReader for an existing filesystem. Side
effect: when this method finishes, the BAT blocks will have
been Removed from the raw block list, and any blocks labeled as
'unused' in the block allocation table will also have been
Removed from the raw block list.
the poifs bigBlockSize
the number of BAT blocks making up the block allocation table
the array of BAT block indices from the
filesystem's header
the number of XBAT blocks
the index of the first XBAT block
the list of RawDataBlocks
create a BlockAllocationTableReader from an array of raw data blocks
the raw data
the list holding the managed blocks
Initializes a new instance of the class.
walk the entries from a specified point and return the
associated blocks. The associated blocks are Removed from the block list
the first block in the chain
the raw data block list
array of ListManagedBlocks, in their correct order
determine whether the block specified by index is used or not
determine whether the block specified by index is used or not
true if the specified block is used; otherwise, false.
return the next block index
The index of the current block
index of the next block (may be
POIFSConstants.END_OF_CHAIN, indicating end of chain
(duh))
Convert an array of blocks into a Set of integer indices
the array of blocks containing the indices
the list of blocks being managed. Unused
blocks will be eliminated from the list
This class manages and creates the Block Allocation Table, which is
basically a set of linked lists of block indices.
Each block of the filesystem has an index. The first block, the
header, is skipped; the first block after the header is index 0,
the next is index 1, and so on.
A block's index is also its index into the Block Allocation
Table. The entry that it finds in the Block Allocation Table is the
index of the next block in the linked list of blocks making up a
file, or it is set to -2: end of list.
*
@author Marc Johnson (mjohnson at apache dot org)
Initializes a new instance of the class.
Create the BATBlocks we need
start block index of BAT blocks
Allocate space for a block of indices
the number of blocks to allocate space for
the starting index of the blocks
create the BATBlocks
Write the storage to an OutputStream
the OutputStream to which the stored data should be written
Sets the start block for this instance
index into the array of BigBlock instances making up the the filesystem
Gets the number of BigBlock's this instance uses
count of BigBlock instances
Interface for lists of blocks that are mapped by block allocation
tables
@author Marc Johnson (mjohnson at apache dot org)
remove the specified block from the list
the index of the specified block; if the index is
out of range, that's ok
Remove and return the specified block from the list
the index of the specified block
the specified block
get the blocks making up a particular stream in the list. The
blocks are removed from the list.
the index of the first block in the stream
the stream as an array of correctly ordered blocks
set the associated BlockAllocationTable
the associated BlockAllocationTable
Initializes a new instance of the class.
provide blocks to manage
blocks to be managed
remove the specified block from the list
the index of the specified block; if the index is
out of range, that's ok
Remove and return the specified block from the list
the index of the specified block
the specified block
get the blocks making up a particular stream in the list. The
blocks are removed from the list.
the index of the first block in the stream
the stream as an array of correctly ordered blocks
set the associated BlockAllocationTable
the associated BlockAllocationTable
Wraps a byte array and provides simple data input access.
Internally, this class maintains a buffer read index, so that for the most part, primitive
data can be read in a data-input-stream-like manner.
Note - the calling class should call the {@link #available()} method to detect end-of-buffer
and Move to the next data block when the current is exhausted.
For optimisation reasons, no error handling is performed in this class. Thus, mistakes in
calling code ran may raise ugly exceptions here, like {@link ArrayIndexOutOfBoundsException},
etc .
The multi-byte primitive input methods ({@link #readUshortLE()}, {@link #readIntLE()} and
{@link #readLongLE()}) have corresponding 'spanning Read' methods which (when required) perform
a read across the block boundary. These spanning read methods take the previous
{@link DataInputBlock} as a parameter.
Reads of larger amounts of data (into byte array buffers) must be managed by the caller
since these could conceivably involve more than two blocks.
@author Josh Micich
Possibly any size (usually 512K or 64K). Assumed to be at least 8 bytes for all blocks
before the end of the stream. The last block in the stream can be any size except zero.
Reads a short which was encoded in little endian format.
Reads a short which spans the end of prevBlock and the start of this block.
Reads an int which was encoded in little endian format.
Reads an int which spans the end of prevBlock and the start of this block.
Reads a long which was encoded in little endian format.
Reads a long which spans the end of prevBlock and the start of this block.
Reads a small amount of data from across the boundary between two blocks.
The {@link #_readIndex} of this (the second) block is updated accordingly.
Note- this method (and other code) assumes that the second {@link DataInputBlock}
always is big enough to complete the read without being exhausted.
Reads len bytes from this block into the supplied buffer.
create a document block from a raw data block
The block.
Create a single instance initialized with data.
the InputStream delivering the data.
the poifs bigBlockSize
convert a single long array into an array of DocumentBlock
instances
the poifs bigBlockSize
the byte array to be converted
the intended size of the array (which may be smaller)
an array of DocumentBlock instances, filled from the
input array
Read data from an array of DocumentBlocks
the blocks to Read from
the buffer to Write the data into
the offset into the array of blocks to Read from
Write the storage to an OutputStream
the OutputStream to which the stored data should
be written
Get the number of bytes Read for this block.
bytes Read into the block
Was this a partially Read block?
true if the block was only partially filled with data
Gets the fill byte used
The fill byte.
The block containing the archive header
@author Marc Johnson (mjohnson at apache dot org)
What big block Size the file uses. Most files
use 512 bytes, but a few use 4096
Number of small block allocation table blocks (int)
(Number of MiniFAT Sectors in Microsoft parlance)
create a new HeaderBlockReader from an Stream
the source Stream
Alerts the short read.
The read.
expected size to read
Get start of Property Table
the index of the first block of the Property Table
Gets start of small block allocation table
The SBAT start.
Gets number of BAT blocks
The BAT count.
Gets the BAT array.
The BAT array.
Gets the XBAT count.
The XBAT count.
@return XBAT count
Gets the index of the XBAT.
The index of the XBAT.
Gets The Big Block Size, normally 512 bytes, sometimes 4096 bytes
The size of the big block.
@return
The block containing the archive header
@author Marc Johnson (mjohnson at apache dot org)
Set BAT block parameters. Assumes that all BAT blocks are
contiguous. Will construct XBAT blocks if necessary and return
the array of newly constructed XBAT blocks.
count of BAT blocks
index of first BAT block
array of XBAT blocks; may be zero Length, will not be
null
For a given number of BAT blocks, calculate how many XBAT
blocks will be needed
number of BAT blocks
number of XBAT blocks needed
Write the block's data to an Stream
the Stream to which the stored data should
be written
Set start of Property Table
the index of the first block of the Property
Table
Set start of small block allocation table
the index of the first big block of the small
block allocation table
Set count of SBAT blocks
the number of SBAT blocks
An interface for blocks managed by a list that works with a
BlockAllocationTable to keep block sequences straight
@author Marc Johnson (mjohnson at apache dot org
Get the data from the block
the block's data as a byte array
A block of Property instances
@author Marc Johnson (mjohnson at apache dot org)
Create a single instance initialized with default values
the properties to be inserted
the offset into the properties array
Create an array of PropertyBlocks from an array of Property
instances, creating empty Property instances to make up any
shortfall
the Property instances to be converted into PropertyBlocks, in a java List
the array of newly created PropertyBlock instances
Write the block's data to an OutputStream
the OutputStream to which the stored data should be written
A big block created from an InputStream, holding the raw data
@author Marc Johnson (mjohnson at apache dot org
Constructor RawDataBlock
the Stream from which the data will be read
Initializes a new instance of the class.
the Stream from which the data will be read
the size of the POIFS blocks, normally 512 bytes {@link POIFSConstants#BIG_BLOCK_SIZE}
When we read the data, did we hit end of file?
true if the EoF was hit during this block, or; otherwise, falseif not. If you have a dodgy short last block, then
it's possible to both have data, and also hit EoF...
Did we actually find any data to read? It's possible,
in the event of a short last block, to both have hit
the EoF, but also to have data
true if this instance has data; otherwise, false.
Get the data from the block
the block's data as a byte array
A list of RawDataBlocks instances, and methods to manage the list
@author Marc Johnson (mjohnson at apache dot org
Initializes a new instance of the class.
the InputStream from which the data will be read
The big block size, either 512 bytes or 4096 bytes
This class implements reading the small document block list from an
existing file
@author Marc Johnson (mjohnson at apache dot org)
fetch the small document block list from an existing file
the poifs bigBlockSize
the raw data from which the small block table will be extracted
the root property (which contains the start block and small block table size)
the start block of the SBAT
the small document block list
This class implements reading the small document block list from an
existing file
@author Marc Johnson (mjohnson at apache dot org)
Initializes a new instance of the class.
the poifs bigBlockSize
a IList of POIFSDocument instances
the Filesystem's root property
Write the storage to an OutputStream
the OutputStream to which the stored data should be written
Get the number of SBAT blocks
number of SBAT big blocks
Gets the SBAT.
the Small Block Allocation Table
Return the number of BigBlock's this instance uses
count of BigBlock instances
Sets the start block.
The start block.
Storage for documents that are too small to use regular
DocumentBlocks for their data
@author Marc Johnson (mjohnson at apache dot org)
convert a single long array into an array of SmallDocumentBlock
instances
the poifs bigBlockSize
the byte array to be converted
the intended size of the array (which may be smaller)
an array of SmallDocumentBlock instances, filled from
the array
fill out a List of SmallDocumentBlocks so that it fully occupies
a Set of big blocks
the List to be filled out.
number of big blocks the list encompasses
Factory for creating SmallDocumentBlocks from DocumentBlocks
the original DocumentBlocks
the total document size
an array of new SmallDocumentBlocks instances
create a list of SmallDocumentBlock's from raw data
the raw data containing the SmallDocumentBlock
a List of SmallDocumentBlock's extracted from the input
Read data from an array of SmallDocumentBlocks
the blocks to Read from.
the buffer to Write the data into.
the offset into the array of blocks to Read from
Calculate the storage size of a Set of SmallDocumentBlocks
number of SmallDocumentBlocks
total size
Makes the empty small document block.
Converts to block count.
The size.
Write the storage to an OutputStream
the OutputStream to which the stored data should
be written
Get the data from the block
the block's data as a byte array
A list of SmallDocumentBlocks instances, and methods to manage the list
@author Marc Johnson (mjohnson at apache dot org)
Initializes a new instance of the class.
a list of SmallDocumentBlock instances
Various utility functions that make working with a cells and rows easier. The various
methods that deal with style's allow you to Create your HSSFCellStyles as you need them.
When you apply a style change to a cell, the code will attempt to see if a style already
exists that meets your needs. If not, then it will Create a new style. This is to prevent
creating too many styles. there is an upper limit in Excel on the number of styles that
can be supported.
@author Eric Pugh epugh@upstate.com
Get a row from the spreadsheet, and Create it if it doesn't exist.
The 0 based row number
The sheet that the row is part of.
The row indicated by the rowCounter
Get a specific cell from a row. If the cell doesn't exist,
The row that the cell is part of
The column index that the cell is in.
The cell indicated by the column.
Creates a cell, gives it a value, and applies a style if provided
the row to Create the cell in
the column index to Create the cell in
The value of the cell
If the style is not null, then Set
A new HSSFCell
Create a cell, and give it a value.
the row to Create the cell in
the column index to Create the cell in
The value of the cell
A new HSSFCell.
Take a cell, and align it.
the cell to Set the alignment for
The workbook that is being worked with.
the column alignment to use.
Take a cell, and apply a font to it
the cell to Set the alignment for
The workbook that is being worked with.
The HSSFFont that you want to Set...
This method attempt to find an already existing HSSFCellStyle that matches
what you want the style to be. If it does not find the style, then it
Creates a new one. If it does Create a new one, then it applies the
propertyName and propertyValue to the style. This is necessary because
Excel has an upper limit on the number of Styles that it supports.
@param workbook The workbook that is being worked with.
@param propertyName The name of the property that is to be
changed.
@param propertyValue The value of the property that is to be
changed.
@param cell The cell that needs it's style changes
@exception NestableException Thrown if an error happens.
Returns a map containing the format properties of the given cell style.
cell style
map of format properties (String -> Object)
Sets the format properties of the given style based on the given map.
The cell style
The parent workbook.
The map of format properties (String -> Object).
Utility method that returns the named short value form the given map.
Returns zero if the property does not exist, or is not a {@link Short}.
The map of named properties (String -> Object)
The property name.
property value, or zero
Utility method that returns the named boolean value form the given map.
Returns false if the property does not exist, or is not a {@link Boolean}.
map of properties (String -> Object)
The property name.
property value, or false
Utility method that Puts the named short value to the given map.
The map of properties (String -> Object).
The property name.
The property value.
Utility method that Puts the named boolean value to the given map.
map of properties (String -> Object)
property name
property value
Looks for text in the cell that should be unicode, like alpha; and provides the
unicode version of it.
The cell to check for unicode values
transalted to unicode
Various utility functions that make working with a region of cells easier.
@author Eric Pugh epugh@upstate.com
Sets the left border for a region of cells by manipulating the cell style
of the individual cells on the left
The new border
The region that should have the border
The sheet that the region is on.
The workbook that the region is on.
Sets the leftBorderColor attribute of the HSSFRegionUtil object
The color of the border
The region that should have the border
The sheet that the region is on.
The workbook that the region is on.
Sets the borderRight attribute of the HSSFRegionUtil object
The new border
The region that should have the border
The sheet that the region is on.
The workbook that the region is on.
Sets the rightBorderColor attribute of the HSSFRegionUtil object
The color of the border
The region that should have the border
The workbook that the region is on.
The sheet that the region is on.
Sets the borderBottom attribute of the HSSFRegionUtil object
The new border
The region that should have the border
The sheet that the region is on.
The workbook that the region is on.
Sets the bottomBorderColor attribute of the HSSFRegionUtil object
The color of the border
The region that should have the border
The sheet that the region is on.
The workbook that the region is on.
Sets the borderBottom attribute of the HSSFRegionUtil object
The new border
The region that should have the border
The sheet that the region is on.
The workbook that the region is on.
Sets the topBorderColor attribute of the HSSFRegionUtil object
The color of the border
The region that should have the border
The sheet that the region is on.
The workbook that the region is on.
For setting the same property on many cells to the same value
Translates Graphics calls into escher calls. The translation Is lossy so
many features are not supported and some just aren't implemented yet. If
in doubt test the specific calls you wish to make. Graphics calls are
always performed into an EscherGroup so one will need to be Created.
Important:
One important concept worth considering Is that of font size. One of the
difficulties in Converting Graphics calls into escher Drawing calls Is that
Excel does not have the concept of absolute pixel positions. It measures
it's cell widths in 'Chars' and the cell heights in points.
Unfortunately it's not defined exactly what a type of Char it's
measuring. Presumably this Is due to the fact that the Excel will be
using different fonts on different platforms or even within the same
platform.
Because of this constraint we've had to calculate the
verticalPointsPerPixel. This the amount the font should be scaled by when
you Issue commands such as DrawString(). A good way to calculate this
Is to use the follow formula:
multipler = GroupHeightInPoints / heightOfGroup
The height of the Group Is calculated fairly simply by calculating the
difference between the y coordinates of the bounding box of the shape. The
height of the Group can be calculated by using a convenience called
HSSFClientAnchor.GetAnchorHeightInPoints().
@author Glen Stampoultzis (glens at apache.org)
Construct an escher graphics object.
@param escherGroup The escher Group to Write the graphics calls into.
@param workbook The workbook we are using.
@param forecolor The foreground color to use as default.
@param verticalPointsPerPixel The font multiplier. (See class description for information on how this works.).
Constructs an escher graphics object.
@param escherGroup The escher Group to Write the graphics calls into.
@param workbook The workbook we are using.
@param foreground The foreground color to use as default.
@param verticalPointsPerPixel The font multiplier. (See class description for information on how this works.).
@param font The font to use.
Fills a (closed) polygon, as defined by a pair of arrays, which
hold the x and y coordinates.
This Draws the polygon, with nPoint line segments.
The first nPoint - 1 line segments are
Drawn between sequential points
(xPoints[i],yPoints[i],xPoints[i+1],yPoints[i+1]).
The line segment Is a closing one, from the last point to
the first (assuming they are different).
The area inside of the polygon Is defined by using an
even-odd Fill rule (also known as the alternating rule), and
the area inside of it Is Filled.
@param xPoints array of the x coordinates.
@param yPoints array of the y coordinates.
@param nPoints the total number of points in the polygon.
@see java.awt.Graphics#DrawPolygon(int[], int[], int)
Instances of this class keep track of multiple dependent cell evaluations due
to recursive calls to HSSFFormulaEvaluator.internalEvaluate().
The main purpose of this class Is to detect an attempt to evaluate a cell
that Is alReady being evaluated. In other words, it detects circular
references in spReadsheet formulas.
@author Josh Micich
Notifies this evaluation tracker that evaluation of the specified cell Is
about to start.
In the case of a true return code, the caller should
continue evaluation of the specified cell, and also be sure to call
endEvaluate() when complete.
In the case of a false return code, the caller should
return an evaluation result of
ErrorEval.CIRCULAR_REF_ERROR, and not call endEvaluate().
@return true if the specified cell has not been visited yet in the current
evaluation. false if the specified cell Is alReady being evaluated.
Notifies this evaluation tracker that the evaluation of the specified
cell Is complete.
Every successful call to startEvaluate must be followed by a
call to endEvaluate (recommended in a finally block) to enable
proper tracking of which cells are being evaluated at any point in time.
Assuming a well behaved client, parameters to this method would not be
required. However, they have been included to assert correct behaviour,
and form more meaningful error messages.
Stores the parameters that identify the evaluation of one cell.
@return human Readable string for debug purposes
This class makes an EvaluationCycleDetector instance available to
each thRead via a ThReadLocal in order to avoid Adding a parameter
to a few protected methods within HSSFFormulaEvaluator.
@author Josh Micich
@return
Stores width and height details about a font.
@author Glen Stampoultzis (glens at apache.org)
Construct the font details with the given name and height.
The font name.
The height of the font.
Gets the name of the font.
Gets the height.
Adds the char.
The c.
The width.
Retrieves the width of the specified Char. If the metrics for
a particular Char are not available it defaults to returning the
width for the 'W' Char.
The character.
Adds the chars.
The chars.
The widths.
Builds the font height property.
Name of the font.
Builds the font widths property.
Name of the font.
Builds the font chars property.
Name of the font.
Create an instance of
FontDetails
by loading them from the
provided property object.
the font name.
the property object holding the details of this
particular font.
a new FontDetails instance.
Gets the width of all Chars in a string.
The string to measure.
The width of the string for a 10 point font.
Split the given string into an array of strings using the given
delimiter.
The text.
The separator.
The max.
Common class for HSSFHeader and HSSFFooter
Common interface for NPOI.SS.UserModel.Header and NPOI.SS.UserModel.Footer
Gets or sets the left side of the header or footer.
The string representing the left side.
Gets or sets the center of the header or footer.
The string representing the center.
Gets or sets the right side of the header or footer.
The string representing the right side.
Creates the complete footer string based on the left, center, and middle
strings.
The parts.
Sets the header footer text.
the new header footer text (contains mark-up tags). Possibly
empty string never
Returns the string that represents the change in font size.
the new font size.
The special string to represent a new font size
Returns the string that represents the change in font.
the new font.
the fonts style, one of regular, italic, bold, italic bold or bold italic.
The special string to represent a new font size
Removes any fields (eg macros, page markers etc)
from the string.
Normally used to make some text suitable for showing
to humans, and the resultant text should not normally
be saved back into the document!
The text.
@return the internal text representation (combining center, left and right parts).
Possibly empty string if no header or footer is set. Never null.
Get the left side of the header or footer.
The string representing the left side.
Get the center of the header or footer.
The string representing the center.
Get the right side of the header or footer.
The string representing the right side..
Returns the string representing the current page number
The special string for page number.
Returns the string representing the number of pages.
The special string for the number of pages.
Returns the string representing the current date
The special string for the date
Gets the time.
The time.
Returns the string representing the current time
@return The special string for the time
Returns the string representing the current file name
The special string for the file name.
Returns the string representing the current tab (sheet) name
The special string for tab name.
Returns the string representing the start bold
The special string for start bold
Returns the string representing the end bold
The special string for end bold.
Returns the string representing the start underline
The special string for start underline.
Returns the string representing the end underline
The special string for end underline.
Returns the string representing the start double underline
The special string for start double underline.
Returns the string representing the end double underline
The special string for end double underline.
Are fields currently being Stripped from
the text that this {@link HeaderStories} returns?
Default is false, but can be changed
true if [are fields stripped]; otherwise, false.
Represents a special field in a header or footer,
eg the page number
The character sequence that marks this field
A special field that normally comes in a pair, eg
turn on underline / turn off underline
Instance to this class.
Explicit static constructor to tell C# compiler not to mark type as beforefieldinit.
Initialize AllFields.
Accessing the initialized instance.
An anchor Is what specifics the position of a shape within a client object
or within another containing shape.
@author Glen Stampoultzis (glens at apache.org)
Initializes a new instance of the class.
The DX1.
The dy1.
The DX2.
The dy2.
Gets or sets the DX1.
The DX1.
Gets or sets the dy1.
The dy1.
Gets or sets the dy2.
The dy2.
Gets or sets the DX2.
The DX2.
Gets a value indicating whether this instance is horizontally flipped.
true if this instance is horizontally flipped; otherwise, false.
Gets a value indicating whether this instance is vertically flipped.
true if this instance is vertically flipped; otherwise, false.
Represents autofiltering for the specified worksheet.
Filtering data is a quick and easy way to find and work with a subset of data in a range of cells or table.
For example, you can filter to see only the values that you specify, filter to see the top or bottom values,
or filter to quickly see duplicate values.
TODO YK: For now (Aug 2010) POI only supports Setting a basic autofilter on a range of cells.
In future, when we support more auto-filter functions like custom criteria, sort, etc. we will add
corresponding methods to this interface.
High level representation for Border Formatting component
of Conditional Formatting Settings
@author Dmitriy Kumshayev
@author Dmitriy Kumshayev
@author Yegor Kozlov
High level representation of a cell in a row of a spReadsheet.
Cells can be numeric, formula-based or string-based (text). The cell type
specifies this. String cells cannot conatin numbers and numeric cells cannot
contain strings (at least according to our model). Client apps should do the
conversions themselves. Formula cells have the formula string, as well as
the formula result, which can be numeric or string.
Cells should have their number (0 based) before being Added to a row. Only
cells that have values should be Added.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Dan Sherman (dsherman at Isisph.com)
@author Brian Sanders (kestrel at burdell dot org) Active Cell support
@author Yegor Kozlov cell comments support
High level representation of a cell in a row of a spreadsheet.
Cells can be numeric, formula-based or string-based (text). The cell type
specifies this. String cells cannot conatin numbers and numeric cells cannot
contain strings (at least according to our model). Client apps should do the
conversions themselves. Formula cells have the formula string, as well as
the formula result, which can be numeric or string.
Cells should have their number (0 based) before being Added to a row.
Set the cells type (numeric, formula or string)
Set a numeric value for the cell
the numeric value to set this cell to. For formulas we'll set the
precalculated value, for numerics we'll set its value. For other types we will change
the cell to a numeric cell and set its value.
Set a error value for the cell
the error value to set this cell to. For formulas we'll set the
precalculated value , for errors we'll set its value. For other types we will change
the cell to an error cell and set its value.
Converts the supplied date to its equivalent Excel numeric value and Sets that into the cell.
the numeric value to set this cell to. For formulas we'll set the
precalculated value, for numerics we'll set its value. For other types we will change
the cell to a numerics cell and set its value.
Set a rich string value for the cell.
value to set the cell to. For formulas we'll set the formula
string, for String cells we'll set its value. For other types we will
change the cell to a string cell and set its value.
If value is null then we will change the cell to a Blank cell.
Set a string value for the cell.
value to set the cell to. For formulas we'll set the formula
string, for String cells we'll set its value. For other types we will
change the cell to a string cell and set its value.
If value is null then we will change the cell to a blank cell.
Copy the cell to the target index. If the target cell exists, a new cell will be inserted before the existing cell.
target index
the new copied cell object
Sets formula for this cell.
the formula to Set, e.g. "SUM(C4:E4)"
.
Set a bool value for the cell
Sets this cell as the active cell for the worksheet
Removes the comment for this cell, if there is one.
zero-based column index of a column in a sheet.
zero-based row index of a row in the sheet that contains this cell
the sheet this cell belongs to
the row this cell belongs to
Set the cells type (numeric, formula or string)
Only valid for formula cells
Return a formula for the cell
if the cell type returned by GetCellType() is not CELL_TYPE_FORMULA
Get the value of the cell as a number.
if the cell type returned by GetCellType() is CELL_TYPE_STRING
if the cell value isn't a parsable double
Get the value of the cell as a date.
if the cell type returned by GetCellType() is CELL_TYPE_STRING
if the cell value isn't a parsable double
Get the value of the cell RichTextString
Get the value of the cell as an error code.
Get the value of the cell as a string
Get the value of the cell as a bool.
Return the cell's style.
comment associated with this cell
hyperlink associated with this cell
Only valid for array formula cells
range of the array formula group that the cell belongs to.
if this cell is part of group of cells having a common array formula.
Creates new Cell - Should only be called by HSSFRow. This Creates a cell
from scratch.
When the cell is initially Created it is Set to CellType.Blank. Cell types
can be Changed/overwritten by calling SetCellValue with the appropriate
type as a parameter although conversions from one type to another may be
prohibited.
Workbook record of the workbook containing this cell
Sheet record of the sheet containing this cell
the row of this cell
the column for this cell
Creates new Cell - Should only be called by HSSFRow. This Creates a cell
from scratch.
Workbook record of the workbook containing this cell
Sheet record of the sheet containing this cell
the row of this cell
the column for this cell
CellType.Numeric, CellType.String, CellType.Formula, CellType.Blank,
CellType.Boolean, CellType.Error
Creates an Cell from a CellValueRecordInterface. HSSFSheet uses this when
reading in cells from an existing sheet.
Workbook record of the workbook containing this cell
Sheet record of the sheet containing this cell
the Cell Value Record we wish to represent
private constructor to prevent blank construction
used internally -- given a cell value record, figure out its type
Set the cells type (numeric, formula or string)
Type of the cell.
Sets the cell type. The SetValue flag indicates whether to bother about
trying to preserve the current value in the new record if one is Created.
The SetCellValue method will call this method with false in SetValue
since it will overWrite the cell value later
Type of the cell.
if set to true [set value].
The row.
The col.
Index of the style.
Set a numeric value for the cell
the numeric value to Set this cell to. For formulas we'll Set the
precalculated value, for numerics we'll Set its value. For other types we
will Change the cell to a numeric cell and Set its value.
Set a date value for the cell. Excel treats dates as numeric so you will need to format the cell as
a date.
the date value to Set this cell to. For formulas we'll Set the
precalculated value, for numerics we'll Set its value. For other types we
will Change the cell to a numeric cell and Set its value.
Set a string value for the cell. Please note that if you are using
full 16 bit Unicode you should call SetEncoding() first.
value to Set the cell to. For formulas we'll Set the formula
string, for String cells we'll Set its value. For other types we will
Change the cell to a string cell and Set its value.
If value is null then we will Change the cell to a Blank cell.
set a error value for the cell
@param errorCode the error value to set this cell to. For formulas we'll set the
precalculated value , for errors we'll set
its value. For other types we will change the cell to an error
cell and set its value.
Set a string value for the cell. Please note that if you are using
full 16 bit Unicode you should call SetEncoding() first.
value to Set the cell to. For formulas we'll Set the formula
string, for String cells we'll Set its value. For other types we will
Change the cell to a string cell and Set its value.
If value is null then we will Change the cell to a Blank cell.
Should be called any time that a formula could potentially be deleted.
Does nothing if this cell currently does not hold a formula
Used to help format error messages
The cell type code.
Types the mismatch.
The expected type code.
The actual type code.
if set to true [is formula cell].
Checks the type of the formula cached value.
The expected type code.
The fr.
Set a bool value for the cell
the bool value to Set this cell to. For formulas we'll Set the
precalculated value, for bools we'll Set its value. For other types we
will Change the cell to a bool cell and Set its value.
Chooses a new bool value for the cell when its type is changing.
Usually the caller is calling SetCellType() with the intention of calling
SetCellValue(bool) straight afterwards. This method only exists to give
the cell a somewhat reasonable value until the SetCellValue() call (if at all).
TODO - perhaps a method like SetCellTypeAndValue(int, Object) should be introduced to avoid this
Applying a user-defined style (UDS) is special. Excel does not directly reference user-defined styles, but
instead create a 'proxy' ExtendedFormatRecord referencing the UDS as parent.
The proceudre to apply a UDS is as follows:
1. search for a ExtendedFormatRecord with parentIndex == style.getIndex()
and xfType == ExtendedFormatRecord.XF_CELL.
2. if not found then create a new ExtendedFormatRecord and copy all attributes from the user-defined style
and set the parentIndex to be style.getIndex()
3. return the index of the ExtendedFormatRecord, this will be assigned to the parent cell record
@param style the user style to apply
@return the index of a ExtendedFormatRecord record that will be referenced by the cell
Checks the bounds.
The cell num.
if the bounds are exceeded.
Sets this cell as the active cell for the worksheet
Returns a string representation of the cell
This method returns a simple representation,
anthing more complex should be in user code, with
knowledge of the semantics of the sheet being Processed.
Formula cells return the formula string,
rather than the formula result.
Dates are Displayed in dd-MMM-yyyy format
Errors are Displayed as #ERR<errIdx>
Removes the comment for this cell, if
there is one.
WARNING - some versions of excel will loose
all comments after performing this action!
Updates the cell record's idea of what
column it belongs in (0 based)
@param num the new cell number
The purpose of this method is to validate the cell state prior to modification
Called when this cell is modified.
The purpose of this method is to validate the cell state prior to modification.
the Workbook that this Cell is bound to
the HSSFRow this cell belongs to
Get the cells type (numeric, formula or string)
The type of the cell.
Gets or sets the cell formula.
The cell formula.
Get the value of the cell as a number. For strings we throw an exception.
For blank cells we return a 0.
The numeric cell value.
Get the value of the cell as a date. For strings we throw an exception.
For blank cells we return a null.
The date cell value.
Get the value of the cell as a string - for numeric cells we throw an exception.
For blank cells we return an empty string.
For formulaCells that are not string Formulas, we return empty String
The string cell value.
Get the value of the cell as a string - for numeric cells we throw an exception.
For blank cells we return an empty string.
For formulaCells that are not string Formulas, we return empty String
The rich string cell value.
Get the value of the cell as a bool. For strings, numbers, and errors, we throw an exception.
For blank cells we return a false.
true if [boolean cell value]; otherwise, false.
Get the value of the cell as an error code. For strings, numbers, and bools, we throw an exception.
For blank cells we return a 0.
The error cell value.
Get the style for the cell. This is a reference to a cell style contained in the workbook
object.
The cell style.
Should only be used by HSSFSheet and friends. Returns the low level CellValueRecordInterface record
the cell via the low level api.
Returns comment associated with this cell
The cell comment associated with this cell.
Gets the index of the column.
The index of the column.
Gets the (zero based) index of the row containing this cell
The index of the row.
Returns hyperlink associated with this cell
The hyperlink associated with this cell or null if not found
Only valid for formula cells
one of (CellType.Numeric,CellType.String, CellType.Boolean, CellType.Error) depending
on the cached value of the formula
High level representation of the style of a cell in a sheet of a workbook.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
Get the format string
set the font for this style
@param font a font object Created or retreived from the Workbook object
@see Workbook#CreateFont()
@see Workbook#GetFontAt(short)
Clones all the style information from another
CellStyle, onto this one. This
CellStyle will then have all the same
properties as the source, but the two may
be edited independently.
Any stylings on this CellStyle will be lost!
The source CellStyle could be from another
Workbook if you like. This allows you to
copy styles from one Workbook to another.
However, both of the CellStyles will need
to be of the same type (HSSFCellStyle or
XSSFCellStyle)
get the index within the Workbook (sequence within the collection of ExtnededFormat objects)
@return unique index number of the underlying record this style represents (probably you don't care
unless you're comparing which one is which)
get the index of the format
@see DataFormat
Gets the index of the font for this style
@see Workbook#GetFontAt(short)
get whether the cell's using this style are to be hidden
@return hidden - whether the cell using this style should be hidden
get whether the cell's using this style are to be locked
@return hidden - whether the cell using this style should be locked
get the type of horizontal alignment for the cell
@return align - the type of alignment
@see #ALIGN_GENERAL
@see #ALIGN_LEFT
@see #ALIGN_CENTER
@see #ALIGN_RIGHT
@see #ALIGN_FILL
@see #ALIGN_JUSTIFY
@see #ALIGN_CENTER_SELECTION
get whether the text should be wrapped
@return wrap text or not
get the type of vertical alignment for the cell
@return align the type of alignment
@see #VERTICAL_TOP
@see #VERTICAL_CENTER
@see #VERTICAL_BOTTOM
@see #VERTICAL_JUSTIFY
get the degree of rotation for the text in the cell
@return rotation degrees (between -90 and 90 degrees)
get the number of spaces to indent the text in the cell
@return indent - number of spaces
get the type of border to use for the left border of the cell
@return border type
@see #BORDER_NONE
@see #BORDER_THIN
@see #BORDER_MEDIUM
@see #BORDER_DASHED
@see #BORDER_DOTTED
@see #BORDER_THICK
@see #BORDER_DOUBLE
@see #BORDER_HAIR
@see #BORDER_MEDIUM_DASHED
@see #BORDER_DASH_DOT
@see #BORDER_MEDIUM_DASH_DOT
@see #BORDER_DASH_DOT_DOT
@see #BORDER_MEDIUM_DASH_DOT_DOT
@see #BORDER_SLANTED_DASH_DOT
get the type of border to use for the right border of the cell
@return border type
@see #BORDER_NONE
@see #BORDER_THIN
@see #BORDER_MEDIUM
@see #BORDER_DASHED
@see #BORDER_DOTTED
@see #BORDER_THICK
@see #BORDER_DOUBLE
@see #BORDER_HAIR
@see #BORDER_MEDIUM_DASHED
@see #BORDER_DASH_DOT
@see #BORDER_MEDIUM_DASH_DOT
@see #BORDER_DASH_DOT_DOT
@see #BORDER_MEDIUM_DASH_DOT_DOT
@see #BORDER_SLANTED_DASH_DOT
get the type of border to use for the top border of the cell
@return border type
@see #BORDER_NONE
@see #BORDER_THIN
@see #BORDER_MEDIUM
@see #BORDER_DASHED
@see #BORDER_DOTTED
@see #BORDER_THICK
@see #BORDER_DOUBLE
@see #BORDER_HAIR
@see #BORDER_MEDIUM_DASHED
@see #BORDER_DASH_DOT
@see #BORDER_MEDIUM_DASH_DOT
@see #BORDER_DASH_DOT_DOT
@see #BORDER_MEDIUM_DASH_DOT_DOT
@see #BORDER_SLANTED_DASH_DOT
get the type of border to use for the bottom border of the cell
@return border type
@see #BORDER_NONE
@see #BORDER_THIN
@see #BORDER_MEDIUM
@see #BORDER_DASHED
@see #BORDER_DOTTED
@see #BORDER_THICK
@see #BORDER_DOUBLE
@see #BORDER_HAIR
@see #BORDER_MEDIUM_DASHED
@see #BORDER_DASH_DOT
@see #BORDER_MEDIUM_DASH_DOT
@see #BORDER_DASH_DOT_DOT
@see #BORDER_MEDIUM_DASH_DOT_DOT
@see #BORDER_SLANTED_DASH_DOT
get the color to use for the left border
get the color to use for the left border
@return the index of the color defInition
get the color to use for the top border
@return hhe index of the color defInition
get the color to use for the left border
@return the index of the color defInition
get the fill pattern (??) - set to 1 to fill with foreground color
@return fill pattern
get the background fill color
@return fill color
get the foreground fill color
@return fill color
Gets or sets the color to use for the diagional border
The index of the color definition.
Gets or sets the line type to use for the diagional border
The line type.
Gets or sets the type of diagional border
.
The border diagional type.
Gets the color object representing the current
background fill, resolving indexes using
the supplied workbook.
This will work for both indexed and rgb
defined colors.
Gets the color object representing the current
foreground fill, resolving indexes using
the supplied workbook.
This will work for both indexed and rgb
defined colors.
Initializes a new instance of the class.
The index.
The record.
The workbook.
Initializes a new instance of the class.
The index.
The record.
The workbook.
Get the contents of the format string, by looking up
the DataFormat against the bound workbook
Get the contents of the format string, by looking up
the DataFormat against the supplied workbook
The workbook.
Set the font for this style
a font object Created or retreived from the HSSFWorkbook object
Gets the font for this style
The parent workbook that this style belongs to.
Verifies that this style belongs to the supplied Workbook.
Will throw an exception if it belongs to a different one.
This is normally called when trying to assign a style to a
cell, to ensure the cell and the style are from the same
workbook (if they're not, it won't work)
The workbook.
Checks if the background and foreground Fills are Set correctly when one
or the other is Set to the default color.
Works like the logic table below:
BACKGROUND FOREGROUND
NONE AUTOMATIC
0x41 0x40
NONE RED/ANYTHING
0x40 0xSOMETHING
Clones all the style information from another
HSSFCellStyle, onto this one. This
HSSFCellStyle will then have all the same
properties as the source, but the two may
be edited independently.
Any stylings on this HSSFCellStyle will be lost!
The source HSSFCellStyle could be from another
HSSFWorkbook if you like. This allows you to
copy styles from one HSSFWorkbook to another.
Clones all the style information from another
HSSFCellStyle, onto this one. This
HSSFCellStyle will then have all the same
properties as the source, but the two may
be edited independently.
Any stylings on this HSSFCellStyle will be lost!
The source HSSFCellStyle could be from another
HSSFWorkbook if you like. This allows you to
copy styles from one HSSFWorkbook to another.
The source.
Serves as a hash function for a particular type.
A hash code for the current .
Determines whether the specified is equal to the current .
The to compare with the current .
true if the specified is equal to the current ; otherwise, false.
The parameter is null.
Get the index within the HSSFWorkbook (sequence within the collection of ExtnededFormat objects)
Unique index number of the Underlying record this style represents (probably you don't care
Unless you're comparing which one is which)
Gets the parent style.
the parent style for this cell style.
In most cases this will be null, but in a few
cases there'll be a fully defined parent.
Get the index of the format
The data format.
Gets the index of the font for this style.
The index of the font.
Get whether the cell's using this style are to be hidden
whether the cell using this style should be hidden
Get whether the cell's using this style are to be locked
whether the cell using this style should be locked
Get the type of horizontal alignment for the cell
the type of alignment
Gets or sets a value indicating whether the text should be wrapped
true if [wrap text]; otherwise, false.
Gets or sets the vertical alignment for the cell.
the type of alignment
Gets or sets the degree of rotation for the text in the cell
The rotation degrees (between -90 and 90 degrees).
Gets or sets the number of spaces to indent the text in the cell
number of spaces
Gets or sets the type of border to use for the left border of the cell
The border type.
Gets or sets the type of border to use for the right border of the cell
The border type.
Gets or sets the type of border to use for the top border of the cell
The border type.
Gets or sets the type of border to use for the bottom border of the cell
The border type.
Gets or sets the color to use for the left border
The index of the color definition
Gets or sets the color to use for the left border.
The index of the color definition
Gets or sets the color to use for the top border
The index of the color definition.
Gets or sets the color to use for the left border
The index of the color definition.
Gets or sets the color to use for the diagional border
The index of the color definition.
Gets or sets the line type to use for the diagional border
The line type.
Gets or sets the type of diagional border
.
The border diagional type.
Gets or sets whether the cell is shrink-to-fit
Gets or sets the fill pattern. - Set to 1 to Fill with foreground color
The fill pattern.
Gets or sets the color of the fill background.
The color of the fill background.
Set the background Fill color.
cs.SetFillPattern(HSSFCellStyle.FINE_DOTS );
cs.SetFillBackgroundColor(new HSSFColor.RED().Index);
optionally a Foreground and background Fill can be applied:
Note: Ensure Foreground color is Set prior to background
cs.SetFillPattern(HSSFCellStyle.FINE_DOTS );
cs.SetFillForegroundColor(new HSSFColor.BLUE().Index);
cs.SetFillBackgroundColor(new HSSFColor.RED().Index);
or, for the special case of SOLID_Fill:
cs.SetFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
cs.SetFillForegroundColor(new HSSFColor.RED().Index);
It is necessary to Set the Fill style in order
for the color to be shown in the cell.
Gets or sets the foreground Fill color
Fill color.
@see org.apache.poi.hssf.usermodel.HSSFPalette#GetColor(short)
Gets the name of the user defined style.
Returns null for built in styles, and
styles where no name has been defined
create anchor from existing file
@param escherChildAnchorRecord
create anchor from scratch
@param dx1 x coordinate of the left up corner
@param dy1 y coordinate of the left up corner
@param dx2 x coordinate of the right down corner
@param dy2 y coordinate of the right down corner
@param dx1 x coordinate of the left up corner
@param dy1 y coordinate of the left up corner
@param dx2 x coordinate of the right down corner
@param dy2 y coordinate of the right down corner
A client anchor Is attached to an excel worksheet. It anchors against a
top-left and buttom-right cell.
@author Glen Stampoultzis (glens at apache.org)
A client anchor is attached to an excel worksheet. It anchors against a
top-left and bottom-right cell.
@author Yegor Kozlov
Returns the column (0 based) of the first cell.
@return 0-based column of the first cell.
Returns the column (0 based) of the second cell.
@return 0-based column of the second cell.
Returns the row (0 based) of the first cell.
@return 0-based row of the first cell.
Returns the row (0 based) of the second cell.
@return 0-based row of the second cell.
Returns the x coordinate within the first cell
@return the x coordinate within the first cell
Returns the y coordinate within the first cell
@return the y coordinate within the first cell
Sets the y coordinate within the second cell
@return the y coordinate within the second cell
Returns the x coordinate within the second cell
@return the x coordinate within the second cell
s the anchor type
0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
@return the anchor type
@see #MOVE_AND_RESIZE
@see #MOVE_DONT_RESIZE
@see #DONT_MOVE_AND_RESIZE
Creates a new client anchor and defaults all the anchor positions to 0.
Creates a new client anchor and Sets the top-left and bottom-right
coordinates of the anchor.
the x coordinate within the first cell.
the y coordinate within the first cell.
the x coordinate within the second cell.
the y coordinate within the second cell.
the column (0 based) of the first cell.
the row (0 based) of the first cell.
the column (0 based) of the second cell.
the row (0 based) of the second cell.
Calculates the height of a client anchor in points.
the sheet the anchor will be attached to
the shape height.
Gets the row height in points.
The sheet.
The row num.
Sets the top-left and bottom-right
coordinates of the anchor
the column (0 based) of the first cell.
the row (0 based) of the first cell.
the x coordinate within the first cell.
the y coordinate within the first cell.
the column (0 based) of the second cell.
the row (0 based) of the second cell.
the x coordinate within the second cell.
the y coordinate within the second cell.
Checks the range.
The value.
The min range.
The max range.
Name of the variable.
Gets or sets the col1.
The col1.
Gets or sets the col2.
The col2.
Gets or sets the row1.
The row1.
Gets or sets the row2.
The row2.
Gets a value indicating whether this instance is horizontally flipped.
true if the anchor goes from right to left; otherwise, false.
Gets a value indicating whether this instance is vertically flipped.
true if the anchor goes from bottom to top.; otherwise, false.
Gets the anchor type
0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
The type of the anchor.
Represents a cell comment - a sticky note associated with a cell.
@author Yegor Kozlov
A textbox Is a shape that may hold a rich text string.
@author Glen Stampoultzis (glens at apache.org)
Construct a new textbox with the given parent and anchor.
The parent.
One of HSSFClientAnchor or HSSFChildAnchor
Gets or sets the left margin within the textbox.
The margin left.
Gets or sets the right margin within the textbox.
The margin right.
Gets or sets the top margin within the textbox
The top margin.
Gets or sets the bottom margin within the textbox.
The margin bottom.
Gets or sets the horizontal alignment.
The horizontal alignment.
Gets or sets the vertical alignment.
The vertical alignment.
Sets whether this comment is visible.
@return true if the comment is visible, false otherwise
Return the row of the cell that Contains the comment
@return the 0-based row of the cell that Contains the comment
Return the column of the cell that Contains the comment
@return the 0-based column of the cell that Contains the comment
Name of the original comment author
@return the name of the original author of the comment
Fetches the rich text string of the comment
Construct a new comment with the given parent and anchor.
defines position of this anchor in the sheet
Initializes a new instance of the class.
The note.
The txo.
Gets or sets a value indicating whether this is visible.
true if visible; otherwise, false.
Sets whether this comment Is visible.
@return
true
if the comment Is visible,
false
otherwise
Gets or sets the row of the cell that Contains the comment
the 0-based row of the cell that Contains the comment
Gets or sets the column of the cell that Contains the comment
the 0-based column of the cell that Contains the comment
Gets or sets the name of the original comment author
the name of the original author of the comment
Gets the note record.
the underlying Note record.
HSSFConditionalFormatting class encapsulates all Settings of Conditional Formatting.
The class can be used to make a copy HSSFConditionalFormatting Settings
HSSFConditionalFormatting cf = sheet.GetConditionalFormattingAt(index);
newSheet.AddConditionalFormatting(cf);
or to modify existing Conditional Formatting Settings (formatting regions and/or rules).
Use {@link HSSFSheet#GetConditionalFormattingAt(int)} to Get access to an instance of this class.
To Create a new Conditional Formatting Set use the following approach:
// Define a Conditional Formatting rule, which triggers formatting
// when cell's value Is greater or equal than 100.0 and
// applies patternFormatting defined below.
HSSFConditionalFormattingRule rule = sheet.CreateConditionalFormattingRule(
ComparisonOperator.GE,
"100.0", // 1st formula
null // 2nd formula Is not used for comparison operator GE
);
// Create pattern with red background
HSSFPatternFormatting patternFmt = rule.cretePatternFormatting();
patternFormatting.SetFillBackgroundColor(HSSFColor.RED.index);
// Define a region containing first column
Region [] regions =
{
new Region(1,(short)1,-1,(short)1)
};
// Apply Conditional Formatting rule defined above to the regions
sheet.AddConditionalFormatting(regions, rule);
@author Dmitriy Kumshayev
The ConditionalFormatting class encapsulates all Settings of Conditional Formatting.
The class can be used
-
to make a copy ConditionalFormatting Settings.
For example:
ConditionalFormatting cf = sheet.GetConditionalFormattingAt(index);
newSheet.AddConditionalFormatting(cf);
or to modify existing Conditional Formatting Settings (formatting regions and/or rules).
Use {@link NPOI.HSSF.UserModel.Sheet#getSheetConditionalFormatting()} to Get access to an instance of this class.
To create a new Conditional Formatting Set use the following approach:
// Define a Conditional Formatting rule, which triggers formatting
// when cell's value is greater or equal than 100.0 and
// applies patternFormatting defined below.
ConditionalFormattingRule rule = sheet.CreateConditionalFormattingRule(
ComparisonOperator.GE,
"100.0", // 1st formula
null // 2nd formula is not used for comparison operator GE
);
// Create pattern with red background
PatternFormatting patternFmt = rule.CretePatternFormatting();
patternFormatting.FillBackgroundColor(IndexedColor.RED.Index);
// Define a region Containing first column
Region [] regions =
{
new Region(1,(short)1,-1,(short)1)
};
// Apply Conditional Formatting rule defined above to the regions
sheet.AddConditionalFormatting(regions, rule);
@author Dmitriy Kumshayev
@author Yegor Kozlov
@return array of CellRangeAddresss. Never null
Replaces an existing Conditional Formatting rule at position idx.
Excel allows to create up to 3 Conditional Formatting rules.
This method can be useful to modify existing Conditional Formatting rules.
@param idx position of the rule. Should be between 0 and 2.
@param cfRule - Conditional Formatting rule
Add a Conditional Formatting rule.
Excel allows to create up to 3 Conditional Formatting rules.
@param cfRule - Conditional Formatting rule
@return the Conditional Formatting rule at position idx.
@return number of Conditional Formatting rules.
Initializes a new instance of the class.
The workbook.
The cf aggregate.
Gets the array of Regions
Gets array of CellRangeAddresses
Replaces an existing Conditional Formatting rule at position idx.
Excel allows to Create up to 3 Conditional Formatting rules.
This method can be useful to modify existing Conditional Formatting rules.
position of the rule. Should be between 0 and 2.
Conditional Formatting rule
Add a Conditional Formatting rule.
Excel allows to Create up to 3 Conditional Formatting rules.
Conditional Formatting rule
Gets the Conditional Formatting rule at position idx
The index.
Returns a that represents the current .
A that represents the current .
Gets the CF records aggregate.
Gets the number of Conditional Formatting rules.
The number of rules.
High level representation of Conditional Formatting Rule.
It allows to specify formula based conditions for the Conditional Formatting
and the formatting Settings such as font, border and pattern.
@author Dmitriy Kumshayev
Represents a description of a conditional formatting rule
@author Dmitriy Kumshayev
@author Yegor Kozlov
Create a new border formatting structure if it does not exist,
otherwise just return existing object.
@return - border formatting object, never returns null
.
@return - border formatting object if defined, null
otherwise
Create a new font formatting structure if it does not exist,
otherwise just return existing object.
@return - font formatting object, never returns null
.
@return - font formatting object if defined, null
otherwise
Create a new pattern formatting structure if it does not exist,
otherwise just return existing object.
@return - pattern formatting object, never returns null
.
@return - pattern formatting object if defined, null
otherwise
Type of conditional formatting rule.
MUST be either {@link #CONDITION_TYPE_CELL_VALUE_IS} or {@link #CONDITION_TYPE_FORMULA}
@return the type of condition
The comparison function used when the type of conditional formatting is Set to
{@link #CONDITION_TYPE_CELL_VALUE_IS}
MUST be a constant from {@link ComparisonOperator}
@return the conditional format operator
The formula used to Evaluate the first operand for the conditional formatting rule.
If the condition type is {@link #CONDITION_TYPE_CELL_VALUE_IS},
this field is the first operand of the comparison.
If type is {@link #CONDITION_TYPE_FORMULA}, this formula is used
to determine if the conditional formatting is applied.
If comparison type is {@link #CONDITION_TYPE_FORMULA} the formula MUST be a Boolean function
@return the first formula
The formula used to Evaluate the second operand of the comparison when
comparison type is {@link #CONDITION_TYPE_CELL_VALUE_IS} and operator
is either {@link ComparisonOperator#BETWEEN} or {@link ComparisonOperator#NOT_BETWEEN}
@return the second formula
@return - font formatting object if defined, null otherwise
Create a new font formatting structure if it does not exist,
otherwise just return existing object.
@return - font formatting object, never returns null.
@return - border formatting object if defined, null otherwise
Create a new border formatting structure if it does not exist,
otherwise just return existing object.
@return - border formatting object, never returns null.
@return - pattern formatting object if defined, null otherwise
Create a new pattern formatting structure if it does not exist,
otherwise just return existing object.
@return - pattern formatting object, never returns null.
@return - the conditiontype for the cfrule
@return - the comparisionoperatation for the cfrule
An object that handles instantiating concrete
classes of the various instances one needs for
HSSF and XSSF.
Works around a major shortcoming in Java, where we
can't have static methods on interfaces or abstract
classes.
This allows you to get the appropriate class for
a given interface, without you having to worry
about if you're dealing with HSSF or XSSF, despite
Java being quite rubbish.
Creates a new RichTextString instance
@param text The text to Initialise the RichTextString with
Creates a new DataFormat instance
Creates a new Hyperlink, of the given type
Creates FormulaEvaluator - an object that Evaluates formula cells.
@return a FormulaEvaluator instance
Creates a HSSFFormulaEvaluator, the object that Evaluates formula cells.
@return a HSSFFormulaEvaluator instance
Creates a HSSFClientAnchor. Use this object to position drawing object in a sheet
@return a HSSFClientAnchor instance
@see NPOI.SS.usermodel.Drawing
get the format index that matches the given format string.
Creates a new format if one is not found. Aliases text to the proper format.
@param format string matching a built in format
@return index of format.
get the format string that matches the given format index
@param index of a format
@return string represented at index of format or null if there is not a format at that index
The first user-defined format starts at 164.
Construncts a new data formatter. It takes a workbook to have
access to the workbooks format records.
the workbook the formats are tied to.
Get the format index that matches the given format string
Automatically Converts "text" to excel's format string to represent text.
The format string matching a built in format.
index of format or -1 if Undefined.
Get the format index that matches the given format
string, creating a new format entry if required.
Aliases text to the proper format as required.
The format string matching a built in format.
index of format.
Get the format string that matches the given format index
The index of a format.
string represented at index of format or null if there Is not a format at that index
Get the format string that matches the given format index
The index of a built in format.
string represented at index of format or null if there Is not a builtin format at that index
Ensures that the formats list can hold entries
up to and including the entry with this index
Get the number of builtin and reserved builtinFormats
number of builtin and reserved builtinFormats
HSSF wrapper for a cell under evaluation
@author Josh Micich
HSSF wrapper for a sheet under evaluation
@author Josh Micich
Internal POI use only
@author Josh Micich
Abstracts a workbook for the purpose of converting formula To text.
For POI internal use only
@author Josh Micich
@return null if externSheetIndex refers To a sheet inside the current workbook
Abstracts a workbook for the purpose of formula parsing.
For POI internal use only
@author Josh Micich
named range name matching is case insensitive
The name.
Index of the sheet.
Gets the name XPTG.
The name.
Gets the externSheet index for a sheet from this workbook
Name of the sheet.
Gets the externSheet index for a sheet from an external workbook
Name of the workbook, e.g. "BudGet.xls"
a name of a sheet in that workbook
Returns an enum holding spReadhseet properties specific to an Excel version (
max column and row numbers, max arguments to a function, etc.)
Abstracts a name record for formula evaluation.
For POI internal use only
@author Josh Micich
Represents a Font used in a workbook.
@version 1.0-pre
@author Andrew C. Oliver
get the name for the font (i.e. Arial)
@return String representing the name of the font to use
get the font height in unit's of 1/20th of a point. Maybe you might want to
use the GetFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
@return short - height in 1/20ths of a point
@see #GetFontHeightInPoints()
get the font height
@return short - height in the familiar unit of measure - points
@see #GetFontHeight()
get whether to use italics or not
@return italics or not
get whether to use a strikeout horizontal line through the text or not
@return strikeout or not
get the color for the font
@return color to use
@see #COLOR_NORMAL
@see #COLOR_RED
@see NPOI.HSSF.usermodel.HSSFPalette#GetColor(short)
get normal,super or subscript.
@return offset type to use (none,super,sub)
get type of text underlining to use
@return underlining type
get character-set to use.
@return character-set
@see #ANSI_CHARSET
@see #DEFAULT_CHARSET
@see #SYMBOL_CHARSET
get the index within the XSSFWorkbook (sequence within the collection of Font objects)
@return unique index number of the underlying record this Font represents (probably you don't care
unless you're comparing which one is which)
Initializes a new instance of the class.
The index.
The record.
get the color value for the font
HSSFWorkbook
Returns a that represents the current .
A that represents the current .
Serves as a hash function for a particular type.
A hash code for the current .
Determines whether the specified is equal to the current .
The to compare with the current .
true if the specified is equal to the current ; otherwise, false.
The parameter is null.
Get the name for the font (i.e. Arial)
the name of the font to use
Get the index within the HSSFWorkbook (sequence within the collection of Font objects)
Unique index number of the Underlying record this Font represents (probably you don't care
Unless you're comparing which one is which)
Get or sets the font height in Unit's of 1/20th of a point. Maybe you might want to
use the GetFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
height in 1/20ths of a point.
Gets or sets the font height in points.
height in the familiar Unit of measure - points.
Gets or sets whether to use italics or not
true if this instance is italic; otherwise, false.
Get whether to use a strikeout horizontal line through the text or not
strikeout or not
Gets or sets the color for the font.
The color to use.
Gets or sets the boldness to use
The boldweight.
Gets or sets normal,base or subscript.
offset type to use (none,base,sub)
Gets or sets the type of text Underlining to use
The Underlining type.
Gets or sets the char set to use.
The char set.
High level representation for Font Formatting component
of Conditional Formatting Settings
@author Dmitriy Kumshayev
High level representation for Font Formatting component
of Conditional Formatting Settings
@author Dmitriy Kumshayev
@author Yegor Kozlov
Set font style options.
@param italic - if true, Set posture style to italic, otherwise to normal
@param bold if true, Set font weight to bold, otherwise to normal
Set font style options to default values (non-italic, non-bold)
get or set the type of super or subscript for the font
get or set font color index
get or set the height of the font in 1/20th point units
get or set the type of underlining for the font
Get whether the font weight is Set to bold or not
@return bold - whether the font is bold or not
@return true if font style was Set to italic
@return
@see org.apache.poi.hssf.record.cf.FontFormatting#GetRawRecord()
Set font style options.
@param italic - if true, Set posture style to italic, otherwise to normal
@param bold- if true, Set font weight to bold, otherwise to normal
Set font style options to default values (non-italic, non-bold)
Get the type of base or subscript for the font
@return base or subscript option
@return font color index
Gets the height of the font in 1/20th point Units
@return fontheight (in points/20); or -1 if not modified
Get the font weight for this font (100-1000dec or 0x64-0x3e8). Default Is
0x190 for normal and 0x2bc for bold
@return bw - a number between 100-1000 for the fonts "boldness"
Get the type of Underlining for the font
@return font Underlining type
@see #U_NONE
@see #U_SINGLE
@see #U_DOUBLE
@see #U_SINGLE_ACCOUNTING
@see #U_DOUBLE_ACCOUNTING
Get whether the font weight Is Set to bold or not
@return bold - whether the font Is bold or not
@return true if escapement type was modified from default
@return true if font cancellation was modified from default
@return true if font outline type was modified from default
@return true if font shadow type was modified from default
@return true if font style was modified from default
@return true if font style was Set to italic
@return true if font outline Is on
@return true if font shadow Is on
@return true if font strikeout Is on
@return true if font Underline type was modified from default
@return true if font weight was modified from default
Class to Read and manipulate the footer.
The footer works by having a left, center, and right side. The total cannot
be more that 255 bytes long. One uses this class by Getting the HSSFFooter
from HSSFSheet and then Getting or Setting the left, center, and right side.
For special things (such as page numbers and date), one can use a the methods
that return the Chars used to represent these. One can also Change the
fonts by using similar methods.
@author Shawn Laubach (slaubach at apache dot org)
Common defInition of a HSSF or XSSF page footer.
For a list of all the different fields that can be
placed into a footer, such as page number,
bold, underline etc, see
Initializes a new instance of the class.
Footer record to create the footer with
Gets the raw footer.
The raw footer.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Evaluates formula cells.
For performance reasons, this class keeps a cache of all previously calculated intermediate
cell values. Be sure to call {@link #ClearAllCachedResultValues()} if any workbook cells are Changed between
calls to Evaluate~ methods on this class.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Josh Micich
Should be called whenever there are Changes to input cells in the Evaluated workbook.
Failure to call this method after changing cell values will cause incorrect behaviour
of the Evaluate~ methods of this class
Should be called to tell the cell value cache that the specified (value or formula) cell
has Changed.
Failure to call this method after changing cell values will cause incorrect behaviour
of the Evaluate~ methods of this class
Should be called to tell the cell value cache that the specified cell has just become a
formula cell, or the formula text has Changed
Should be called to tell the cell value cache that the specified (value or formula) cell
has changed.
Failure to call this method after changing cell values will cause incorrect behaviour
of the evaluate~ methods of this class
If cell Contains a formula, the formula is Evaluated and returned,
else the CellValue simply copies the appropriate cell value from
the cell and also its cell type. This method should be preferred over
EvaluateInCell() when the call should not modify the contents of the
original cell.
@param cell
Loops over all cells in all sheets of the associated workbook.
For cells that contain formulas, their formulas are evaluated,
and the results are saved. These cells remain as formula cells.
For cells that do not contain formulas, no changes are made.
This is a helpful wrapper around looping over all cells, and
calling evaluateFormulaCell on each one.
If cell Contains formula, it Evaluates the formula,
and saves the result of the formula. The cell
remains as a formula cell.
Else if cell does not contain formula, this method leaves
the cell unChanged.
Note that the type of the formula result is returned,
so you know what kind of value is also stored with
the formula.
int EvaluatedCellType = Evaluator.evaluateFormulaCell(cell);
Be aware that your cell will hold both the formula,
and the result. If you want the cell Replaced with
the result of the formula, use {@link #EvaluateInCell(Cell)}
@param cell The cell to Evaluate
@return The type of the formula result (the cell's type remains as Cell.CELL_TYPE_FORMULA however)
If cell Contains formula, it Evaluates the formula, and
Puts the formula result back into the cell, in place
of the old formula.
Else if cell does not contain formula, this method leaves
the cell unChanged.
Note that the same instance of Cell is returned to
allow chained calls like:
int EvaluatedCellType = Evaluator.evaluateInCell(cell).getCellType();
Be aware that your cell value will be Changed to hold the
result of the formula. If you simply want the formula
value comPuted for you, use {@link #EvaluateFormulaCell(Cell)}
@param cell
* Perform detailed output of formula evaluation for next evaluation only?
* Is for developer use only (also developers using POI for their XLS files).
* Log-Level WARN is for basic info, INFO for detailed information. These quite
* high levels are used because you have to explicitly enable this specific logging.
* @param value whether to perform detailed output
@param stabilityClassifier used to optimise caching performance. Pass null
for the (conservative) assumption that any cell may have its definition changed after
evaluation begins.
@param udfFinder pass null
for default (AnalysisToolPak only)
@param stabilityClassifier used to optimise caching performance. Pass null
for the (conservative) assumption that any cell may have its definition changed after
evaluation begins.
@param udfFinder pass null
for default (AnalysisToolPak only)
Coordinates several formula evaluators together so that formulas that involve external
references can be evaluated.
@param workbookNames the simple file names used to identify the workbooks in formulas
with external links (for example "MyData.xls" as used in a formula "[MyData.xls]Sheet1!A1")
@param evaluators all evaluators for the full set of workbooks required by the formulas.
If cell Contains a formula, the formula is Evaluated and returned,
else the CellValue simply copies the appropriate cell value from
the cell and also its cell type. This method should be preferred over
EvaluateInCell() when the call should not modify the contents of the
original cell.
@param cell
If cell contains a formula, the formula is evaluated and returned,
else the CellValue simply copies the appropriate cell value from
the cell and also its cell type. This method should be preferred over
evaluateInCell() when the call should not modify the contents of the
original cell.
@param cell may be null signifying that the cell is not present (or blank)
@return null if the supplied cell is null or blank
Should be called whenever there are major changes (e.g. moving sheets) to input cells
in the evaluated workbook. If performance is not critical, a single call to this method
may be used instead of many specific calls to the notify~ methods.
Failure to call this method after changing cell values will cause incorrect behaviour
of the evaluate~ methods of this class
Should be called to tell the cell value cache that the specified (value or formula) cell
has changed.
Failure to call this method after changing cell values will cause incorrect behaviour
of the evaluate~ methods of this class
Should be called to tell the cell value cache that the specified cell has just been
deleted.
Failure to call this method after changing cell values will cause incorrect behaviour
of the evaluate~ methods of this class
Should be called to tell the cell value cache that the specified (value or formula) cell
has changed.
Failure to call this method after changing cell values will cause incorrect behaviour
of the evaluate~ methods of this class
If cell Contains formula, it Evaluates the formula,
and saves the result of the formula. The cell
remains as a formula cell.
Else if cell does not contain formula, this method leaves
the cell UnChanged.
Note that the type of the formula result is returned,
so you know what kind of value is also stored with
the formula.
int EvaluatedCellType = evaluator.EvaluateFormulaCell(cell);
Be aware that your cell will hold both the formula,
and the result. If you want the cell Replaced with
the result of the formula, use {@link #EvaluateInCell(HSSFCell)}
@param cell The cell to Evaluate
@return The type of the formula result (the cell's type remains as CellType.Formula however)
Returns a CellValue wrapper around the supplied ValueEval instance.
@param eval
If cell Contains formula, it Evaluates the formula, and
puts the formula result back into the cell, in place
of the old formula.
Else if cell does not contain formula, this method leaves
the cell UnChanged.
Note that the same instance of Cell is returned to
allow chained calls like:
int EvaluatedCellType = evaluator.EvaluateInCell(cell).CellType;
Be aware that your cell value will be Changed to hold the
result of the formula. If you simply want the formula
value computed for you, use {@link #EvaluateFormulaCell(HSSFCell)}
@param cell
Loops over all cells in all sheets of the supplied
workbook.
For cells that contain formulas, their formulas are
Evaluated, and the results are saved. These cells
remain as formula cells.
For cells that do not contain formulas, no Changes
are made.
This is a helpful wrapper around looping over all
cells, and calling EvaluateFormulaCell on each one.
Loops over all cells in all sheets of the supplied
workbook.
For cells that contain formulas, their formulas are
evaluated, and the results are saved. These cells
remain as formula cells.
For cells that do not contain formulas, no changes
are made.
This is a helpful wrapper around looping over all
cells, and calling evaluateFormulaCell on each one.
Whether to ignore missing references to external workbooks and
use cached formula results in the main workbook instead.
In some cases exetrnal workbooks referenced by formulas in the main workbook are not avaiable.
With this method you can control how POI handles such missing references:
- by default ignoreMissingWorkbooks=false and POI throws {@link org.apache.poi.ss.formula.CollaboratingWorkbooksEnvironment.WorkbookNotFoundException}
if an external reference cannot be resolved
- if ignoreMissingWorkbooks=true then POI uses cached formula result
that already exists in the main workbook
@param ignore whether to ignore missing references to external workbooks
{@inheritDoc}
Class to Read and manipulate the header.
The header works by having a left, center, and right side. The total cannot
be more that 255 bytes long. One uses this class by Getting the HSSFHeader
from HSSFSheet and then Getting or Setting the left, center, and right side.
For special things (such as page numbers and date), one can use a the methods
that return the Chars used to represent these. One can also Change the
fonts by using similar methods.
@author Shawn Laubach (slaubach at apache dot org)
Common defInition of a HSSF or XSSF page header.
For a list of all the different fields that can be
placed into a header, such as page number,
bold, underline etc, see
Initializes a new instance of the class.
Footer record to Create the footer with
Gets the raw footer.
The raw footer.
Represents an Excel hyperlink.
@author Yegor Kozlov (yegor at apache dot org)
Represents an Excel hyperlink.
Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, patrh to a file, etc.
text label for this hyperlink
the type of this hyperlink
the row of the first cell that Contains the hyperlink
the row of the last cell that Contains the hyperlink
the column of the first cell that Contains the hyperlink
the column of the last cell that Contains the hyperlink
Low-level record object that stores the actual hyperlink data
If we Create a new hypelrink remember its type
Initializes a new instance of the class.
The type of hyperlink to Create.
Initializes a new instance of the class.
The record.
Gets or sets the row of the first cell that Contains the hyperlink
the 0-based row of the cell that Contains the hyperlink.
Gets or sets the row of the last cell that Contains the hyperlink
the 0-based row of the last cell that Contains the hyperlink
Gets or sets the column of the first cell that Contains the hyperlink
the 0-based column of the first cell that Contains the hyperlink
Gets or sets the column of the last cell that Contains the hyperlink
the 0-based column of the last cell that Contains the hyperlink
Gets or sets Hypelink Address. Depending on the hyperlink type it can be URL, e-mail, patrh to a file, etc.
the Address of this hyperlink
Gets or sets the text mark.
The text mark.
Gets or sets the short filename.
The short filename.
Gets or sets the text label for this hyperlink
text to Display
Gets the type of this hyperlink
the type of this hyperlink
High Level Represantion of Named Range
@author Libin Roman (Vista Portal LDT. Developer)
Represents a defined name for a range of cells.
A name is a meaningful shorthand that makes it easier to understand the purpose of a
cell reference, constant or a formula.
Indicates that the defined name refers to a user-defined function.
This attribute is used when there is an add-in or other code project associated with the file.
@param value true indicates the name refers to a function.
Get the sheets name which this named range is referenced to
@return sheet name, which this named range refered to
Gets the name of the named range
@return named range name
Returns the formula that the name is defined to refer to.
@return the reference for this name, null
if it has not been set yet. Never empty string
@see #SetRefersToFormula(String)
Checks if this name is a function name
@return true if this name is a function name
Checks if this name points to a cell that no longer exists
@return true if the name refers to a deleted cell, false otherwise
Returns the sheet index this name applies to.
@return the sheet index this name applies to, -1 if this name applies to the entire workbook
Returns the comment the user provided when the name was Created.
@return the user comment for this named range
Creates new HSSFName - called by HSSFWorkbook to Create a sheet from
scratch.
lowlevel Workbook object associated with the sheet.
the Name Record
Sets the NameParsedFormula structure that specifies the formula for the defined name.
the sequence of {@link Ptg}s for the formula.
Indicates that the defined name refers to a user-defined function.
This attribute is used when there is an add-in or other code project associated with the file.
@param value true indicates the name refers to a function.
Returns a that represents the current .
A that represents the current .
Gets or sets the sheets name which this named range is referenced to
sheet name, which this named range refered to
Gets or sets the name of the named range
named range name
Returns the sheet index this name applies to.
@return the sheet index this name applies to, -1 if this name applies to the entire workbook
Tests if this name points to a cell that no longer exists
true if the name refers to a deleted cell; otherwise, false.
Gets a value indicating whether this instance is function name.
true if this instance is function name; otherwise, false.
Represents binary object (i.e. OLE) data stored in the file. Eg. A GIF, JPEG etc...
@author Daniel Noll
Represents a escher picture. Eg. A GIF, JPEG etc...
@author Glen Stampoultzis
@author Yegor Kozlov (yegor at apache.org)
Repersents a picture in a SpreadsheetML document
@author Yegor Kozlov
Reset the image to the original size.
Reset the image to the original size.
@param scale the amount by which image dimensions are multiplied relative to the original size.
resize(1.0)
Sets the original size, resize(0.5)
resize to 50% of the original,
resize(2.0)
resizes to 200% of the original.
Return picture data for this picture
@return picture data for this picture
width of 1px in columns with default width in Units of 1/256 of a Char width
width of 1px in columns with overridden width in Units of 1/256 of a Char width
Height of 1px of a row
Constructs a picture object.
The parent.
The anchor.
Reset the image to the original size.
Reset the image to the original size.
Calculate the preferred size for this picture.
the amount by which image dimensions are multiplied relative to the original size.
HSSFClientAnchor with the preferred size for this image
Calculate the preferred size for this picture.
HSSFClientAnchor with the preferred size for this image
Gets the column width in pixels.
The column.
Gets the row height in pixels.
The row
Gets the width of the pixel.
The column.
The metadata of PNG and JPEG can contain the width of a pixel in millimeters.
Return the the "effective" dpi calculated as
25.4/HorizontalPixelSize
and
25.4/VerticalPixelSize
. Where 25.4 is the number of mm in inch.
The image.
the resolution
Return the dimension of this image
image dimension
Gets or sets the index of the picture.
The index of the picture.
Return picture data for this shape
@return picture data for this shape
The color applied to the lines of this shape.
Reference to the filesystem root, required for retrieving the object data.
Gets the object data. Only call for ones that have
data though. See {@link #hasDirectoryEntry()}
@return the object data as an OLE2 directory.
@ if there was an error Reading the data.
Returns the data portion, for an ObjectData
that doesn't have an associated POIFS Directory
Entry
Does this ObjectData have an associated POIFS
Directory Entry?
(Not all do, those that don't have a data portion)
Finds the EmbeddedObjectRefSubRecord, or throws an
Exception if there wasn't one
Returns the OLE2 Class Name of the object
Excel can Get cranky if you give it files containing too
many (especially duplicate) objects, and this class can
help to avoid those.
In general, it's much better to make sure you don't
duplicate the objects in your code, as this is likely
to be much faster than creating lots and lots of
excel objects+records, only to optimise them down to
many fewer at a later stage.
However, sometimes this is too hard / tricky to do, which
is where the use of this class comes in.
Goes through the Workbook, optimising the fonts by
removing duplicate ones.
For now, only works on fonts used in HSSFCellStyle
and HSSFRichTextString. Any other font uses
(eg charts, pictures) may well end up broken!
This can be a slow operation, especially if you have
lots of cells, cell styles or rich text strings
The workbook in which to optimise the fonts
Goes through the Wokrbook, optimising the cell styles
by removing duplicate ones and ones that aren't used.
For best results, optimise the fonts via a call to
OptimiseFonts(HSSFWorkbook) first
The workbook in which to optimise the cell styles
Represents a workbook color palette.
Internally, the XLS format refers to colors using an offset into the palette
record. Thus, the first color in the palette has the index 0x8, the second
has the index 0x9, etc. through 0x40
@author Brian Sanders (bsanders at risklabs dot com)
Retrieves the color at a given index
the palette index, between 0x8 to 0x40 inclusive.
the color, or null if the index Is not populated
Finds the first occurance of a given color
the RGB red component, between 0 and 255 inclusive
the RGB green component, between 0 and 255 inclusive
the RGB blue component, between 0 and 255 inclusive
the color, or null if the color does not exist in this palette
Finds the closest matching color in the custom palette. The
method for Finding the distance between the colors Is fairly
primative.
The red component of the color to match.
The green component of the color to match.
The blue component of the color to match.
The closest color or null if there are no custom
colors currently defined.
Sets the color at the given offset
the palette index, between 0x8 to 0x40 inclusive
the RGB red component, between 0 and 255 inclusive
the RGB green component, between 0 and 255 inclusive
the RGB blue component, between 0 and 255 inclusive
Adds a new color into an empty color slot.
The red component
The green component
The blue component
The new custom color.
user custom color
Intends to provide support for the very evil index to triplet Issue and
will likely replace the color constants interface for HSSF 2.0.
This class Contains static inner class members for representing colors.
Each color has an index (for the standard palette in Excel (tm) ),
native (RGB) triplet and string triplet. The string triplet Is as the
color would be represented by Gnumeric. Having (string) this here Is a bit of a
collusion of function between HSSF and the HSSFSerializer but I think its
a reasonable one in this case.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Brian Sanders (bsanders at risklabs dot com) - full default color palette
Creates a new instance of HSSFColor
this function returns all colors in a hastable. Its not implemented as a
static member/staticly initialized because that would be dirty in a
server environment as it Is intended. This means you'll eat the time
it takes to Create it once per request but you will not hold onto it
if you have none of those requests.
@return a hashtable containing all colors keyed by int excel-style palette indexes
This function returns all the Colours, stored in a Hashtable that
can be edited. No caching is performed. If you don't need to edit
the table, then call {@link #getIndexHash()} which returns a
statically cached imuatable map of colours.
this function returns all colors in a hastable. Its not implemented as a
static member/staticly initialized because that would be dirty in a
server environment as it Is intended. This means you'll eat the time
it takes to Create it once per request but you will not hold onto it
if you have none of those requests.
a hashtable containing all colors keyed by String gnumeric-like triplets
@return index to the standard palette
@return triplet representation like that in Excel
@return a hex string exactly like a gnumeric triplet
Class BLACK
Class BROWN
Class OLIVE_GREEN
Class DARK_GREEN
Class DARK_TEAL
Class DARK_BLUE
Class INDIGO
Class GREY_80_PERCENT
Class DARK_RED
Class ORANGE
Class DARK_YELLOW
Class GREEN
Class TEAL
Class BLUE
Class BLUE_GREY
Class GREY_50_PERCENT
Class RED
Class LIGHT_ORANGE
Class LIME
Class SEA_GREEN
Class AQUA
Class GREY_40_PERCENT
Class TURQUOISE
Class SKY_BLUE
Class PLUM
Class GREY_25_PERCENT
Class ROSE
Class TAN
Class LIGHT_YELLOW
Class LIGHT_GREEN
Class LIGHT_TURQUOISE
Class PALE_BLUE
Class LAVENDER
Class WHITE
Class CORNFLOWER_BLUE
Class LEMON_CHIFFON
Class MAROON
Class ORCHID
Class CORAL
Class ROYAL_BLUE
Class LIGHT_CORNFLOWER_BLUE
Special Default/Normal/Automatic color.
Note: This class Is NOT in the default HashTables returned by HSSFColor.
The index Is a special case which Is interpreted in the various SetXXXColor calls.
@author Jason
Initializes a new instance of the class.
The byte offset.
The colors.
Initializes a new instance of the class.
The byte offset.
The red.
The green.
The blue.
Gets index to the standard palette
Gets triplet representation like that in Excel
Gets a hex string exactly like a gnumeric triplet
Gets the gnumeric part.
The color.
The patriarch is the toplevel container for shapes in a sheet. It does
little other than act as a container for other shapes and Groups.
@author Glen Stampoultzis (glens at apache.org)
An interface that indicates whether a class can contain children.
@author Glen Stampoultzis (glens at apache.org)
dd shape to the list of child records
shape
set coordinates of this group relative to the parent
x1
y1
x2
y2
remove first level shapes
@param shape to be removed
@return true if shape is removed else return false
Gets Any children contained by this shape.
The children.
Get the top left x coordinate of this group.
Get the top left y coordinate of this group.
Get the bottom right x coordinate of this group.
Get the bottom right y coordinate of this group.
@author Yegor Kozlov
Creates a picture.
@param anchor the client anchor describes how this picture is
attached to the sheet.
@param pictureIndex the index of the picture in the workbook collection
of pictures.
@return the newly created picture.
Creates a comment.
@param anchor the client anchor describes how this comment is attached
to the sheet.
@return the newly created comment.
Creates a chart.
@param anchor the client anchor describes how this chart is attached to
the sheet.
@return the newly created chart
Creates a new client anchor and sets the top-left and bottom-right
coordinates of the anchor.
@param dx1 the x coordinate in EMU within the first cell.
@param dy1 the y coordinate in EMU within the first cell.
@param dx2 the x coordinate in EMU within the second cell.
@param dy2 the y coordinate in EMU within the second cell.
@param col1 the column (0 based) of the first cell.
@param row1 the row (0 based) of the first cell.
@param col2 the column (0 based) of the second cell.
@param row2 the row (0 based) of the second cell.
@return the newly created client anchor
The EscherAggregate we have been bound to.
(This will handle writing us out into records,
and building up our shapes from the records)
Creates the patriarch.
the sheet this patriarch is stored in.
The bound aggregate.
check if any shapes contain wrong data
At now(13.08.2010) check if patriarch contains 2 or more comments with same coordinates
@param shape to be removed
@return true of shape is removed
Creates a new Group record stored Under this patriarch.
the client anchor describes how this Group is attached
to the sheet.
the newly created Group.
Creates a simple shape. This includes such shapes as lines, rectangles,
and ovals.
the client anchor describes how this Group is attached
to the sheet.
the newly created shape.
Creates a picture.
the client anchor describes how this Group is attached
to the sheet.
Index of the picture.
the newly created shape.
CreatePicture
the client anchor describes how this picture is attached to the sheet.
the index of the picture in the workbook collection of pictures.
return newly created shape
Creates a polygon
the client anchor describes how this Group is attached
to the sheet.
the newly Created shape.
Constructs a textbox Under the patriarch.
the client anchor describes how this Group is attached
to the sheet.
the newly Created textbox.
Constructs a cell comment.
@param anchor the client anchor describes how this comment is attached
to the sheet.
@return the newly created comment.
YK: used to create autofilters
@see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(int, int, int, int)
Constructs a cell comment.
the client anchor describes how this comment is attached
to the sheet.
the newly created comment.
add a shape to this drawing
Sets the coordinate space of this Group. All children are contrained
to these coordinates.
The x1.
The y1.
The x2.
The y2.
Does this HSSFPatriarch contain a chart?
(Technically a reference to a chart, since they
Get stored in a different block of records)
FIXME - detect chart in all cases (only seems
to work on some charts so far)
true if this instance contains chart; otherwise, false.
Returns the aggregate escher record we're bound to
Creates a new client anchor and sets the top-left and bottom-right
coordinates of the anchor.
@param dx1 the x coordinate in EMU within the first cell.
@param dy1 the y coordinate in EMU within the first cell.
@param dx2 the x coordinate in EMU within the second cell.
@param dy2 the y coordinate in EMU within the second cell.
@param col1 the column (0 based) of the first cell.
@param row1 the row (0 based) of the first cell.
@param col2 the column (0 based) of the second cell.
@param row2 the row (0 based) of the second cell.
@return the newly created client anchor
create shape tree from existing escher records tree
Returns a list of all shapes contained by the patriarch.
The children.
Total count of all children and their children's children.
The count of all children.
The top left x coordinate of this Group.
The x1.
The top left y coordinate of this Group.
The y1.
The bottom right x coordinate of this Group.
The x2.
The bottom right y coordinate of this Group.
The y2.
High level representation for Conditional Formatting Settings
@author Dmitriy Kumshayev
@author Yegor Kozlov
Initializes a new instance of the class.
The cf rule record.
Gets the pattern formatting block.
The pattern formatting block.
Gets or sets the color of the fill background.
The color of the fill background.
Gets or sets the color of the fill foreground.
The color of the fill foreground.
Gets or sets the fill pattern.
The fill pattern.
Represents binary data stored in the file. Eg. A GIF, JPEG etc...
@author Daniel Noll
Suggests a file extension for this image.
@return the file extension.
Gets the picture data.
@return the picture data.
Returns the mime type for the image
Underlying escher blip record containing the bitmap data.
Constructs a picture object.
the underlying blip record containing the bitmap data.
Suggests a file extension for this image.
the file extension.
Gets the picture data.
the picture data.
gets format of the picture.
The format.
Returns the mime type for the image
@author Glen Stampoultzis (glens at baselinksoftware.com)
Generates the shape records for this shape.
Creates the low level OBJ record for this shape.
@param xPoints - array of x coordinates
@param yPoints - array of y coordinates
Defines the width and height of the points in the polygon
@param width
@param height
@return array of x coordinates
@return array of y coordinates
@return shape width
@return shape height
Used to modify the print Setup.
@author Shawn Laubach (slaubach at apache dot org)
Returns the paper size.
@return paper size
Returns the scale.
@return scale
Returns the page start.
@return page start
Returns the number of pages wide to fit sheet in.
@return number of pages wide to fit sheet in
Returns the number of pages high to fit the sheet in.
@return number of pages high to fit the sheet in
Returns the left to right print order.
@return left to right print order
Returns the landscape mode.
@return landscape mode
Returns the valid Settings.
@return valid Settings
Returns the black and white Setting.
@return black and white Setting
Returns the draft mode.
@return draft mode
Returns the print notes.
@return print notes
Returns the no orientation.
@return no orientation
Returns the use page numbers.
@return use page numbers
Returns the horizontal resolution.
@return horizontal resolution
Returns the vertical resolution.
@return vertical resolution
Returns the header margin.
@return header margin
Returns the footer margin.
@return footer margin
Returns the number of copies.
@return number of copies
Initializes a new instance of the class.
Takes the low level print Setup record.
Gets or sets the size of the paper.
The size of the paper.
Gets or sets the scale.
The scale.
Gets or sets the page start.
The page start.
Gets or sets the number of pages wide to fit sheet in.
the number of pages wide to fit sheet in
Gets or sets number of pages high to fit the sheet in
number of pages high to fit the sheet in.
Gets or sets the bit flags for the options.
the bit flags for the options.
Gets or sets the left to right print order.
the left to right print order.
Gets or sets the landscape mode.
the landscape mode.
Gets or sets the valid Settings.
the valid Settings.
Gets or sets the black and white Setting.
black and white Setting
Gets or sets the draft mode.
the draft mode.
Gets or sets the print notes.
the print notes.
Gets or sets a value indicating whether [no orientation].
true if [no orientation]; otherwise, false.
Gets or sets the use page numbers.
use page numbers.
Gets or sets the horizontal resolution.
the horizontal resolution.
Gets or sets the vertical resolution.
the vertical resolution.
Gets or sets the header margin.
The header margin.
Gets or sets the footer margin.
The footer margin.
Gets or sets the number of copies.
the number of copies.
Rich text Unicode string. These strings can have fonts applied to
arbitary parts of the string.
@author Glen Stampoultzis (glens at apache.org)
@author Jason Height (jheight at apache.org)
Rich text unicode string. These strings can have fonts
applied to arbitary parts of the string.
@author Glen Stampoultzis (glens at apache.org)
@author Jason Height (jheight at apache.org)
Applies a font to the specified characters of a string.
@param startIndex The start index to apply the font to (inclusive)
@param endIndex The end index to apply the font to (exclusive)
@param fontIndex The font to use.
Applies a font to the specified characters of a string.
@param startIndex The start index to apply the font to (inclusive)
@param endIndex The end index to apply to font to (exclusive)
@param font The index of the font to use.
Sets the font of the entire string.
@param font The font to use.
Removes any formatting that may have been applied to the string.
The index within the string to which the specified formatting run applies.
@param index the index of the formatting run
@return the index within the string.
Applies the specified font to the entire string.
@param fontIndex the font to apply.
Returns the plain string representation.
@return the number of characters in the font.
@return The number of formatting Runs used.
Place holder for indicating that NO_FONT has been applied here
Initializes a new instance of the class.
Initializes a new instance of the class.
The string.
Initializes a new instance of the class.
The workbook.
The record.
This must be called to Setup the internal work book references whenever
a RichTextString Is Added to a cell
The workbook.
The record.
Called whenever the Unicode string Is modified. When it Is modified
we need to Create a new SST index, so that other LabelSSTRecords will not
be affected by Changes tat we make to this string.
Adds to SST if required.
Applies a font to the specified Chars of a string.
The start index to apply the font to (inclusive).
The end index to apply the font to (exclusive).
The font to use.
Applies a font to the specified Chars of a string.
The start index to apply the font to (inclusive).
The end index to apply to font to (exclusive).
The index of the font to use.
Sets the font of the entire string.
The font to use.
Removes any formatting that may have been applied to the string.
Returns the font in use at a particular index.
The index.
The font that's currently being applied at that
index or null if no font Is being applied or the
index Is out of range.
The index within the string to which the specified formatting run applies.
the index of the formatting run
the index within the string.
Gets the font used in a particular formatting run.
the index of the formatting run.
the font number used.
Compares one rich text string to another.
The other rich text string.
Equalses the specified o.
The o.
Returns a that represents the current .
A that represents the current .
Applies the specified font to the entire string.
Index of the font to apply.
Returns the plain string representation.
The string.
Returns the raw, probably shared Unicode String.
Used when tweaking the styles, eg updating font
positions.
Changes to this string may well effect
other RichTextStrings too!
The raw unicode string.
Gets or sets the unicode string.
The unicode string.
Gets the number of Chars in the font..
The length.
Gets the number of formatting runs used. There will always be at
least one of font NO_FONT.
The num formatting runs.
High level representation of a row of a spReadsheet.
Only rows that have cells should be Added to a Sheet.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
High level representation of a row of a spreadsheet.
Use this to create new cells within the row and return it.
The cell that is returned is a /.
The type can be changed either through calling SetCellValue or SetCellType.
the column number this cell represents
Cell a high level representation of the created cell.
ArgumentException if columnIndex < 0 or greater than the maximum number of supported columns
(255 for *.xls, 1048576 for *.xlsx)
Use this to create new cells within the row and return it.
The cell that is returned is a /. The type can be changed
either through calling SetCellValue
or SetCellType
.
the column number this cell represents
Cell a high level representation of the created cell.
ArgumentException if columnIndex < 0 or greater than the maximum number of supported columns
(255 for *.xls, 1048576 for *.xlsx)
Remove the Cell from this row.
the cell to remove
Get the cell representing a given column (logical cell) 0-based. If you
ask for a cell that is not defined....you get a null.
0 based column number
Cell representing that column or null if undefined.
Returns the cell at the given (0 based) index, with the specified {@link NPOI.SS.usermodel.Row.MissingCellPolicy}
the cell at the given (0 based) index
ArgumentException if cellnum < 0 or the specified MissingCellPolicy is invalid
Cell iterator of the physically defined cells. Note element 4 may
actually be row cell depending on how many are defined!
Moves the supplied cell to a new column, which
must not already have a cell there!
The cell to move
The new column number (0 based)
Copy the current row to the target row
row index of the target row
the new copied row object
Copy the source cell to the target cell. If the target cell exists, the new copied cell will be inserted before the existing one
index of the source cell
index of the target cell
the new copied cell object
Get row number this row represents
the row number (0 based)
Get the number of the first cell Contained in this row.
short representing the first logical cell in the row,
or -1 if the row does not contain any cells.
Gets the index of the last cell Contained in this row PLUS ONE. The result also
happens to be the 1-based column number of the last cell. This value can be used as a
standard upper bound when iterating over cells:
short minColIx = row.GetFirstCellNum();
short maxColIx = row.GetLastCellNum();
for(short colIx=minColIx; colIx<maxColIx; colIx++) {
Cell cell = row.GetCell(colIx);
if(cell == null) {
continue;
}
//... do something with cell
}
short representing the last logical cell in the row PLUS ONE,
or -1 if the row does not contain any cells.
Gets the number of defined cells (NOT number of cells in the actual row!).
That is to say if only columns 0,4,5 have values then there would be 3.
int representing the number of defined cells in the row.
Get whether or not to display this row with 0 height
zHeight height is zero or not.
Get the row's height measured in twips (1/20th of a point).
If the height is not set, the default worksheet value is returned,
row height measured in twips (1/20th of a point)
Returns row height measured in point size.
If the height is not set, the default worksheet value is returned,
row height measured in point size
Is this row formatted? Most aren't, but some rows
do have whole-row styles. For those that do, you
can get the formatting from
Returns the Sheet this row belongs to
the Sheet that owns this row
Returns the whole-row cell styles. Most rows won't
have one of these, so will return null. Call IsFormmated to check first
The row style.
Get cells in the row
used for collections
reference to low level representation
reference to containing low level Workbook
reference to containing Sheet
Creates new HSSFRow from scratch. Only HSSFSheet should do this.
low-level Workbook object containing the sheet that Contains this row
low-level Sheet object that Contains this Row
the row number of this row (0 based)
Creates an HSSFRow from a low level RowRecord object. Only HSSFSheet should do
this. HSSFSheet uses this when an existing file is Read in.
low-level Workbook object containing the sheet that Contains this row
low-level Sheet object that Contains this Row
the low level api object this row should represent
Use this to create new cells within the row and return it.
The cell that is returned is a CELL_TYPE_BLANK (/).
The type can be changed either through calling SetCellValue or SetCellType.
the column number this cell represents
a high level representation of the created cell.
Use this to create new cells within the row and return it.
The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
either through calling setCellValue or setCellType.
the column number this cell represents
a high level representation of the created cell.
Remove the Cell from this row.
The cell to Remove.
Removes the cell.
The cell.
if set to true [also remove records].
used internally to refresh the "last cell plus one" when the last cell is removed.
@return 0 when row contains no cells
used internally to refresh the "first cell" when the first cell is removed.
@return 0 when row contains no cells (also when first cell is occupied)
Create a high level Cell object from an existing low level record. Should
only be called from HSSFSheet or HSSFRow itself.
The low level cell to Create the high level representation from
the low level record passed in
Removes all the cells from the row, and their
records too.
Moves the supplied cell to a new column, which
must not already have a cell there!
The cell to move
The new column number (0 based)
used internally to Add a cell.
The cell.
Get the hssfcell representing a given column (logical cell)
0-based. If you ask for a cell that is not defined, then
you Get a null.
This is the basic call, with no policies applied
0 based column number
Cell representing that column or null if Undefined.
Get the hssfcell representing a given column (logical cell)
0-based. If you ask for a cell that is not defined then
you get a null, unless you have set a different
MissingCellPolicy on the base workbook.
Short method signature provided to retain binary
compatibility.
0 based column number
Cell representing that column or null if undefined.
Get the hssfcell representing a given column (logical cell)
0-based. If you ask for a cell that is not defined then
you get a null, unless you have set a different
MissingCellPolicy on the base workbook.
0 based column number
Cell representing that column or null if undefined.
Get the hssfcell representing a given column (logical cell)
0-based. If you ask for a cell that is not defined, then
your supplied policy says what to do
0 based column number
Policy on blank / missing cells
that column or null if Undefined + policy allows.
used internally to refresh the "first cell" when the first cell is Removed.
The first cell index.
Gets the cell enumerator of the physically defined cells.
Note that the 4th element might well not be cell 4, as the iterator
will not return Un-defined (null) cells.
Call CellNum on the returned cells to know which cell they are.
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
An object to compare with this instance.
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings:
Value
Meaning
Less than zero
This instance is less than .
Zero
This instance is equal to .
Greater than zero
This instance is greater than .
is not the same type as this instance.
Determines whether the specified is equal to the current .
The to compare with the current .
true if the specified is equal to the current ; otherwise, false.
The parameter is null.
Returns a hash code. In this case it is the number of the row.
true, when the row is invisible. This is the case when the height is zero.
Get row number this row represents
the row number (0 based)
Returns the rows outline level. Increased as you
put it into more Groups (outlines), reduced as
you take it out of them.
The outline level.
Returns the HSSFSheet this row belongs to
@return the HSSFSheet that owns this row
Get the number of the first cell contained in this row.
the first logical cell in the row, or -1 if the row does not contain any cells.
Gets the index of the last cell contained in this row PLUS ONE
. The result also happens to be the 1-based column number of the last cell. This value can be used as a
standard upper bound when iterating over cells:
short representing the last logical cell in the row PLUS ONE, or -1 if the
row does not contain any cells.
short minColIx = row.GetFirstCellNum();
short maxColIx = row.GetLastCellNum();
for(short colIx=minColIx; colIx<maxColIx; colIx++) {
Cell cell = row.GetCell(colIx);
if(cell == null) {
continue;
}
//... do something with cell
}
Gets the number of defined cells (NOT number of cells in the actual row!).
That is to say if only columns 0,4,5 have values then there would be 3.
the number of defined cells in the row.
Gets or sets whether or not to Display this row with 0 height
height is zero or not.
Get or sets the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point)
rowheight or 0xff for Undefined (use sheet default)
is this row formatted? Most aren't, but some rows
do have whole-row styles. For those that do, you
can get the formatting from {@link #getRowStyle()}
true if this instance is formatted; otherwise, false.
Returns the whole-row cell styles. Most rows won't
have one of these, so will return null. Call IsFormmated to check first
The row style.
Get the row's height or ff (-1) for Undefined/default-height in points (20*Height)
row height or 0xff for Undefined (use sheet default).
Get the lowlevel RowRecord represented by this object - should only be called
by other parts of the high level API
RowRecord this row represents
Get cells in the row (existing cells only, no blanks)
A shape Group may contain other shapes. It was no actual form on the
sheet.
@author Glen Stampoultzis (glens at apache.org)
Create another Group Under this Group.
the position of the new Group.
the Group
Create a new simple shape Under this Group.
the position of the shape.
the shape
Create a new textbox Under this Group.
the position of the shape.
the textbox
Creates a polygon
the client anchor describes how this Group Is attached
to the sheet.
the newly Created shape.
Creates a picture.
the client anchor describes how this Group Is attached
to the sheet.
Index of the picture.
the newly Created shape.
Sets the coordinate space of this Group. All children are constrained
to these coordinates.
The x1.
The y1.
The x2.
The y2.
Return all children contained by this shape.
Gets The top left x coordinate of this Group.
The x1.
Gets The top left y coordinate of this Group.
The y1.
Gets The bottom right x coordinate of this Group.
The x2.
Gets the bottom right y coordinate of this Group.
The y2.
Count of all children and their childrens children.
High level representation of a worksheet.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Libin Roman (romal at vistaportal.com)
@author Shawn Laubach (slaubach at apache dot org) (Just a little)
@author Jean-Pierre Paris (jean-pierre.paris at m4x dot org) (Just a little, too)
@author Yegor Kozlov (yegor at apache.org) (Autosizing columns)
High level representation of a Excel worksheet.
Sheets are the central structures within a workbook, and are where a user does most of his spreadsheet work.
The most common type of sheet is the worksheet, which is represented as a grid of cells. Worksheet cells can
contain text, numbers, dates, and formulas. Cells can also be formatted.
Create a new row within the sheet and return the high level representation
The row number.
high level Row object representing a row in the sheet
RemoveRow(Row)
Remove a row from this sheet. All cells Contained in the row are Removed as well
a row to Remove.
Returns the logical row (not physical) 0-based. If you ask for a row that is not
defined you get a null. This is to say row 4 represents the fifth row on a sheet.
row to get (0-based).
the rownumber or null if its not defined on the sheet
Get the visibility state for a given column
the column to get (0-based)
the visiblity state of the column
Get the hidden state for a given column
the column to set (0-based)
hidden - false if the column is visible
Copy the source row to the target row. If the target row exists, the new copied row will be inserted before the existing one
source index
target index
the new copied row object
Set the width (in units of 1/256th of a character width)
the column to set (0-based)
the width in units of 1/256th of a character width
The maximum column width for an individual cell is 255 characters.
This value represents the number of characters that can be displayed
in a cell that is formatted with the standard font.
get the width (in units of 1/256th of a character width )
the column to set (0-based)
the width in units of 1/256th of a character width
Returns the CellStyle that applies to the given
(0 based) column, or null if no style has been
set for that column
The column.
Adds a merged region of cells (hence those cells form one)
(rowfrom/colfrom-rowto/colto) to merge.
index of this region
Removes a merged region of cells (hence letting them free)
index of the region to unmerge
Returns the merged region at the specified index
The index.
Gets the row enumerator.
an iterator of the PHYSICAL rows. Meaning the 3rd element may not
be the third row if say for instance the second row is undefined.
Call on each row
if you care which one it is.
Alias for GetRowEnumerator() to allow foreach loops.
an iterator of the PHYSICAL rows. Meaning the 3rd element may not
be the third row if say for instance the second row is undefined.
Call on each row
if you care which one it is.
Gets the size of the margin in inches.
which margin to get
the size of the margin
Sets the size of the margin in inches.
which margin to get
the size of the margin
Sets the protection enabled as well as the password
to set for protection. Pass null
to remove protection
Sets the zoom magnication for the sheet. The zoom is expressed as a
fraction. For example to express a zoom of 75% use 3 for the numerator
and 4 for the denominator.
The numerator for the zoom magnification.
denominator for the zoom magnification.
Sets desktop window pane display area, when the
file is first opened in a viewer.
the top row to show in desktop window pane
the left column to show in desktop window pane
Shifts rows between startRow and endRow n number of rows.
If you use a negative number, it will shift rows up.
Code ensures that rows don't wrap around.
Calls shiftRows(startRow, endRow, n, false, false);
Additionally shifts merged regions that are completely defined in these
rows (ie. merged 2 cells on a row to be shifted).
the row to start shifting
the row to end shifting
the number of rows to shift
Shifts rows between startRow and endRow n number of rows.
If you use a negative number, it will shift rows up.
Code ensures that rows don't wrap around
Additionally shifts merged regions that are completely defined in these
rows (ie. merged 2 cells on a row to be shifted).
the row to start shifting
the row to end shifting
the number of rows to shift
whether to copy the row height during the shift
whether to set the original row's height to the default
Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
Horizonatal position of split
Vertical position of split
Top row visible in bottom pane
Left column visible in right pane
Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
Horizonatal position of split.
Vertical position of split.
Creates a split pane. Any existing freezepane or split pane is overwritten.
Horizonatal position of split (in 1/20th of a point)
Vertical position of split (in 1/20th of a point)
Left column visible in right pane
Top row visible in bottom pane
Active pane. One of: PANE_LOWER_RIGHT, PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT
@see #PANE_LOWER_LEFT
@see #PANE_LOWER_RIGHT
@see #PANE_UPPER_LEFT
@see #PANE_UPPER_RIGHT
Determines if there is a page break at the indicated row
The row.
Removes the page break at the indicated row
The row index.
Sets the active cell.
The row.
The column.
Sets the active cell range.
The firstrow.
The lastrow.
The firstcolumn.
The lastcolumn.
Sets the active cell range.
The cellranges.
The index of the active range.
The active row in the active range
The active column in the active range
Sets a page break at the indicated column
The column.
Sets the row break.
The row.
Determines if there is a page break at the indicated column
The column index.
Removes a page break at the indicated column
The column.
Expands or collapses a column group.
One of the columns in the group.
if set to truecollapse group.falseexpand group.
Create an outline for the provided column range.
beginning of the column range.
end of the column range.
Ungroup a range of columns that were previously groupped
start column (0-based).
end column (0-based).
Tie a range of rows toGether so that they can be collapsed or expanded
start row (0-based)
end row (0-based)
Ungroup a range of rows that were previously groupped
start row (0-based)
end row (0-based)
Set view state of a groupped range of rows
start row of a groupped range of rows (0-based).
whether to expand/collapse the detail rows.
Sets the default column style for a given column. POI will only apply this style to new cells Added to the sheet.
the column index
the style to set
Adjusts the column width to fit the contents.
the column index
This process can be relatively slow on large sheets, so this should
normally only be called once per column, at the end of your
processing.
Adjusts the column width to fit the contents.
the column index.
whether to use the contents of merged cells when
calculating the width of the column. Default is to ignore merged cells.
This process can be relatively slow on large sheets, so this should
normally only be called once per column, at the end of your
processing.
Returns cell comment for the specified row and column
The row.
The column.
Creates the top-level drawing patriarch.
Sets whether sheet is selected.
Whether to select the sheet or deselect the sheet.
Sets array formula to specified region for result.
text representation of the formula
Region of array formula for result
the of cells affected by this change
Remove a Array Formula from this sheet. All cells contained in the Array Formula range are removed as well
any cell within Array Formula range
the of cells affected by this change
Checks if the provided region is part of the merged regions.
Region searched in the merged regions
true, when the region is contained in at least one of the merged regions
Create an instance of a DataValidationHelper.
Instance of a DataValidationHelper
Creates a data validation object
The data validation object settings
Enable filtering for a range of cells
the range of cells to filter
Returns the number of physically defined rows (NOT the number of rows in the sheet)
the number of physically defined rows in this sheet.
Gets the first row on the sheet
the number of the first logical row on the sheet (0-based).
Gets the last row on the sheet
last row contained n this sheet (0-based)
whether force formula recalculation.
Get the default column width for the sheet (if the columns do not define their own width)
in characters
default column width measured in characters.
Get the default row height for the sheet (if the rows do not define their own height) in
twips (1/20 of a point)
default row height measured in twips (1/20 of a point)
Get the default row height for the sheet (if the rows do not define their own height) in
points.
The default row height in points.
Determine whether printed output for this sheet will be horizontally centered.
Determine whether printed output for this sheet will be vertically centered.
Returns the number of merged regions
Gets the flag indicating whether the window should show 0 (zero) in cells Containing zero value.
When false, cells with zero value appear blank instead of showing the number zero.
whether all zero values on the worksheet are displayed.
Gets or sets a value indicating whether the sheet displays Automatic Page Breaks.
Get whether to display the guts or not,
default value is true
Flag indicating whether the Fit to Page print option is enabled.
Flag indicating whether summary rows appear below detail in an outline, when applying an outline.
When true a summary row is inserted below the detailed data being summarized and a
new outline level is established on that row.
When false a summary row is inserted above the detailed data being summarized and a new outline level
is established on that row.
true if row summaries appear below detail in the outline
Flag indicating whether summary columns appear to the right of detail in an outline, when applying an outline.
When true a summary column is inserted to the right of the detailed data being summarized
and a new outline level is established on that column.
When false a summary column is inserted to the left of the detailed data being
summarized and a new outline level is established on that column.
true if col summaries appear right of the detail in the outline
Gets the flag indicating whether this sheet displays the lines
between rows and columns to make editing and reading easier.
true if this sheet displays gridlines.
Gets the print Setup object.
The user model for the print Setup object.
Gets the user model for the default document header.
Note that XSSF offers more kinds of document headers than HSSF does
the document header. Never null
Gets the user model for the default document footer.
Note that XSSF offers more kinds of document footers than HSSF does.
the document footer. Never null
Answer whether protection is enabled or disabled
true => protection enabled; false => protection disabled
Answer whether scenario protection is enabled or disabled
true => protection enabled; false => protection disabled
Gets or sets the tab color of the _sheet
Returns the top-level drawing patriach, if there is one.
This will hold any graphics or charts for the _sheet.
WARNING - calling this will trigger a parsing of the
associated escher records. Any that aren't supported
(such as charts and complex drawing types) will almost
certainly be lost or corrupted when written out. Only
use this with simple drawings, otherwise call
HSSFSheet#CreateDrawingPatriarch() and
start from scratch!
The drawing patriarch.
The top row in the visible view when the sheet is
first viewed after opening it in a viewer
the rownum (0 based) of the top row.
The left col in the visible view when the sheet is
first viewed after opening it in a viewer
the rownum (0 based) of the top row
Returns the information regarding the currently configured pane (split or freeze)
if no pane configured returns null else return the pane information.
Returns if gridlines are displayed
Returns if formulas are displayed
Returns if RowColHeadings are displayed.
Returns if RowColHeadings are displayed.
Retrieves all the horizontal page breaks
all the horizontal page breaks, or null if there are no row page breaks
Retrieves all the vertical page breaks
all the vertical page breaks, or null if there are no column page breaks.
Gets the parent workbook.
Gets the name of the sheet.
Gets or sets a value indicating whether this sheet is currently selected.
The 'Conditional Formatting' facet for this Sheet
conditional formatting rule for this sheet
Whether the text is displayed in right-to-left mode in the window
Get or set the repeating rows used when printing the sheet, as found in File->PageSetup->Sheet.
Repeating rows cover a range of contiguous rows, e.g.:
Sheet1!$1:$1
Sheet2!$5:$8
The {@link CellRangeAddress} returned contains a column part which spans
all columns, and a row part which specifies the contiguous range of
repeating rows.
If the Sheet does not have any repeating rows defined, null is returned.
Gets or set the repeating columns used when printing the sheet, as found in File->PageSetup->Sheet.
Repeating columns cover a range of contiguous columns, e.g.:
Sheet1!$A:$A
Sheet2!$C:$F
The {@link CellRangeAddress} returned contains a row part which spans all
rows, and a column part which specifies the contiguous range of
repeating columns.
If the Sheet does not have any repeating columns defined, null is
returned.
Used for compile-time optimization. This is the initial size for the collection of
rows. It is currently Set to 20. If you generate larger sheets you may benefit
by Setting this to a higher number and recompiling a custom edition of HSSFSheet.
reference to the low level Sheet object
Creates new HSSFSheet - called by HSSFWorkbook to create a _sheet from
scratch. You should not be calling this from application code (its protected anyhow).
The HSSF Workbook object associated with the _sheet.
Creates an HSSFSheet representing the given Sheet object. Should only be
called by HSSFWorkbook when reading in an exisiting file.
The HSSF Workbook object associated with the _sheet.
lowlevel Sheet object this _sheet will represent
Clones the _sheet.
The _workbook.
the cloned sheet
Copy one row to the target row
index of the source row
index of the target row
used internally to Set the properties given a Sheet object
The _sheet.
Create a new row within the _sheet and return the high level representation
The row number.
@see org.apache.poi.hssf.usermodel.HSSFRow
@see #RemoveRow(HSSFRow)
Used internally to Create a high level Row object from a low level row object.
USed when Reading an existing file
low level record to represent as a high level Row and Add to _sheet.
HSSFRow high level representation
Remove a row from this _sheet. All cells contained in the row are Removed as well
the row to Remove.
used internally to refresh the "last row" when the last row is Removed.
The last row.
used internally to refresh the "first row" when the first row is Removed.
The first row.
Add a row to the _sheet
@param AddLow whether to Add the row to the low level model - false if its already there
Returns the HSSFCellStyle that applies to the given
(0 based) column, or null if no style has been
set for that column
The column.
Returns the logical row (not physical) 0-based. If you ask for a row that is not
defined you get a null. This is to say row 4 represents the fifth row on a _sheet.
Index of the row to get.
the row number or null if its not defined on the _sheet
Creates a data validation object
The data validation object settings
Get the visibility state for a given column.F:\Gloria\�о�\�ļ���ʽ\NPOI\src\NPOI\HSSF\Util\HSSFDataValidation.cs
the column to Get (0-based).
the visiblity state of the column.
Get the hidden state for a given column.
the column to Set (0-based)
the visiblity state of the column;
Set the width (in Units of 1/256th of a Char width)
the column to Set (0-based)
the width in Units of 1/256th of a Char width
Get the width (in Units of 1/256th of a Char width )
the column to Set (0-based)
the width in Units of 1/256th of a Char width
Adds a merged region of cells (hence those cells form one)
The region (rowfrom/colfrom-rowto/colto) to merge.
index of this region
adds a merged region of cells (hence those cells form one)
region (rowfrom/colfrom-rowto/colto) to merge
index of this region
Removes a merged region of cells (hence letting them free)
index of the region to Unmerge
Gets the row enumerator.
an iterator of the PHYSICAL rows. Meaning the 3rd element may not
be the third row if say for instance the second row is undefined.
Call on each row
if you care which one it is.
Alias for GetRowEnumerator() to allow foreach loops.
an iterator of the PHYSICAL rows. Meaning the 3rd element may not
be the third row if say for instance the second row is undefined.
Call on each row
if you care which one it is.
Sets the active cell.
The row.
The column.
Sets the active cell range.
The first row.
The last row.
The first column.
The last column.
Sets the active cell range.
The cellranges.
The index of the active range.
The active row in the active range
The active column in the active range
Sets whether sheet is selected.
Whether to select the sheet or deselect the sheet.
Sets the protection enabled as well as the password
password to set for protection, pass null
to remove protection
Sets the zoom magnication for the _sheet. The zoom is expressed as a
fraction. For example to express a zoom of 75% use 3 for the numerator
and 4 for the denominator.
The numerator for the zoom magnification.
The denominator for the zoom magnification.
Sets the enclosed border of region.
The region.
Type of the border.
The color.
Sets the right border of region.
The region.
Type of the border.
The color.
Sets the left border of region.
The region.
Type of the border.
The color.
Sets the top border of region.
The region.
Type of the border.
The color.
Sets the bottom border of region.
The region.
Type of the border.
The color.
Sets desktop window pane display area, when the
file is first opened in a viewer.
the top row to show in desktop window pane
the left column to show in desktop window pane
Shifts the merged regions left or right depending on mode
TODO: MODE , this is only row specific
The start row.
The end row.
The n.
if set to true [is row].
Shifts rows between startRow and endRow n number of rows.
If you use a negative number, it will Shift rows up.
Code Ensures that rows don't wrap around.
Calls ShiftRows(startRow, endRow, n, false, false);
Additionally Shifts merged regions that are completely defined in these
rows (ie. merged 2 cells on a row to be Shifted).
the row to start Shifting
the row to end Shifting
the number of rows to Shift
Shifts rows between startRow and endRow n number of rows.
If you use a negative number, it will shift rows up.
Code ensures that rows don't wrap around
Additionally shifts merged regions that are completely defined in these
rows (ie. merged 2 cells on a row to be shifted).
TODO Might want to add bounds checking here
the row to start shifting
the row to end shifting
the number of rows to shift
whether to copy the row height during the shift
whether to set the original row's height to the default
Shifts rows between startRow and endRow n number of rows.
If you use a negative number, it will Shift rows up.
Code Ensures that rows don't wrap around
Additionally Shifts merged regions that are completely defined in these
rows (ie. merged 2 cells on a row to be Shifted).
TODO Might want to Add bounds Checking here
the row to start Shifting
the row to end Shifting
the number of rows to Shift
whether to copy the row height during the Shift
whether to Set the original row's height to the default
if set to true [move comments].
Inserts the chart records.
The records.
Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
Horizonatal position of split.
Vertical position of split.
Top row visible in bottom pane
Left column visible in right pane.
Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
Horizonatal position of split.
Vertical position of split.
Creates a split pane. Any existing freezepane or split pane is overwritten.
Horizonatal position of split (in 1/20th of a point).
Vertical position of split (in 1/20th of a point).
Left column visible in right pane.
Top row visible in bottom pane.
Active pane. One of: PANE_LOWER_RIGHT,PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT
Gets the size of the margin in inches.
which margin to get.
the size of the margin
Sets the size of the margin in inches.
which margin to get.
the size of the margin
Sets a page break at the indicated row
The row.
Determines if there is a page break at the indicated row
The row.
true if [is row broken] [the specified row]; otherwise, false.
Removes the page break at the indicated row
The row.
Sets a page break at the indicated column
The column.
Determines if there is a page break at the indicated column
The column.
true if [is column broken] [the specified column]; otherwise, false.
Removes a page break at the indicated column
The column.
Runs a bounds Check for row numbers
The row.
Runs a bounds Check for column numbers
The column.
Aggregates the drawing records and dumps the escher record hierarchy
to the standard output.
if set to true [fat].
Creates the top-level drawing patriarch. This will have
the effect of removing any existing drawings on this
sheet.
This may then be used to add graphics or charts
@return The new patriarch.
Expands or collapses a column Group.
One of the columns in the Group.
true = collapse Group, false = expand Group.
Create an outline for the provided column range.
beginning of the column range.
end of the column range.
Ungroups the column.
From column.
To column.
Groups the row.
From row.
To row.
Remove a Array Formula from this sheet. All cells contained in the Array Formula range are removed as well
any cell within Array Formula range
the of cells affected by this change
Also creates cells if they don't exist.
Sets array formula to specified region for result.
text representation of the formula
Region of array formula for result
the of cells affected by this change
Ungroups the row.
From row.
To row.
Sets the row group collapsed.
The row.
if set to true [collapse].
Sets the default column style for a given column. POI will only apply this style to new cells Added to the _sheet.
the column index
the style to set
Adjusts the column width to fit the contents.
This Process can be relatively slow on large sheets, so this should
normally only be called once per column, at the end of your
Processing.
the column index.
Adjusts the column width to fit the contents.
This Process can be relatively slow on large sheets, so this should
normally only be called once per column, at the end of your
Processing.
You can specify whether the content of merged cells should be considered or ignored.
Default is to ignore merged cells.
the column index
whether to use the contents of merged cells when calculating the width of the column
Checks if the provided region is part of the merged regions.
Region searched in the merged regions
true, when the region is contained in at least one of the merged regions
Gets the merged region at the specified index
The index.
Convert HSSFFont to Font.
The font.
Returns cell comment for the specified row and column
The row.
The column.
cell comment or null if not found
Create an instance of a DataValidationHelper.
Instance of a DataValidationHelper
Enable filtering for a range of cells
the range of cells to filter
Translate color palette entries from the source to the destination sheet
Gets the flag indicating whether the window should show 0 (zero) in cells containing zero value.
When false, cells with zero value appear blank instead of showing the number zero.
In Excel 2003 this option can be changed in the Options dialog on the View tab.
@return whether all zero values on the worksheet are displayed
Returns the number of phsyically defined rows (NOT the number of rows in the _sheet)
The physical number of rows.
Gets the first row on the _sheet
the number of the first logical row on the _sheet
Gets the last row on the _sheet
last row contained n this _sheet.
Gets or sets the default width of the column.
The default width of the column.
Get the default row height for the _sheet (if the rows do not define their own height) in
twips (1/20 of a point)
The default height of the row.
Get the default row height for the _sheet (if the rows do not define their own height) in
points.
The default row height in points.
Get whether gridlines are printed.
true if printed; otherwise, false.
Whether a record must be Inserted or not at generation to indicate that
formula must be recalculated when _workbook is opened.
true if [force formula recalculation]; otherwise, false.
@return true if an Uncalced record must be Inserted or not at generation
Determine whether printed output for this _sheet will be vertically centered.
true if [vertically center]; otherwise, false.
Determine whether printed output for this _sheet will be horizontally centered.
true if [horizontally center]; otherwise, false.
returns the number of merged regions
The number of merged regions
used internally in the API to Get the low level Sheet record represented by this
Object.
low level representation of this HSSFSheet.
Gets or sets whether alternate expression evaluation is on
true if [alternative expression]; otherwise, false.
whether alternative formula entry is on
true alternative formulas or not; otherwise, false.
show automatic page breaks or not
whether to show auto page breaks
Gets or sets a value indicating whether _sheet is a dialog _sheet
true if is dialog; otherwise, false.
Gets or sets a value indicating whether to Display the guts or not.
true if guts or no guts (or glory); otherwise, false.
Gets or sets a value indicating whether fit to page option is on
true if [fit to page]; otherwise, false.
Get if row summaries appear below detail in the outline
true if below or not; otherwise, false.
Get if col summaries appear right of the detail in the outline
true right or not; otherwise, false.
Gets or sets whether gridlines are printed.
true Gridlines are printed; otherwise, false.
Gets the print setup object.
The user model for the print setup object.
Gets the user model for the document header.
The Document header.
Gets the user model for the document footer.
The Document footer.
Gets or sets whether the worksheet is displayed from right to left instead of from left to right.
true for right to left, false otherwise
poi bug 47970
Note - this is not the same as whether the _sheet is focused (isActive)
true if this _sheet is currently selected; otherwise, false.
Gets or sets a value indicating if this _sheet is currently focused.
true if this _sheet is currently focused; otherwise, false.
Answer whether protection is enabled or disabled
true if protection enabled; otherwise, false.
Gets the hashed password
The password.
Answer whether object protection is enabled or disabled
true if protection enabled; otherwise, false.
Answer whether scenario protection is enabled or disabled
true if protection enabled; otherwise, false.
The top row in the visible view when the _sheet is
first viewed after opening it in a viewer
the rownum (0 based) of the top row
The left col in the visible view when the _sheet Is
first viewed after opening it in a viewer
the rownum (0 based) of the top row
Returns the information regarding the currently configured pane (split or freeze).
null if no pane configured, or the pane information.
Gets or sets if gridlines are Displayed.
whether gridlines are Displayed
Gets or sets a value indicating whether formulas are displayed.
whether formulas are Displayed
Gets or sets a value indicating whether RowColHeadings are displayed.
whether RowColHeadings are displayed
Retrieves all the horizontal page breaks
all the horizontal page breaks, or null if there are no row page breaks
Retrieves all the vertical page breaks
all the vertical page breaks, or null if there are no column page breaks
Returns the agregate escher records for this _sheet,
it there is one.
WARNING - calling this will trigger a parsing of the
associated escher records. Any that aren't supported
(such as charts and complex drawing types) will almost
certainly be lost or corrupted when written out.
The drawing escher aggregate.
This will hold any graphics or charts for the sheet.
@return the top-level drawing patriarch, if there is one, else returns null
Gets or sets the tab color of the _sheet
Gets or sets whether the tab color of _sheet is automatic
Gets the sheet conditional formatting.
The sheet conditional formatting.
Get the DVRecords objects that are associated to this _sheet
a list of DVRecord instances
Provide a reference to the parent workbook.
Returns the name of this _sheet
The Conditional Formatting facet of HSSFSheet
@author Dmitriy Kumshayev
The 'Conditional Formatting' facet of Sheet
@author Dmitriy Kumshayev
@author Yegor Kozlov
@since 3.8
Add a new Conditional Formatting to the sheet.
list of rectangular regions to apply conditional formatting rules
the rule to apply
index of the newly Created Conditional Formatting object
Add a new Conditional Formatting consisting of two rules.
list of rectangular regions to apply conditional formatting rules
the first rule
the second rule
index of the newly Created Conditional Formatting object
Add a new Conditional Formatting Set to the sheet.
list of rectangular regions to apply conditional formatting rules
Set of up to three conditional formatting rules
index of the newly Created Conditional Formatting object
Adds a copy of a ConditionalFormatting object to the sheet
the Conditional Formatting to clone
index of the new Conditional Formatting object
This method could be used to copy ConditionalFormatting object
from one sheet to another. For example:
ConditionalFormatting cf = sheet.GetConditionalFormattingAt(index);
newSheet.AddConditionalFormatting(cf);
A factory method allowing to create a conditional formatting rule
with a cell comparison operator
The Created conditional formatting rule Compares a cell value
to a formula calculated result, using the specified operator.
The type of the Created condition is {@link ConditionalFormattingRule#CONDITION_TYPE_CELL_VALUE_IS}
@param comparisonOperation - MUST be a constant value from
{@link ComparisonOperator}:
- BETWEEN
- NOT_BETWEEN
- EQUAL
- NOT_EQUAL
- GT
- LT
- GE
- LE
@param formula1 - formula for the valued, Compared with the cell
@param formula2 - second formula (only used with
{@link ComparisonOperator#BETWEEN}) and {@link ComparisonOperator#NOT_BETWEEN} operations)
Create a conditional formatting rule that Compares a cell value to a formula calculated result, using an operator
MUST be a constant value from ComparisonOperator except BETWEEN and NOT_BETWEEN
the formula to determine if the conditional formatting is applied
a conditional formatting rule
Create a conditional formatting rule based on a Boolean formula.
When the formula result is true, the cell is highlighted.
the formula to Evaluate. MUST be a Boolean function.
conditional formatting rule
Gets Conditional Formatting object at a particular index
0-based index of the Conditional Formatting object to fetch
Conditional Formatting object or null if not found
throws ArgumentException if the index is outside of the allowable range (0 ... numberOfFormats-1)
Removes a Conditional Formatting object by index
0-based index of the Conditional Formatting object to remove
throws ArgumentException if the index is outside of the allowable range (0 ... numberOfFormats-1)
get the number of conditional formats in this sheet
A factory method allowing to Create a conditional formatting rule
with a cell comparison operator
TODO - formulas containing cell references are currently not Parsed properly
a constant value from HSSFConditionalFormattingRule.ComparisonOperator
formula for the valued, Compared with the cell
second formula (only used with HSSFConditionalFormattingRule#COMPARISON_OPERATOR_BETWEEN
and HSSFConditionalFormattingRule#COMPARISON_OPERATOR_NOT_BETWEEN operations)
A factory method allowing to Create a conditional formatting rule with a formula.
The formatting rules are applied by Excel when the value of the formula not equal to 0.
TODO - formulas containing cell references are currently not Parsed properly
formula for the valued, Compared with the cell
Adds a copy of HSSFConditionalFormatting object to the sheet
This method could be used to copy HSSFConditionalFormatting object
from one sheet to another.
HSSFConditionalFormatting object
index of the new Conditional Formatting object
HSSFConditionalFormatting cf = sheet.GetConditionalFormattingAt(index);
newSheet.AddConditionalFormatting(cf);
Allows to Add a new Conditional Formatting Set to the sheet.
list of rectangular regions to apply conditional formatting rules
Set of up to three conditional formatting rules
index of the newly Created Conditional Formatting object
Adds the conditional formatting.
The regions.
The rule1.
Adds the conditional formatting.
The regions.
The rule1.
The rule2.
Gets Conditional Formatting object at a particular index
@param index
of the Conditional Formatting object to fetch
Conditional Formatting object
Removes a Conditional Formatting object by index
index of a Conditional Formatting object to Remove
the number of Conditional Formatting objects of the sheet
The num conditional formattings.
This class Creates OperationEval instances to help evaluate OperationPtg
formula tokens.
@author Josh Micich
returns the OperationEval concrete impl instance corresponding
to the supplied operationPtg
Allows the user to lookup the font metrics for a particular font without
actually having the font on the system. The font details are Loaded
as a resource from the POI jar file (or classpath) and should be contained
in path "/font_metrics.properties". The font widths are for a 10 point
version of the font. Use a multiplier for other sizes.
@author Glen Stampoultzis (glens at apache.org)
The font metrics property file we're using
Our cache of font details we've alReady looked up
Retrieves the fake font details for a given font.
@param font the font to lookup.
@return the fake font.
4 bytes - little endian
2 bytes - little endian
2 bytes - little endian
8 bytes - serialized as big endian, stored with inverted endianness here
Read a GUID in standard text form e.g.
13579BDF-0246-8ACE-0123-456789ABCDEF
->
0x13579BDF, 0x0246, 0x8ACE 0x0123456789ABCDEF
Title: HSSFCellRangeAddress
Description:
Implementation of the cell range Address lists,like Is described in
OpenOffice.org's Excel Documentation .
In BIFF8 there Is a common way to store absolute cell range Address
lists in several records (not formulas). A cell range Address list
consists of a field with the number of ranges and the list of the range
Addresses. Each cell range Address (called an AddR structure) Contains
4 16-bit-values.
Copyright: Copyright (c) 2004
Company:
@author Dragos Buleandra (dragos.buleandra@trade2b.ro)
@version 2.0-pre
Number of following AddR structures
List of AddR structures. Each structure represents a cell range
Construct a new HSSFCellRangeAddress object and Sets its fields appropriately .
Even this Isn't an Excel record , I kept the same behavior for reading/writing
the object's data as for a regular record .
@param in the RecordInputstream to read the record from
Add an AddR structure .
@param first_row - the upper left hand corner's row
@param first_col - the upper left hand corner's col
@param last_row - the lower right hand corner's row
@param last_col - the lower right hand corner's col
@return the index of this AddR structure
Remove the AddR structure stored at the passed in index
@param index The AddR structure's index
return the AddR structure at the given index.
@return AddrStructure representing
Get the number of following AddR structures.
The number of this structures Is automatically Set when reading an Excel file
and/or increased when you manually Add a new AddR structure .
This Is the reason there Isn't a Set method for this field .
@return number of AddR structures
Get the upper left hand corner column number
@return column number for the upper left hand corner
Get the upper left hand corner row number
@return row number for the upper left hand corner
Get the lower right hand corner column number
@return column number for the lower right hand corner
Get the lower right hand corner row number
@return row number for the lower right hand corner
* Title: Range Address
* Description: provides connectivity utilities for ranges
*
*
* REFERENCE:
* @author IgOr KaTz & EuGeNe BuMaGiN (Tal Moshaiov) (VistaPortal LDT.)
@version 1.0
Accepts an external reference from excel.
i.e. Sheet1!$A$4:$B$9
@param _url
@return String note: All absolute references are Removed
Utility class for helping convert RK numbers.
@author Andrew C. Oliver (acoliver at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Rolf-J黵gen Moll
@see org.apache.poi.hssf.record.MulRKRecord
@see org.apache.poi.hssf.record.RKRecord
Do the dirty work of decoding; made a private static method to
facilitate testing the algorithm
Common interface for "Add-in" libraries and user defined function libraries.
@author PUdalau
Returns executor by specified name. Returns null
if the function name is unknown.
@param name Name of function.
@return Function executor.
Returns a collection of ATP function names implemented by POI.
@return an array of supported functions
@since 3.8 beta6
Returns a collection of ATP function names NOT implemented by POI.
@return an array of not supported functions
@since 3.8 beta6
Register a ATP function in runtime.
@param name the function name
@param func the functoin to register
@throws ArgumentException if the function is unknown or already registered.
@since 3.8 beta6
Implementation of Excel 'Analysis ToolPak' function MROUND()
Returns a number rounded to the desired multiple.
Syntax
MROUND(number, multiple)
@author Yegor Kozlov
Implementation of Excel 'Analysis ToolPak' function ISEVEN() ISODD()
@author Josh Micich
* Implementation of Excel 'Analysis ToolPak' function RANDBETWEEN()
*
* Returns a random integer number between the numbers you specify.
*
* Syntax
* RANDBETWEEN(bottom, top)
*
* bottom is the smallest integer RANDBETWEEN will return.
* top is the largest integer RANDBETWEEN will return.
* @author Brendan Nolan
Evaluate for RANDBETWEEN(). Must be given two arguments. Bottom must be greater than top.
Bottom is rounded up and top value is rounded down. After rounding top has to be set greater
than top.
@see org.apache.poi.ss.formula.functions.FreeRefFunction#evaluate(org.apache.poi.ss.formula.eval.ValueEval[], org.apache.poi.ss.formula.OperationEvaluationContext)
Implementation of Excel 'Analysis ToolPak' function YEARFRAC()
Returns the fraction of the year spanned by two dates.
Syntax
YEARFRAC(startDate, endDate, basis)
The basis optionally specifies the behaviour of YEARFRAC as follows:
Value | Days per Month | Days per Year |
0 (default) | 30 | 360 |
1 | actual | actual |
2 | actual | 360 |
3 | actual | 365 |
4 | 30 | 360 |
Internal calculation methods for Excel 'Analysis ToolPak' function YEARFRAC()
Algorithm inspired by www.dwheeler.com/yearfrac
@author Josh Micich
Date Count convention
http://en.wikipedia.org/wiki/Day_count_convention
Office Online Help on YEARFRAC
http://office.microsoft.com/en-us/excel/HP052093441033.aspx
use UTC time-zone to avoid daylight savings issues
the length of normal long months i.e. 31
the length of normal short months i.e. 30
Calculates YEARFRAC()
The start date.
The end date.
The basis value.
Basis 0, 30/360 date convention
The start date value assumed to be less than or equal to endDateVal.
The end date value assumed to be greater than or equal to startDateVal.
Basis 1, Actual/Actual date convention
The start date value assumed to be less than or equal to endDateVal.
The end date value assumed to be greater than or equal to startDateVal.
Basis 2, Actual/360 date convention
The start date value assumed to be less than or equal to endDateVal.
The end date value assumed to be greater than or equal to startDateVal.
Basis 3, Actual/365 date convention
The start date value assumed to be less than or equal to endDateVal.
The end date value assumed to be greater than or equal to startDateVal.
Basis 4, European 30/360 date convention
The start date value assumed to be less than or equal to endDateVal.
The end date value assumed to be greater than or equal to startDateVal.
Calculates the adjusted.
The start date.
The end date.
The date1day.
The date2day.
Determines whether [is last day of month] [the specified date].
The date.
true if [is last day of month] [the specified date]; otherwise, false.
Gets the last day of month.
The date.
Assumes dates are no more than 1 year apart.
The start.
The end.
true
if dates both within a leap year, or span a period including Feb 29
return the whole number of days between the two time-stamps. Both time-stamps are
assumed to represent 12:00 midnight on the respective day.
The start date ticks.
The end date ticks.
Averages the length of the year.
The start year.
The end year.
determine Leap Year
the year
Determines whether [is greater than one year] [the specified start].
The start date.
The end date.
true if [is greater than one year] [the specified start]; otherwise, false.
Creates the date.
The day count.
Simple Date Wrapper
1-based month
day of month
milliseconds since 1970
Stores the parameters that identify the evaluation of one cell.
A (mostly) opaque interface To allow test clients To trace cache values
Each spreadsheet cell Gets one unique cache entry instance. These objects
are safe To use as keys in {@link java.util.HashMap}s
Calls formulaCell.SetFormulaResult(null, null) recursively all the way up the tree of
dependencies. Calls usedCell.ClearConsumingCell(fc) for each child of a cell that Is
Cleared along the way.
@param formulaCells
Identical To {@link #RecurseClearCachedFormulaResults()} except for the listener call-backs
Stores details about the current evaluation of a cell.
@param inputCell a cell directly used by the formula of this evaluation frame
@return never null, (possibly empty) array of all cells directly used while
evaluating the formula of this frame.
Manages a collection of {@link WorkbookEvaluator}s, in order To support evaluation of formulas
across spreadsheets.
For POI internal use only
@author Josh Micich
Performance optimisation for {@link HSSFFormulaEvaluator}. This class stores previously
calculated values of already visited cells, To avoid unnecessary re-calculation when the
same cells are referenced multiple times
@author Josh Micich
only used for testing. null otherwise
Should be called whenever there are Changes To input cells in the evaluated workbook.
Instances of this class keep track of multiple dependent cell evaluations due
To recursive calls To
The main purpose of this class is To detect an attempt To evaluate a cell
that is already being evaluated. In other words, it detects circular
references in spreadsheet formulas.
@author Josh Micich
Notifies this evaluation tracker that evaluation of the specified cell Is
about To start.
In the case of a true return code, the caller should
continue evaluation of the specified cell, and also be sure To call
endEvaluate() when complete.
In the case of a null return code, the caller should
return an evaluation result of
ErrorEval.CIRCULAR_REF_ERROR, and not call endEvaluate().
@return false if the specified cell is already being evaluated
Notifies this evaluation tracker that the evaluation of the specified cell is complete.
Every successful call To startEvaluate must be followed by a call To endEvaluate (recommended in a finally block) To enable
proper tracking of which cells are being evaluated at any point in time.
Assuming a well behaved client, parameters To this method would not be
required. However, they have been included To assert correct behaviour,
and form more meaningful error messages.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Common interface of {@link AreaEval} and {@link NPOI.ss.formula.Eval.AreaEvalBase}
@author Josh Micich
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@param rowIndex relative row index (zero based)
@param columnIndex relative column index (zero based)
@return element at the specified row and column position
@param rowIndex relative row index (zero based)
@return a single row {@link TwoDEval}
@param columnIndex relative column index (zero based)
@return a single column {@link TwoDEval}
@return true if the cell at row and col is a subtotal
@return true if the area has just a single row, this also includes
the trivial case when the area has just a single cell.
@return true if the area has just a single column, this also includes
the trivial case when the area has just a single cell.
returns true if the cell at row and col specified
as absolute indexes in the sheet is contained in
this area.
@param row
@param col
returns true if the specified col is in range
@param col
returns true if the specified row is in range
@param row
@return the ValueEval from within this area at the specified row and col index. Never
null
(possibly {@link BlankEval}). The specified indexes should be absolute
indexes in the sheet and not relative indexes within the area.
@return the ValueEval from within this area at the specified relativeRowIndex and
relativeColumnIndex. Never null (possibly {@link BlankEval}). The
specified indexes should relative to the top left corner of this area.
Creates an {@link AreaEval} offset by a relative amount from from the upper left cell
of this area
returns the 0-based index of the first row in
this area.
returns the 0-based index of the last row in
this area.
returns the 0-based index of the first col in
this area.
returns the 0-based index of the last col in
this area.
@author Josh Micich
@return whether cell at rowIndex and columnIndex is a subtotal.
By default return false which means 'don't care about subtotals'
@author Amol S. Deshmukh < amolweb at ya hoo dot com > This class is a
marker class. It is a special value for empty cells.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@return never null
, possibly empty string.
Convenience method for the following:
(b ? BoolEval.TRUE : BoolEval.FALSE)
@return a BoolEval instance representing b.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Convenience base class for functions that must take exactly two arguments.
@author Josh Micich
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
#NULL! - Intersection of two cell ranges is empty
#DIV/0! - Division by zero
#VALUE! - Wrong type of operand
#REF! - Illegal or deleted cell reference
#NAME? - Wrong function or range name
#NUM! - Value range overflow
#N/A - Argument or function not available
Translates an Excel internal error code into the corresponding POI ErrorEval instance
@param errorCode
Converts error codes to text. Handles non-standard error codes OK.
For debug/test purposes (and for formatting error messages).
@return the String representation of the specified Excel error code.
@param errorCode an 8-bit value
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
This class is used to simplify error handling logic within operator and function
implementations. Note - OperationEval.Evaluate() and Function.Evaluate()
method signatures do not throw this exception so it cannot propagate outside.
Here is an example coded without EvaluationException, to show how it can help:
public Eval Evaluate(Eval[] args, int srcRow, short srcCol) {
// ...
Eval arg0 = args[0];
if(arg0 is ErrorEval) {
return arg0;
}
if(!(arg0 is AreaEval)) {
return ErrorEval.VALUE_INVALID;
}
double temp = 0;
AreaEval area = (AreaEval)arg0;
ValueEval[] values = area.LittleEndianConstants.BYTE_SIZE;
for (int i = 0; i < values.Length; i++) {
ValueEval ve = values[i];
if(ve is ErrorEval) {
return ve;
}
if(!(ve is NumericValueEval)) {
return ErrorEval.VALUE_INVALID;
}
temp += ((NumericValueEval)ve).NumberValue;
}
// ...
}
In this example, if any error is encountered while Processing the arguments, an error is
returned immediately. This code is difficult to refactor due to all the points where errors
are returned.
Using EvaluationException allows the error returning code to be consolidated to one
place.
public Eval Evaluate(Eval[] args, int srcRow, short srcCol) {
try {
// ...
AreaEval area = GetAreaArg(args[0]);
double temp = sumValues(area.LittleEndianConstants.BYTE_SIZE);
// ...
} catch (EvaluationException e) {
return e.GetErrorEval();
}
}
private static AreaEval GetAreaArg(Eval arg0){
if (arg0 is ErrorEval) {
throw new EvaluationException((ErrorEval) arg0);
}
if (arg0 is AreaEval) {
return (AreaEval) arg0;
}
throw EvaluationException.InvalidValue();
}
private double sumValues(ValueEval[] values){
double temp = 0;
for (int i = 0; i < values.Length; i++) {
ValueEval ve = values[i];
if (ve is ErrorEval) {
throw new EvaluationException((ErrorEval) ve);
}
if (!(ve is NumericValueEval)) {
throw EvaluationException.InvalidValue();
}
temp += ((NumericValueEval) ve).NumberValue;
}
return temp;
}
It is not mandatory to use EvaluationException, doing so might give the following advantages:
- Methods can more easily be extracted, allowing for re-use.
- Type management (typecasting etc) is simpler because error conditions have been Separated from
intermediate calculation values.
- Fewer local variables are required. Local variables can have stronger types.
- It is easier to mimic common Excel error handling behaviour (exit upon encountering first
error), because exceptions conveniently propagate up the call stack regardless of execution
points or the number of levels of nested calls.
Note - Only standard evaluation errors are represented by EvaluationException (
i.e. conditions expected to be encountered when evaluating arbitrary Excel formulas). Conditions
that could never occur in an Excel spReadsheet should result in runtime exceptions. Care should
be taken to not translate any POI internal error into an Excel evaluation error code.
@author Josh Micich
#VALUE! - Wrong type of operand
#REF! - Illegal or deleted cell reference
#NUM! - Value range overflow
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Register a new function in runtime.
@param name the function name
@param func the functoin to register
@throws ArgumentException if the function is unknown or already registered.
@since 3.8 beta6
Returns a collection of function names implemented by POI.
@return an array of supported functions
@since 3.8 beta6
Returns an array of function names NOT implemented by POI.
@return an array of not supported functions
@since 3.8 beta6
Some function IDs that require special treatment
1
78
100
148
255
@author Josh Micich
@return simple rectangular {@link AreaEval} which represents the intersection of areas
aeA and aeB. If the two areas do not intersect, the result is null
.
@author Josh Micich
Creates a NameEval representing a function name
@author Josh Micich
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Provides functionality for evaluating arguments to functions and operators.
@author Josh Micich
Retrieves a single value from a variety of different argument types according to standard
Excel rules. Does not perform any type conversion.
@param arg the Evaluated argument as passed to the function or operator.
@param srcCellRow used when arg is a single column AreaRef
@param srcCellCol used when arg is a single row AreaRef
@return a NumberEval, StringEval, BoolEval or BlankEval.
Never null or ErrorEval.
@throws EvaluationException(#VALUE!) if srcCellRow or srcCellCol do not properly index into
an AreaEval. If the actual value retrieved is an ErrorEval, a corresponding
EvaluationException is thrown.
Implements (some perhaps not well known) Excel functionality to select a single cell from an
area depending on the coordinates of the calling cell. Here is an example demonstrating
both selection from a single row area and a single column area in the same formula.
| A | B | C | D |
1 | 15 | 20 | 25 | |
2 | | | | 200 |
3 | | | | 300 |
3 | | | | 400 |
If the formula "=1000+A1:B1+D2:D3" is put into the 9 cells from A2 to C4, the spReadsheet
will look like this:
| A | B | C | D |
1 | 15 | 20 | 25 | |
2 | 1215 | 1220 | #VALUE! | 200 |
3 | 1315 | 1320 | #VALUE! | 300 |
4 | #VALUE! | #VALUE! | #VALUE! | 400 |
Note that the row area (A1:B1) does not include column C and the column area (D2:D3) does
not include row 4, so the values in C1(=25) and D4(=400) are not accessible to the formula
as written, but in the 4 cells A2:B3, the row and column selection works ok.
The same concept is extended to references across sheets, such that even multi-row,
multi-column areas can be useful.
Of course with carefully (or carelessly) chosen parameters, cyclic references can occur and
hence this method can throw a 'circular reference' EvaluationException. Note that
this method does not attempt to detect cycles. Every cell in the specified Area ae
has already been Evaluated prior to this method call. Any cell (or cells) part of
ae that would incur a cyclic reference error if selected by this method, will
already have the value ErrorEval.CIRCULAR_REF_ERROR upon entry to this method. It
is assumed logic exists elsewhere to produce this behaviour.
@return whatever the selected cell's Evaluated value Is. Never null. Never
ErrorEval.
@if there is a problem with indexing into the area, or if the
Evaluated cell has an error.
@return possibly ErrorEval, and null
Applies some conversion rules if the supplied value is not already an integer.
Value is first Coerced to a double ( See CoerceValueTodouble() ).
Excel typically Converts doubles to integers by truncating toward negative infinity.
The equivalent java code Is:
return (int)Math.floor(d);
not:
return (int)d; // wrong - rounds toward zero
Applies some conversion rules if the supplied value is not already a number.
Note - BlankEval is not supported and must be handled by the caller.
@param ev must be a NumberEval, StringEval or BoolEval
@return actual, Parsed or interpreted double value (respectively).
@throws EvaluationException(#VALUE!) only if a StringEval is supplied and cannot be Parsed
as a double (See Parsedouble() for allowable formats).
@throws Exception if the supplied parameter is not NumberEval,
StringEval or BoolEval
Converts a string to a double using standard rules that Excel would use.
Tolerates currency prefixes, commas, leading and trailing spaces.
Some examples:
" 123 " -> 123.0
".123" -> 0.123
These not supported yet:
" $ 1,000.00 " -> 1000.0
"$1.25E4" -> 12500.0
"5**2" -> 500
"250%" -> 2.5
@param text
@return null if the specified text cannot be Parsed as a number
@param ve must be a NumberEval, StringEval, BoolEval, or BlankEval
@return the Converted string value. never null
@return null to represent blank values
@throws EvaluationException if ve is an ErrorEval, or if a string value cannot be converted
Implementation of Excel formula token '%'.
@author Josh Micich
@author Josh Micich
@author Amol S Deshmukh < amolweb at ya hoo dot com >
RefEval is the base interface for Ref2D and Ref3DEval. Basically a RefEval
impl should contain reference to the original ReferencePtg or Ref3DPtg as
well as the "value" resulting from the evaluation of the cell
reference. Thus if the HSSFCell has type CELL_TYPE_NUMERIC, the contained
value object should be of type NumberEval; if cell type is CELL_TYPE_STRING,
contained value object should be of type StringEval
Creates an {@link AreaEval} offset by a relative amount from this RefEval
The (possibly Evaluated) ValueEval contained
in this RefEval. eg. if cell A1 Contains "test"
then in a formula referring to cell A1
the RefEval representing
A1 will return as the InnerValueEval the
object of concrete type StringEval
returns the zero based column index.
returns the zero based row index.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo Dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Returns an is StringValueEval or ErrorEval or BlankEval
@param eval
@param srcRow
@param srcCol
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
This is a documentation of the observed behaviour of
the '+' operator in Excel:
- 1+TRUE = 2
- 1+FALSE = 1
- 1+"true" = #VALUE!
- 1+"1" = 2
- 1+A1 = #VALUE if A1 Contains "1"
- 1+A1 = 2 if A1 Contains ="1"
- 1+A1 = 2 if A1 Contains TRUE or =TRUE
- 1+A1 = #VALUE! if A1 Contains "TRUE" or ="TRUE"
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
returned value can be either A NumericValueEval, BlankEval or ErrorEval.
The params can be either NumberEval, BoolEval, StringEval, or
RefEval
@param eval
no args are required since BlankEval has only one
instance. If flag is Set, a zero
valued numbereval is returned, else BlankEval.INSTANCE
is returned.
uses the relevant flags to decode the supplied RefVal
@param eval
uses the relevant flags to decode the StringEval
@param eval
uses the relevant flags to decode the StringEval
@param eval
Should be implemented by any {@link Ptg} subclass that needs Has an extern sheet index
For POI internal use only
@author Josh Micich
Encapsulates an encoded formula token array.
@author Josh Micich
immutable
Convenience method for {@link #read(int, LittleEndianInput, int)}
When there are no array constants present, encodedTokenLen==totalEncodedLen
@param encodedTokenLen number of bytes in the stream taken by the plain formula tokens
@param totalEncodedLen the total number of bytes in the formula (includes trailing encoding
for array constants, but does not include 2 bytes for initial ushort encodedTokenLen field.
@return A new formula object as read from the stream. Possibly empty, never null
.
Writes The formula encoding is includes:
- ushort tokenDataLen
- tokenData
- arrayConstantData (if present)
Creates a {@link Formula} object from a supplied {@link Ptg} array.
Handles null
s OK.
@param ptgs may be null
@return Never null
(Possibly empty if the supplied ptgs is null
)
Gets the {@link Ptg} array from the supplied {@link Formula}.
Handles null
s OK.
@param formula may be null
@return possibly null
(if the supplied formula is null
)
@return total formula encoding length. The formula encoding includes:
- ushort tokenDataLen
- tokenData
- arrayConstantData (optional)
Note - this value is different to tokenDataLength
This method is often used when the formula length does not appear immediately before
the encoded token data.
@return the encoded length of the plain formula tokens. This does not include
the leading ushort field, nor any trailing array constant data.
Gets the locator for the corresponding {@link SharedFormulaRecord}, {@link ArrayRecord} or
{@link TableRecord} if this formula belongs to such a grouping. The {@link CellReference}
returned by this method will match the top left corner of the range of that grouping.
The return value is usually not the same as the location of the cell containing this formula.
@return the firstRow & firstColumn of an array formula or shared formula that this formula
belongs to. null
if this formula is not part of an array or shared formula.
@author Josh Micich
@return null if not found
Stores the cached result of a formula evaluation, along with the Set of sensititive input cells
@author Josh Micich
Cells 'used' in the current evaluation of the formula corresponding To this cache entry
If any of the following cells Change, this cache entry needs To be Cleared
A custom implementation of {@link java.util.HashSet} in order To reduce memory consumption.
Profiling tests (Oct 2008) have shown that each element {@link FormulaCellCacheEntry} takes
around 32 bytes To store in a HashSet, but around 6 bytes To store here. For Spreadsheets with
thousands of formula cells with multiple interdependencies, the savings can be very significant.
@author Josh Micich
Specific exception thrown when a supplied formula does not Parse properly.
Primarily used by test cases when testing for specific parsing exceptions.
This class was given package scope until it would become Clear that it is useful to general client code.
Lookahead Character.
Gets value '\0' when the input string is exhausted
Create the formula Parser, with the string that is To be
Parsed against the supplied workbook.
A later call the Parse() method To return ptg list in
rpn order, then call the GetRPNPtg() To retrive the
Parse results.
This class is recommended only for single threaded use.
If you only have a usermodel.HSSFWorkbook, and not a
model.Workbook, then use the convenience method on
usermodel.HSSFFormulaEvaluator
Parse a formula into a array of tokens
@param formula the formula to parse
@param workbook the parent workbook
@param formulaType the type of the formula, see {@link FormulaType}
@param sheetIndex the 0-based index of the sheet this formula belongs to.
The sheet index is required to resolve sheet-level names. -1
means that
the scope of the name will be ignored and the parser will match names only by name
@return array of parsed tokens
@throws FormulaParseException if the formula is unparsable
Read New Character From Input Stream
Report What Was Expected
Recognize an Alpha Character
Recognize a Decimal Digit
Recognize an Alphanumeric
Recognize White Space
Skip Over Leading White Space
Consumes the next input character if it is equal To the one specified otherwise throws an
unchecked exception. This method does not consume whitespace (before or after the
matched character).
Get a Number
From OOO doc: "Whenever one operand of the reference subexpression is a function,
a defined name, a 3D reference, or an external reference (and no error occurs),
a tMemFunc token is used"
@return true if the specified character may be used in a defined name
@param currentParsePosition used to format a potential error message
@return false if sub-expression represented the specified ParseNode definitely
cannot appear on either side of the range (':') operator
Parses area refs (things which could be the operand of ':') and simple factors
Examples
A$1
$A$1 : $B1
A1 ....... C2
Sheet1 !$A1
a..b!A1
'my sheet'!A1
.my.sheet!A1
my.named..range.
foo.bar(123.456, "abc")
123.456
"abc"
true
Parses simple factors that are not primitive ranges or range components
i.e. '!', ':'(and equiv '...') do not appear
Examples
my.named...range.
foo.bar(123.456, "abc")
123.456
"abc"
true
@param sheetIden may be null
@param part1
@param part2 may be null
Parses out a potential LHS or RHS of a ':' intended to produce a plain AreaRef. Normally these are
proper cell references but they could also be row or column refs like "$AC" or "10"
@return null
(and leaves {@link #_pointer} unchanged if a proper range part does not parse out
"A1", "B3" -> "A1:B3"
"sheet1!A1", "B3" -> "sheet1!A1:B3"
@return null if the range expression cannot / shouldn't be reduced.
Note - caller should reset {@link #_pointer} upon null
result
@return The sheet name as an identifier null
if '!' is not found in the right place
very similar to {@link SheetNameFormatter#isSpecialChar(char)}
@return true if the specified name is a valid cell reference
Note - Excel Function names are 'case aware but not case sensitive'. This method may end
up creating a defined name record in the workbook if the specified name is not an internal
Excel Function, and Has not been encountered before.
@param name case preserved Function name (as it was entered/appeared in the formula).
* Generates the variable Function ptg for the formula.
*
* For IF Formulas, Additional PTGs are Added To the Tokens
* @param name a {@link NamePtg} or {@link NameXPtg} or null
* @return Ptg a null is returned if we're in an IF formula, it needs extreme manipulation and is handled in this Function
Get arguments To a Function
Parse and Translate a Math Factor
factors (without ^ or % )
Get a PTG for an integer from its string representation.
return Int or Number Ptg based on size of input
Parse and Translate a Math Term
Parse and Translate an Expression
API call To execute the parsing of the formula
A1, $A1, A$1, $A$1, A, 1
@return true if the two range parts can be combined in an
{@link AreaPtg} ( Note - the explicit range operator (:) may still be valid
when this method returns false )
Common logic for rendering formulas.
For POI internal use only
@author Josh Micich
Static method To convert an array of {@link Ptg}s in RPN order
To a human readable string format in infix mode.
@param book used for defined names and 3D references
@param ptgs must not be null
@return a human readable String
Enumeration of various formula types.
For POI internal use only
@author Josh Micich
Optimisation - compacts many blank cell references used by a single formula.
@author Josh Micich
Creates a text reference as text, given specified row and column numbers.
@author Aniket Banerjee (banerjee@google.com)
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
This Is the base class for all excel function evaluator
classes that take variable number of operands, and
where the order of operands does not matter
Collects values from a single argument
Returns a double array that contains values for the numeric cells
from among the list of operands. Blanks and Blank equivalent cells
are ignored. Error operands or cells containing operands of type
that are considered invalid and would result in #VALUE! error in
excel cause this function to return null.
@return never null
Ensures that a two dimensional array has all sub-arrays present and the same Length
@return false if any sub-array Is missing, or Is of different Length
Maximum number of operands accepted by this function.
Subclasses may override to Change default value.
Whether to count nested subtotals.
ignore nested subtotals.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Here are the general rules concerning bool functions:
- Blanks are not either true or false
- Strings are not either true or false (even strings "true" or "TRUE" or "0" etc.)
- Numbers: 0 Is false. Any other number Is TRUE.
- References are Evaluated and above rules apply.
- Areas: Individual cells in area are Evaluated and Checked to
see if they are blanks, strings etc.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Convenience base class for functions that only take zero arguments.
@author Josh Micich
Implemented by all functions that can be called with zero arguments
@author Josh Micich
see {@link Function#Evaluate(ValueEval[], int, int)}
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Implementation of Excel functions Date parsing functions:
Date - DAY, MONTH and YEAR
Time - HOUR, MINUTE and SECOND
@author Others (not mentioned in code)
@author Thies Wellpott
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Josh Micich
Implementation for Excel COLUMNS function.
@author Josh Micich
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Counts the number of cells that contain numeric data within
the list of arguments.
Excel Syntax
COUNT(value1,value2,...)
Value1, value2, ... are 1 to 30 arguments representing the values or ranges to be Counted.
TODO: Check this properly Matches excel on edge cases
like formula cells, error cells etc
Create an instance of Count to use in {@link Subtotal}
If there are other subtotals within argument refs (or nested subtotals),
these nested subtotals are ignored to avoid double counting.
@see Subtotal
Common interface for the matching criteria.
Counts the number of cells that contain data within the list of arguments.
Excel Syntax
COUNTA(value1,value2,...)
Value1, value2, ... are 1 to 30 arguments representing the values or ranges to be Counted.
@author Josh Micich
don't count cells that are subtotals
Implementation for the function COUNTBLANK
Syntax: COUNTBLANK ( range )
range | is the range of cells to count blanks |
@author Mads Mohr Christensen
Implementation for the function COUNTIF
Syntax: COUNTIF ( range, criteria )
range | is the range of cells to be Counted based on the criteria |
criteria | is used to determine which cells to Count |
@author Josh Micich
@return the number of evaluated cells in the range that match the specified criteria
@return the de-referenced criteria arg (possibly {@link ErrorEval})
When the second argument is a string, many things are possible
Creates a criteria predicate object for the supplied criteria arg
@return null
if the arg evaluates to blank.
bool literals ('TRUE', 'FALSE') treated similarly but NOT same as numbers.
@return number of characters used to represent this operator
Translates Excel countif wildcard strings into .NET regex strings
Excel wildcard expression
return null if the specified value contains no special wildcard characters.
Common logic for COUNT, COUNTA and COUNTIF
@author Josh Micich
@return 1 if the evaluated cell matches the specified criteria
@return the number of evaluated cells in the range that match the specified criteria
@author Pavel Krupets (pkrupets at palmtreebusiness dot com)
Convenience base class for functions that must take exactly three arguments.
@author Josh Micich
* Note - works with Java Calendar months, not Excel months
* Java Calendar month = Excel month + 1
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Super class for all Evals for financial function evaluation.
Implemented by all functions that can be called with four arguments
@author Josh Micich
see {@link Function#Evaluate(ValueEval[], int, int)}
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
This class Is a functon library for common fiscal functions.
Glossary of terms/abbreviations:
- FV: Future Value
- PV: Present Value
- NPV: Net Present Value
- PMT: (Periodic) Payment
For more info on the terms/abbreviations please use the references below
(hyperlinks are subject to Change):
Online References:
- GNU Emacs Calc 2.02 Manual: http://theory.uwinnipeg.ca/gnu/calc/calc_203.html
- Yahoo Financial Glossary: http://biz.yahoo.com/f/g/nn.html#y
- MS Excel function reference: http://office.microsoft.com/en-us/assistance/CH062528251033.aspx
Implementation Notes:
Symbols used in the formulae that follow:
- p: present value
- f: future value
- n: number of periods
- y: payment (in each period)
- r: rate
- ^: the power operator (NOT the java bitwise XOR operator!)
[From MS Excel function reference] Following are some of the key formulas
that are used in this implementation:
p(1+r)^n + y(1+rt)((1+r)^n-1)/r + f=0 ...{when r!=0}
ny + p + f=0 ...{when r=0}
Future value of an amount given the number of payments, rate, amount
of individual payment, present value and bool value indicating whether
payments are due at the beginning of period
(false => payments are due at end of period)
@param r rate
@param n num of periods
@param y pmt per period
@param p future value
@param t type (true=pmt at end of period, false=pmt at begining of period)
Present value of an amount given the number of future payments, rate, amount
of individual payment, future value and bool value indicating whether
payments are due at the beginning of period
(false => payments are due at end of period)
@param r
@param n
@param y
@param f
@param t
calculates the Net Present Value of a principal amount
given the disCount rate and a sequence of cash flows
(supplied as an array). If the amounts are income the value should
be positive, else if they are payments and not income, the
value should be negative.
@param r
@param cfs cashflow amounts
@param r
@param n
@param p
@param f
@param t
@param r
@param y
@param p
@param f
@param t
Convenience base class for functions that must take exactly four arguments.
@author Josh Micich
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Implementation of the HLOOKUP() function.
HLOOKUP Finds a column in a lookup table by the first row value and returns the value from another row.
Syntax:
HLOOKUP(lookup_value, table_array, row_index_num, range_lookup)
lookup_value The value to be found in the first column of the table array.
table_array An area reference for the lookup data.
row_index_num a 1 based index specifying which row value of the lookup data will be returned.
range_lookup If TRUE (default), HLOOKUP Finds the largest value less than or equal to
the lookup_value. If FALSE, only exact Matches will be considered
@author Josh Micich
Returns one column from an AreaEval
@(#VALUE!) if colIndex Is negative, (#REF!) if colIndex Is too high
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Implementation for the Excel function INDEX
Syntax :
INDEX ( reference, row_num[, column_num [, area_num]])
INDEX ( array, row_num[, column_num])
reference | typically an area reference, possibly a union of areas |
array | a literal array value (currently not supported) |
row_num | selects the row within the array or area reference |
column_num | selects column within the array or area reference. default Is 1 |
area_num | used when reference Is a union of areas |
@author Josh Micich
@param colArgWasPassed false if the INDEX argument lIst had just 2 items
(exactly 1 comma). If anything Is passed for the column_num argument
(including {@link BlankEval} or {@link MIssingArgEval}) this parameter will be
true. ThIs parameter is needed because error codes are slightly
different when only 2 args are passed.
@param arg a 1-based index.
@return the Resolved 1-based index. Zero if the arg was missing or blank
@throws EvaluationException if the arg Is an error value evaluates to a negative numeric value
Implementation for Excel function INDIRECT
INDIRECT() returns the cell or area reference denoted by the text argument.
Syntax:
INDIRECT(ref_text,isA1Style)
ref_text a string representation of the desired reference as it would normally be written
in a cell formula.
isA1Style (default TRUE) specifies whether the ref_text should be interpreted as A1-style
or R1C1-style.
@author Josh Micich
@return array of length 2: {workbookName, sheetName,}. Second element will always be
present. First element may be null if sheetName is unqualified.
Returns null
if text cannot be parsed.
@return null
if there is a syntax error in any escape sequence
(the typical syntax error is a single quote character not followed by another).
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Calculates the internal rate of return.
Syntax is IRR(values) or IRR(values,guess)
@author Marcel May
@author Yegor Kozlov
@see Wikipedia on IRR
@see Excel IRR
Computes the internal rate of return using an estimated irr of 10 percent.
@param income the income values.
@return the irr.
Calculates IRR using the Newton-Raphson Method.
Starting with the guess, the method cycles through the calculation until the result
is accurate within 0.00001 percent. If IRR can't find a result that works
after 20 tries, the Double.NaN is returned.
The implementation is inspired by the NewtonSolver from the Apache Commons-Math library,
@see http://commons.apache.org
@param values the income values.
@param guess the initial guess of irr.
@return the irr value. The method returns Double.NaN
if the maximum iteration count is exceeded
@see
http://en.wikipedia.org/wiki/Internal_rate_of_return#Numerical_solution
@see
http://en.wikipedia.org/wiki/Newton%27s_method
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Represents a single row or column within an AreaEval.
Implementation of Excel function LOOKUP.
LOOKUP Finds an index row in a lookup table by the first column value and returns the value from another column.
Syntax:
VLOOKUP(lookup_value, lookup_vector, result_vector)
lookup_value The value to be found in the lookup vector.
lookup_vector An area reference for the lookup data.
result_vector Single row or single column area reference from which the result value Is chosen.
@author Josh Micich
Common functionality used by VLOOKUP, HLOOKUP, LOOKUP and MATCH
@author Josh Micich
@return null if the supplied area is neither a single row nor a single colum
Processes the third argument to VLOOKUP, or HLOOKUP (col_index_num
or row_index_num respectively).
Sample behaviour:
Input Return | Value | Thrown Error |
5 | 4 | |
2.9 | 2 | |
"5" | 4 | |
"2.18e1" | 21 | |
"-$2" | -3 | * |
FALSE | -1 | * |
TRUE | 0 | |
"TRUE" | | #REF! |
"abc" | | #REF! |
"" | | #REF! |
<blank> | | #VALUE! |
* Note - out of range errors (both too high and too low) are handled by the caller.
@return column or row index as a zero-based value
The second argument (table_array) should be an area ref, but can actually be a cell ref, in
which case it Is interpreted as a 1x1 area ref. Other scalar values cause #VALUE! error.
Resolves the last (optional) parameter (range_lookup) to the VLOOKUP and HLOOKUP functions.
@param rangeLookupArg
@param srcCellRow
@param srcCellCol
@return
@throws EvaluationException
Finds first (lowest index) exact occurrence of specified value.
@param lookupValue the value to be found in column or row vector
@param vector the values to be searched. For VLOOKUP this Is the first column of the
tableArray. For HLOOKUP this Is the first row of the tableArray.
@return zero based index into the vector, -1 if value cannot be found
Excel has funny behaviour when the some elements in the search vector are the wrong type.
Excel seems to handle mismatched types initially by just stepping 'mid' ix forward to the
first compatible value.
@param midIx 'mid' index (value which has the wrong type)
@return usually -1, signifying that the BinarySearchIndex has been narrowed to the new mid
index. Zero or greater signifies that an exact match for the lookup value was found
Once the binary search has found a single match, (V/H)LOOKUP steps one by one over subsequent
values to choose the last matching item.
@return one of 4 instances or CompareResult: LESS_THAN, EQUAL,
GREATER_THAN or TYPE_MISMATCH
used only for debug purposes
Enumeration to support 4 valued comparison results.
Excel lookup functions have complex behaviour in the case where the lookup array has mixed
types, and/or Is Unordered. Contrary to suggestions in some Excel documentation, there
does not appear to be a Universal ordering across types. The binary search algorithm used
Changes behaviour when the Evaluated 'mid' value has a different type to the lookup value.
A simple int might have done the same job, but there Is risk in confusion with the well
known Comparable.CompareTo() and Comparator.Compare() which both use
a ubiquitous 3 value result encoding.
Encapsulates some standard binary search functionality so the Unusual Excel behaviour can
be clearly distinguished.
@return -1 if the search range Is empty
Implementation for the MATCH() Excel function.
Syntax:
MATCH(lookup_value, lookup_array, match_type)
Returns a 1-based index specifying at what position in the lookup_array the specified
lookup_value Is found.
Specific matching behaviour can be modified with the optional match_type parameter.
Value | Matching Behaviour |
1 | (default) Find the largest value that Is less than or equal to lookup_value.
The lookup_array must be in ascending order*. |
0 | Find the first value that Is exactly equal to lookup_value.
The lookup_array can be in any order. |
-1 | Find the smallest value that Is greater than or equal to lookup_value.
The lookup_array must be in descending order*. |
* Note regarding order - For the match_type cases that require the lookup_array to
be ordered, MATCH() can produce incorrect results if this requirement Is not met. Observed
behaviour in Excel Is to return the lowest index value for which every item after that index
breaks the match rule.
The (ascending) sort order expected by MATCH() Is:
numbers (low to high), strings (A to Z), bool (FALSE to TRUE)
MATCH() ignores all elements in the lookup_array with a different type to the lookup_value.
Type conversion of the lookup_array elements Is never performed.
@author Josh Micich
@return zero based index
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
This class Is an extension to the standard math library
provided by java.lang.Math class. It follows the Math class
in that it has a private constructor and all static methods.
Returns a value rounded to p digits after decimal.
If p Is negative, then the number Is rounded to
places to the left of the decimal point. eg.
10.23 rounded to -1 will give: 10. If p Is zero,
the returned value Is rounded to the nearest integral
value.
If n Is negative, the resulting value Is obtained
as the round value of absolute value of n multiplied
by the sign value of n (@see MathX.sign(double d)).
Thus, -0.6666666 rounded to p=0 will give -1 not 0.
If n Is NaN, returned value Is NaN.
@param n
@param p
Returns a value rounded-up to p digits after decimal.
If p Is negative, then the number Is rounded to
places to the left of the decimal point. eg.
10.23 rounded to -1 will give: 20. If p Is zero,
the returned value Is rounded to the nearest integral
value.
If n Is negative, the resulting value Is obtained
as the round-up value of absolute value of n multiplied
by the sign value of n (@see MathX.sign(double d)).
Thus, -0.2 rounded-up to p=0 will give -1 not 0.
If n Is NaN, returned value Is NaN.
@param n
@param p
Returns a value rounded to p digits after decimal.
If p Is negative, then the number Is rounded to
places to the left of the decimal point. eg.
10.23 rounded to -1 will give: 10. If p Is zero,
the returned value Is rounded to the nearest integral
value.
If n Is negative, the resulting value Is obtained
as the round-up value of absolute value of n multiplied
by the sign value of n (@see MathX.sign(double d)).
Thus, -0.8 rounded-down to p=0 will give 0 not -1.
If n Is NaN, returned value Is NaN.
@param n
@param p
average of all values
@param values
sum of all values
@param values
sum of squares of all values
@param values
product of all values
@param values
min of all values. If supplied array Is zero Length,
double.POSITIVE_INFINITY Is returned.
@param values
min of all values. If supplied array Is zero Length,
double.NEGATIVE_INFINITY Is returned.
@param values
Note: this function Is different from java.lang.Math.floor(..).
When n and s are "valid" arguments, the returned value Is: Math.floor(n/s) * s;
n and s are invalid if any of following conditions are true:
- s Is zero
- n Is negative and s Is positive
- n Is positive and s Is negative
In all such cases, double.NaN Is returned.
@param n
@param s
Note: this function Is different from java.lang.Math.ceil(..).
When n and s are "valid" arguments, the returned value Is: Math.ceiling(n/s) * s;
n and s are invalid if any of following conditions are true:
- s Is zero
- n Is negative and s Is positive
- n Is positive and s Is negative
In all such cases, double.NaN Is returned.
@param n
@param s
for all n >= 1; factorial n = n * (n-1) * (n-2) * ... * 1
else if n == 0; factorial n = 1
else if n < 0; factorial n = double.NaN
Loss of precision can occur if n Is large enough.
If n Is large so that the resulting value would be greater
than double.MAX_VALUE; double.POSITIVE_INFINITY Is returned.
If n < 0, double.NaN Is returned.
@param n
returns the remainder resulting from operation:
n / d.
The result has the sign of the divisor.
Examples:
- mod(3.4, 2) = 1.4
- mod(-3.4, 2) = 0.6
- mod(-3.4, -2) = -1.4
- mod(3.4, -2) = -0.6
If d == 0, result Is NaN
@param n
@param d
inverse hyperbolic cosine
@param d
inverse hyperbolic sine
@param d
inverse hyperbolic tangent
@param d
hyperbolic cosine
@param d
hyperbolic sine
@param d
hyperbolic tangent
@param d
returns the sum of product of corresponding double value in each
subarray. It Is the responsibility of the caller to Ensure that
all the subarrays are of equal Length. If the subarrays are
not of equal Length, the return value can be Unpredictable.
@param arrays
returns the sum of difference of squares of corresponding double
value in each subarray: ie. sigma (xarr[i]^2-yarr[i]^2)
It Is the responsibility of the caller
to Ensure that the two subarrays are of equal Length. If the
subarrays are not of equal Length, the return value can be
Unpredictable.
@param xarr
@param yarr
returns the sum of sum of squares of corresponding double
value in each subarray: ie. sigma (xarr[i]^2 + yarr[i]^2)
It Is the responsibility of the caller
to Ensure that the two subarrays are of equal Length. If the
subarrays are not of equal Length, the return value can be
Unpredictable.
@param xarr
@param yarr
returns the sum of squares of difference of corresponding double
value in each subarray: ie. sigma ( (xarr[i]-yarr[i])^2 )
It Is the responsibility of the caller
to Ensure that the two subarrays are of equal Length. If the
subarrays are not of equal Length, the return value can be
Unpredictable.
@param xarr
@param yarr
returns the total number of combinations possible when
k items are chosen out of total of n items. If the number
Is too large, loss of precision may occur (since returned
value Is double). If the returned value Is larger than
double.MAX_VALUE, double.POSITIVE_INFINITY Is returned.
If either of the parameters Is negative, double.NaN Is returned.
@param n
@param k
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
if v is zero length or contains no duplicates, return value is
Double.NaN. Else returns the value that occurs most times and if there is
a tie, returns the first such value.
@param v
Implementation of Excel function NA()
@author Josh Micich
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
This Is the default implementation of a Function class.
The default behaviour Is to return a non-standard ErrorEval
"ErrorEval.FUNCTION_NOT_IMPLEMENTED". This error should alert
the user that the formula contained a function that Is not
yet implemented.
Implementation of Excel NOW() Function
@author Frank Taffelt
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Support for hyperbolic trig functions was Added as a part of
Java distribution only in JDK1.5. This class uses custom
naive implementation based on formulas at:
http://www.math2.org/math/trig/hyperbolics.htm
These formulas seem to agree with excel's implementation.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Support for hyperbolic trig functions was Added as a part of
Java distribution only in JDK1.5. This class uses custom
naive implementation based on formulas at:
http://www.math2.org/math/trig/hyperbolics.htm
These formulas seem to agree with excel's implementation.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Support for hyperbolic trig functions was Added as a part of
Java distribution only in JDK1.5. This class uses custom
naive implementation based on formulas at:
http://www.math2.org/math/trig/hyperbolics.htm
These formulas seem to agree with excel's implementation.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Log: LOG(number,[base])
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at yahoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
This checks is x = 0 and the mean = 0.
Excel currently returns the value 1 where as the
maths common implementation will error.
@param x The number.
@param mean The mean.
@return If a default value should be returned.
All long-representable factorials
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Implementation for Excel function OFFSet()
OFFSet returns an area reference that Is a specified number of rows and columns from a
reference cell or area.
Syntax:
OFFSet(reference, rows, cols, height, width)
reference Is the base reference.
rows Is the number of rows up or down from the base reference.
cols Is the number of columns left or right from the base reference.
height (default same height as base reference) Is the row Count for the returned area reference.
width (default same width as base reference) Is the column Count for the returned area reference.
@author Josh Micich
OFFSet's numeric arguments (2..5) have similar Processing rules
Fractional values are silently truncated by Excel.
Truncation Is toward negative infinity.
Exceptions are used within this class to help simplify flow control when error conditions
are enCountered
A one dimensional base + offset. Represents either a row range or a column range.
Two instances of this class toGether specify an area range.
Moves the range by the specified translation amount.
This method also 'normalises' the range: Excel specifies that the width and height
parameters (Length field here) cannot be negative. However, OFFSet() does produce
sensible results in these cases. That behavior Is replicated here.
@param translationAmount may be zero negative or positive
@return the equivalent LinearOffsetRange with a positive Length, moved by the
specified translationAmount.
Encapsulates either an area or cell reference which may be 2d or 3d.
Implementation for the PMT() Excel function.
Syntax:
PMT(rate, nper, pv, fv, type)
Returns the constant repayment amount required for a loan assuming a constant interest rate.
rate the loan interest rate.
nper the number of loan repayments.
pv the present value of the future payments (or principle).
fv the future value (default zero) surplus cash at the end of the loan lifetime.
type whether payments are due at the beginning(1) or end(0 - default) of each payment period.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Implementation for Excel ROWS function.
@author Josh Micich
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Library for common statistics functions
returns the mean of deviations from mean.
@param v
if v Is zero Length or Contains no duplicates, return value
Is double.NaN. Else returns the value that occurs most times
and if there Is a tie, returns the first such value.
@param v
Implementation for the Excel function SUBTOTAL
Syntax :
SUBTOTAL ( functionCode, ref1, ref2 ... )
functionCode | (1-11) Selects the underlying aggregate function to be used (see table below) |
ref1, ref2 ... | Arguments to be passed to the underlying aggregate function |
functionCode | Aggregate Function |
1 | AVERAGE |
2 | COUNT |
3 | COUNTA |
4 | MAX |
5 | MIN |
6 | PRODUCT |
7 | STDEV |
8 | STDEVP * |
9 | SUM |
10 | VAR * |
11 | VARP * |
101-111 | * |
* Not implemented in POI yet. Functions 101-111 are the same as functions 1-11 but with
the option 'ignore hidden values'.
@author Paul Tomlin < pault at bulk sms dot com >
Implementation for the Excel function SUMIF
Syntax :
SUMIF ( range, criteria, sum_range )
range | The range over which criteria is applied. Also used for addend values when the third parameter is not present |
criteria | The value or expression used to filter rows from range |
sum_range | Locates the top-left corner of the corresponding range of addends - values to be added (after being selected by the criteria) |
@author Josh Micich
@return a range of the same dimensions as aeRange using eval to define the top left corner.
@throws EvaluationException if eval is not a reference
Determines a double value for the specified ValueEval.
@param IsScalarProduct false for SUMPRODUCTs over area refs.
@throws EvalEx if ve represents an error value.
Note - string values and empty cells are interpreted differently depending on
isScalarProduct. For scalar products, if any term Is blank or a string, the
error (#VALUE!) Is raised. For area (sum)products, if any term Is blank or a string, the
result Is zero.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Constructs a new instance of the Accumulator used to calculated this function
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Manda Wilson < wilson at c bio dot msk cc dot org >
An implementation of the TRIM function:
Removes leading and trailing spaces from value if evaluated operand value is string.
An implementation of the MID function
MID returns a specific number of
characters from a text string, starting at the specified position.
Syntax: MID(text, start_num, num_chars)
@author Torstein Tauno Svendsen (torstei@officenet.no)
Implementation of the FIND() function.
Syntax: FIND(Find_text, within_text, start_num)
FIND returns the character position of the first (case sensitive) occurrence of
Find_text inside within_text. The third parameter,
start_num, is optional (default=1) and specifies where to start searching
from. Character positions are 1-based.
Implementation of the FIND() function. SEARCH is a case-insensitive version of FIND()
Syntax: SEARCH(Find_text, within_text, start_num)
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
An implementation of the MID function
MID returns a specific number of
Chars from a text string, starting at the specified position.
@author Manda Wilson < wilson at c bio dot msk cc dot org;
An implementation of the Replace function:
Replaces part of a text string based on the number of Chars
you specify, with another text string.
@author Manda Wilson < wilson at c bio dot msk cc dot org >
Replaces part of a text string based on the number of Chars
you specify, with another text string.
@see org.apache.poi.hssf.record.formula.eval.Eval
An implementation of the SUBSTITUTE function:
Substitutes text in a text string with new text, some number of times.
@author Manda Wilson < wilson at c bio dot msk cc dot org >
Substitutes text in a text string with new text, some number of times.
@see org.apache.poi.hssf.record.formula.eval.Eval
An implementation of the TEXT function
TEXT returns a number value formatted with the given number formatting string.
This function is not a complete implementation of the Excel function, but
handles most of the common cases. All work is passed down to
{@link DataFormatter} to be done, as this works much the same as the
display focused work that that does.
An implementation of the TRIM function:
Removes leading and trailing spaces from value if Evaluated operand
value Is string.
@author Manda Wilson < wilson at c bio dot msk cc dot org >
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
Implementation for the Excel function TIME
@author Steven Butler (sebutler @ gmail dot com)
Based on POI {@link DateFunc}
Converts the supplied hours, minutes and seconds to an Excel time value.
@param ds array of 3 doubles Containing hours, minutes and seconds.
Non-integer inputs are tRuncated to an integer before further calculation
of the time value.
@return An Excel representation of a time of day.
If the time value represents more than a day, the days are Removed from
the result, leaving only the time of day component.
@throws NPOI.SS.Formula.Eval.EvaluationException
If any of the arguments are greater than 32767 or the hours
minutes and seconds when combined form a time value less than 0, the function
Evaluates to an error.
"1,0000" is valid, "1,00" is not
TODO see if the same functionality is needed in {@link OperandResolver#parseDouble(String)}
@return null
if there is any problem converting the text
Convenience base class for any function which must take three or four
arguments
@author Josh Micich
Implementation of the VLOOKUP() function.
VLOOKUP Finds a row in a lookup table by the first column value and returns the value from another column.
Syntax:
VLOOKUP(lookup_value, table_array, col_index_num, range_lookup)
lookup_value The value to be found in the first column of the table array.
table_array An area reference for the lookup data.
col_index_num a 1 based index specifying which column value of the lookup data will be returned.
range_lookup If TRUE (default), VLOOKUP Finds the largest value less than or equal to
the lookup_value. If FALSE, only exact Matches will be considered
@author Josh Micich
Returns one column from an AreaEval
@(#VALUE!) if colIndex Is negative, (#REF!) if colIndex Is too high
Temporarily collects FunctionMetadata instances for creation of a
FunctionMetadataRegistry.
@author Josh Micich
stores indexes of all functions with footnotes (i.e. whose definitions might Change)
Holds information about Excel built-in functions.
@author Josh Micich
Converts the text meta-data file into a FunctionMetadataRegistry
@author Josh Micich
plain ASCII text metadata file uses three dots for ellipsis
Makes sure that footnote digits from the original OOO document have not been accidentally
left behind
Allows clients to Get FunctionMetadata instances for any built-in function of Excel.
@author Josh Micich
The name of the IF function (i.e. "IF"). Extracted as a constant for clarity.
Resolves a built-in function index.
@param name uppercase function name
@return a negative value if the function name is not found.
This typically occurs for external functions.
Tests can implement this class To track the internal working of the {@link WorkbookEvaluator}.
For POI internal testing use only
@author Josh Micich
Internally, formula {@link ICacheEntry}s are stored in Sets which may Change ordering due
To seemingly trivial Changes. This method is provided To make the order of call-backs To
{@link #onClearDependentCachedValue(ICacheEntry, int)} more deterministic.
Used to help optimise cell evaluation result caching by allowing applications to specify which
parts of a workbook are final.
The term final is introduced here to denote immutability or 'having constant definition'.
This classification refers to potential actions (on the evaluated workbook) by the evaluating
application. It does not refer to operations performed by the evaluator ({@link
WorkbookEvaluator}).
General guidelines:
- a plain value cell can be marked as 'final' if it will not be changed after the first call
to {@link WorkbookEvaluator#evaluate(EvaluationCell)}.
- a formula cell can be marked as 'final' if its formula will not be changed after the first
call to {@link WorkbookEvaluator#evaluate(EvaluationCell)}. This remains true even if changes
in dependent values may cause the evaluated value to change.
- plain value cells should be marked as 'not final' if their plain value value may change.
- formula cells should be marked as 'not final' if their formula definition may change.
- cells which may switch between plain value and formula should also be marked as 'not final'.
Notes:
- If none of the spreadsheet cells is expected to have its definition changed after evaluation
begins, every cell can be marked as 'final'. This is the most efficient / least resource
intensive option.
- To retain freedom to change any cell definition at any time, an application may classify all
cells as 'not final'. This freedom comes at the expense of greater memory consumption.
- For the purpose of these classifications, setting the cached formula result of a cell (for
example in {@link HSSFFormulaEvaluator#evaluateFormulaCell(org.apache.poi.ss.usermodel.Cell)})
does not constitute changing the definition of the cell.
- Updating cells which have been classified as 'final' will cause the evaluator to behave
unpredictably (typically ignoring the update).
@author Josh Micich
Convenience implementation for situations where all cell definitions remain fixed after
evaluation begins.
Checks if a cell's value(/formula) is fixed - in other words - not expected to be modified
between calls to the evaluator. (Note - this is an independent concept from whether a
formula cell's evaluated value may change during successive calls to the evaluator).
@param sheetIndex zero based index into workbook sheet list
@param rowIndex zero based row index of cell
@param columnIndex zero based column index of cell
@return false if the evaluating application may need to modify the specified
cell between calls to the evaluator.
@author Josh Micich
@return whether cell at rowIndex and columnIndex is a subtotal
@author Josh Micich
This class performs 'operand class' transformation. Non-base Tokens are classified into three
operand classes:
The operand class chosen for each Token depends on the formula type and the Token's place
in the formula. If POI Gets the operand class wrong, Excel may interpret the formula
incorrectly. This condition is typically manifested as a formula cell that displays as '#VALUE!',
but resolves correctly when the user presses F2, enter.
The logic implemented here was partially inspired by the description in
"OpenOffice.org's Documentation of the Microsoft Excel File Format". The model presented there
seems To be inconsistent with observed Excel behaviour (These differences have not been fully
investigated). The implementation in this class Has been heavily modified in order To satisfy
concrete examples of how Excel performs the same logic (see TestRVA).
Hopefully, as Additional important test cases are identified and Added To the test suite,
patterns might become more obvious in this code and allow for simplification.
@author Josh Micich
Traverses the supplied formula parse tree, calling Ptg.SetClass() for each non-base
Token To Set its operand class.
@param callerForceArrayFlag true if one of the current node's parents is a
function Ptg which Has been Changed from default 'V' To 'A' type (due To requirements on
the function return value).
Contains all the contextual information required to Evaluate an operation
within a formula
For POI internal use only
@author Josh Micich
@return null
if either workbook or sheet is not found
Resolves a cell or area reference dynamically.
@param workbookName the name of the workbook Containing the reference. If null
the current workbook is assumed. Note - to Evaluate formulas which use multiple workbooks,
a {@link CollaboratingWorkbooksEnvironment} must be set up.
@param sheetName the name of the sheet Containing the reference. May be null
(when workbookName is also null) in which case the current workbook and sheet is
assumed.
@param refStrPart1 the single cell reference or first part of the area reference. Must not
be null
.
@param refStrPart2 the second part of the area reference. For single cell references this
parameter must be null
@param isA1Style specifies the format for refStrPart1 and refStrPart2.
Pass true for 'A1' style and false for 'R1C1' style.
TODO - currently POI only supports 'A1' reference style
@return a {@link RefEval} or {@link AreaEval}
This class Creates OperationEval instances To help evaluate OperationPtg
formula Tokens.
@author Josh Micich
returns the OperationEval concrete impl instance corresponding
to the supplied operationPtg
Represents a syntactic element from a formula by encapsulating the corresponding Ptg
Token. Each ParseNode may have child ParseNodes in the case when the wrapped
Ptg is non-atomic.
@author Josh Micich
Collects the array of Ptg Tokens for the specified tree.
The IF() function Gets marked up with two or three tAttr Tokens.
Similar logic will be required for CHOOSE() when it is supported
See excelfileformat.pdf sec 3.10.5 "tAttr (19H)
@author Josh Micich
Used for non-formula cells, primarily To keep track of the referencing (formula) cells.
@author Josh Micich
This class provides the base functionality for Excel sheet functions
There are two kinds of function Ptgs - tFunc and tFuncVar
Therefore, this class will have ONLY two subclasses
@author Avik Sengupta
@author Andrew C. Oliver (acoliver at apache dot org)
defines a Ptg that is an operation instead of an operand
@author andy
Ptg represents a syntactic token in a formula. 'PTG' is an acronym for
'parse thing'. Originally, the name referred to the single
byte identifier at the start of the token, but in POI, Ptg encapsulates
the whole formula token (initial byte + value data).
Ptgs are logically arranged in a tree representing the structure of the
Parsed formula. However, in BIFF files Ptgs are written/Read in
Reverse-Polish Notation order. The RPN ordering also simplifies formula
evaluation logic, so POI mostly accesses Ptgs in the same way.
@author andy
@author avik
@author Jason Height (jheight at chariot dot net dot au)
Reads size bytes of the input stream, to Create an array of Ptgs.
Extra data (beyond size) may be Read if and ArrayPtgs are present.
@return a distinct copy of this Ptg if the class is mutable, or the same instance
if the class is immutable.
This method will return the same result as {@link #getEncodedSizeWithoutArrayData(Ptg[])}
if there are no array tokens present.
@return the full size taken to encode the specified Ptgs
Used to calculate value that should be encoded at the start of the encoded Ptg token array;
@return the size of the encoded Ptg tokens not including any trailing array data.
Writes the ptgs to the data buffer, starting at the specified offset.
The 2 byte encode Length field is not written by this method.
@return number of bytes written
Write this Ptg to a byte array
return a string representation of this token alone
Overridden toString method to Ensure object hash is not printed.
This helps Get rid of gratuitous diffs when comparing two dumps
Subclasses may output more relevant information by overriding this method
@return the encoded Length of this Ptg, including the initial Ptg type identifier byte.
@return false if this token is classified as 'reference', 'value', or 'array'
@return the 'operand class' (REF/VALUE/ARRAY) for this Ptg
Debug / diagnostic method to get this token's 'operand class' type.
@return 'R' for 'reference', 'V' for 'value', 'A' for 'array' and '.' for base tokens
returns a string representation of the operations
the Length of the input array should equal the number returned by
@see #GetNumberOfOperands
The number of operands expected by the operations
The name of the IF function (i.e. "IF"). Extracted as a constant for clarity.
All external functions have function index 255
Used to detect whether a function name found in a formula is one of the standard excel functions
The name matching is case insensitive.
@return true if the name specifies a standard worksheet function,
false if the name should be assumed to be an external function.
Resolves internal function names into function indexes.
The name matching is case insensitive.
@return the standard worksheet function index if found, otherwise FUNCTION_INDEX_EXTERNAL
external functions Get some special Processing
@return true if this is an external function
Addition operator PTG the "+" binomial operator. If you need more
explanation than that then well...We really can't help you here.
@author Andrew C. Oliver (acoliver@apache.org)
@author Jason Height (jheight at chariot dot net dot au)
Common baseclass of all value operators.
Subclasses include all Unary and binary operators except for the reference operators (IntersectionPtg, RangePtg, UnionPtg)
@author Josh Micich
All Operator Ptgs are base tokens (i.e. are not RVA classified)
implementation of method from OperationsPtg
Common superclass of 2-D area refs
Specifies a rectangular area of cells A1:A4 for instance.
@author andy
@author Jason Height (jheight at chariot dot net dot au)
@author Josh Micich
All Operand Ptgs are classifed ('relative', 'value', 'array')
Common interface for AreaPtg and Area3DPtg, and their
child classes.
@return the first row in the area
@return last row in the range (x2 in x1,y1-x2,y2)
@return the first column number in the area.
@return lastcolumn in the area
TODO - (May-2008) fix subclasses of AreaPtg 'AreaN~' which are used in shared formulas.
see similar comment in ReferencePtg
zero based, Unsigned 16 bit
zero based, Unsigned 16 bit
zero based, Unsigned 8 bit
zero based, Unsigned 8 bit
Set the last column irrespective of the bitmasks
@return the first row in the area
@return last row in the range (x2 in x1,y1-x2,y2)
@return the first column number in the area.
@return whether or not the first row is a relative reference or not.
@return Isrelative first column to relative or not
@return lastcolumn in the area
@return last column and bitmask (the raw field)
@return last row relative or not
@return lastcol relative or not
Title: Area 3D Ptg - 3D reference (Sheet + Area)
Description: Defined a area in Extern Sheet.
REFERENCE:
@author Libin Roman (Vista Portal LDT. Developer)
@author avik
@author Jason Height (jheight at chariot dot net dot au)
@version 1.0-pre
Should be implemented by any {@link Ptg} subclass that needs a workbook To render its formula.
For POI internal use only
@author Josh Micich
@return text representation of this area reference that can be used in text
formulas. The sheet name will get properly delimited if required.
AreaErr - handles deleted cell area references.
@author Daniel Noll (daniel at nuix dot com dot au)
Specifies a rectangular area of cells A1:A4 for instance.
@author Jason Height (jheight at chariot dot net dot au)
Specifies a rectangular area of cells A1:A4 for instance.
@author Jason Height (jheight at chariot dot net dot au)
ArrayPtg - handles arrays
The ArrayPtg is a little weird, the size of the Ptg when parsing initially only
includes the Ptg sid and the reserved bytes. The next Ptg in the expression then follows.
It is only after the "size" of all the Ptgs is met, that the ArrayPtg data is actually
held after this. So Ptg.CreateParsedExpression keeps track of the number of
ArrayPtg elements and need to Parse the data upto the FORMULA record size.
@author Jason Height (jheight at chariot dot net dot au)
The size of the plain tArray token written within the standard formula tokens
(not including the data which comes after all formula tokens)
@param values2d array values arranged in rows
Note - (2D) array elements are stored column by column
@return the index into the internal 1D array for the specified column and row
This size includes the size of the array Ptg plus the Array Ptg Token value size
Represents the initial plain tArray token (without the constant data that trails the whole
formula). Objects of this class are only temporary and cannot be used as {@link Ptg}s.
These temporary objects get converted to {@link ArrayPtg} by the
{@link #finishReading(LittleEndianInput)} method.
Read in the actual token (array) values. This occurs
AFTER the last Ptg in the expression.
See page 304-305 of Excel97-2007BinaryFileFormat(xls)Specification.pdf
"Special Attributes"
This seems to be a Misc Stuff and Junk record. One function it serves Is
in SUM functions (i.e. SUM(A1:A3) causes an area PTG then an ATTR with the SUM option Set)
@author andy
@author Jason Height (jheight at chariot dot net dot au)
Common baseclass for
tExp
tTbl
tParen
tNlr
tAttr
tSheet
tEndSheet
only used for tAttrChoose: table of offsets to starts of args
only used for tAttrChoose: offset to the tFuncVar for CHOOSE()
Creates the space.
a constant from SpaceType
The count.
Creates if.
distance (in bytes) to start of either
tFuncVar(IF) token (when false parameter is not present).
Creates the skip.
distance (in bytes) to position behind tFuncVar(IF) token (minus 1).
00H = Spaces before the next token (not allowed before tParen token)
01H = Carriage returns before the next token (not allowed before tParen token)
02H = Spaces before opening parenthesis (only allowed before tParen token)
03H = Carriage returns before opening parenthesis (only allowed before tParen token)
04H = Spaces before closing parenthesis (only allowed before tParen, tFunc, and tFuncVar tokens)
05H = Carriage returns before closing parenthesis (only allowed before tParen, tFunc, and tFuncVar tokens)
06H = Spaces following the equality sign (only in macro sheets)
bool (bool)
Stores a (java) bool value in a formula.
@author Paul Krause (pkrause at soundbite dot com)
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@author Josh Micich
@author andy
@author Jason Height (jheight at chariot dot net dot au)
Title: Deleted Area 3D Ptg - 3D referecnce (Sheet + Area)
Description: Defined a area in Extern Sheet.
REFERENCE:
@author Patrick Luby
@version 1.0-pre
Title: Deleted Reference 3D Ptg
Description: Defined a cell in extern sheet.
REFERENCE:
@author Patrick Luby
@version 1.0-pre
Creates new DeletedRef3DPtg
This PTG implements the standard binomial divide "/"
@author Andrew C. Oliver acoliver at apache dot org
@author Jason Height (jheight at chariot dot net dot au)
@author andy
@author Daniel Noll (daniel at nuix dot com dot au)
#NULL! - Intersection of two cell ranges is empty
#DIV/0! - Division by zero
#VALUE! - Wrong type of operand
#REF! - Illegal or deleted cell reference
#NAME? - Wrong function or range name
#NUM! - Value range overflow
#N/A - Argument or function not available
Creates new ErrPtg
@author andy
@author Jason Height (jheight at chariot dot net dot au)
@author dmui (save existing implementation)
@author Josh Micich
Extern sheet index of sheet where moving is occurring
Create an instance for shifting sheets.
For example, this will be called on {@link org.apache.poi.hssf.usermodel.HSSFWorkbook#setSheetOrder(String, int)}
@param ptgs - if necessary, will get modified by this method
@param currentExternSheetIx - the extern sheet index of the sheet that contains the formula being adjusted
@return true if a change was made to the formula tokens
@return true if this Ptg needed to be changed
@author aviks
@author Jason Height (jheight at chariot dot net dot au)
@author Danny Mui (dmui at apache dot org) (Leftover handling)
@author Jason Height (jheight at chariot dot net dot au)
Single instance of this token for 'sum() taking a single argument'
Creates new function pointer from a byte array
usually called while reading an excel file.
Create a function ptg from a string tokenised by the parser
PTG class to implement greater or equal to
@author fred at stsci dot edu
Greater than operator PTG ">"
@author Cameron Riley (criley at ekmail.com)
Implementation of method from OperationsPtg
@param operands a String array of operands
@return String the Formula as a String
Get the number of operands for the Less than operator
@return int the number of operands
@author Daniel Noll (daniel at nuix dot com dot au)
Implementation of method from Ptg
implementation of method from OperationsPtg
Integer (unsigned short integer)
Stores an Unsigned short value (java int) in a formula
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
Excel represents integers 0..65535 with the tInt token.
@return true if the specified value is within the range of values
IntPtg can represent.
Ptg class to implement less than or equal
@author fred at stsci dot edu
Less than operator PTG "<". The SID is taken from the
Openoffice.orgs Documentation of the Excel File Format,
Table 3.5.7
@author Cameron Riley (criley at ekmail.com)
the sid for the less than operator as hex
identifier for LESS THAN char
Implementation of method from OperationsPtg
@param operands a String array of operands
@return String the Formula as a String
Get the number of operands for the Less than operator
@return int the number of operands
@author Daniel Noll (daniel at nuix dot com dot au)
Creates new MemAreaPtg
@author andy
@author Jason Height (jheight at chariot dot net dot au)
@author Daniel Noll (daniel at nuix dot com dot au)
Creates new MemErrPtg
@author Glen Stampoultzis (glens at apache.org)
Creates new function pointer from a byte array
usually called while Reading an excel file.
Missing Function Arguments
Avik Sengupta <avik at apache.org>
@author Jason Height (jheight at chariot dot net dot au)
Implements the standard mathmatical multiplication - *
@author Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
@author andy
@author Jason Height (jheight at chariot dot net dot au)
one-based index to defined name record
@param nameIndex zero-based index to name within workbook
Creates new NamePtg
@return zero based index to a defined name record in the LinkTable
@author aviks
index to REF entry in externsheet record
index to defined name or externname table(1 based)
reserved must be 0
@param sheetRefIndex index to REF entry in externsheet record
@param nameIndex index to defined name or externname table
Ptg class to implement not equal
@author fred at stsci dot edu
Number
Stores a floating point value in a formula
value stored in a 8 byte field using IEEE notation
@author Avik Sengupta
@author Jason Height (jheight at chariot dot net dot au)
Create a NumberPtg from a byte array Read from disk
Create a NumberPtg from a string representation of the number
Number format is not checked, it is expected to be validated in the parser
that calls this method.
@param value : String representation of a floating point number
While formula tokens are stored in RPN order and thus do not need parenthesis for
precedence reasons, Parenthesis tokens ARE written to Ensure that user entered
parenthesis are Displayed as-is on Reading back
Avik Sengupta <lists@aviksengupta.com>
Andrew C. Oliver (acoliver at apache dot org)
@author Jason Height (jheight at chariot dot net dot au)
Percent PTG.
@author Daniel Noll (daniel at nuix.com.au)
@author andy
@author Jason Height (jheight at chariot dot net dot au)
@author Daniel Noll (daniel at nuix dot com dot au)
implementation of method from OperationsPtg
@author Josh Micich
ReferencePtgBase - handles references (such as A1, A2, IA4)
@author Andrew C. Oliver (acoliver@apache.org)
@author Jason Height (jheight at chariot dot net dot au)
The row index - zero based Unsigned 16 bit value
Field 2
- lower 8 bits is the zero based Unsigned byte column index
- bit 16 - IsRowRelative
- bit 15 - IsColumnRelative
Takes in a String representation of a cell reference and Fills out the
numeric fields.
Returns the row number as a short, which will be
wrapped (negative) for values between 32769 and 65535
Returns the row number as an int, between 0 and 65535
Takes in a String representation of a cell reference and fills out the
numeric fields.
Title: Reference 3D Ptg
Description: Defined a cell in extern sheet.
REFERENCE:
@author Libin Roman (Vista Portal LDT. Developer)
@author Jason Height (jheight at chariot dot net dot au)
@version 1.0-pre
Field 2
- lower 8 bits is the zero based Unsigned byte column index
- bit 16 - IsRowRelative
- bit 15 - IsColumnRelative
Creates new AreaPtg
@return text representation of this cell reference that can be used in text
formulas. The sheet name will Get properly delimited if required.
RefError - handles deleted cell reference
@author Jason Height (jheight at chariot dot net dot au)
RefNPtg
@author Jason Height (jheight at apache dot com)
Creates new ValueReferencePtg
ReferencePtg - handles references (such as A1, A2, IA4)
@author Andrew C. Oliver (acoliver@apache.org)
@author Jason Height (jheight at chariot dot net dot au)
Takes in a String representation of a cell reference and Fills out the
numeric fields.
String Stores a String value in a formula value stored in the format
<Length 2 bytes>char[]
@author Werner Froidevaux
@author Jason Height (jheight at chariot dot net dot au)
@author Bernard Chesnoy
the Char (")used in formulas to delimit string literals
NOTE: OO doc says 16bit Length, but BiffViewer says 8 Book says something
totally different, so don't look there!
Create a StringPtg from a stream
Create a StringPtg from a string representation of the number Number
format Is not Checked, it Is expected to be Validated in the Parser that
calls this method.
@param value :
String representation of a floating point number
@author andy
@author Jason Height (jheight at chariot dot net dot au)
This ptg indicates a data table.
It only occurs in a FORMULA record, never in an
ARRAY or NAME record. When ptgTbl occurs in a
formula, it is the only token in the formula.
This indicates that the cell containing the
formula is an interior cell in a data table;
the table description is found in a TABLE
record. Rows and columns which contain input
values to be substituted in the table do
not contain ptgTbl.
See page 811 of the june 08 binary docs.
The row number of the upper left corner
The column number of the upper left corner
Unary Plus operator
does not have any effect on the operand
@author Avik Sengupta
implementation of method from OperationsPtg
Unary Plus operator
does not have any effect on the operand
@author Avik Sengupta
implementation of method from OperationsPtg
@author Glen Stampoultzis (glens at apache.org)
implementation of method from OperationsPtg
@author andy
@author Jason Height (jheight at chariot dot net dot au)
Creates new UnknownPtg
Formats sheet names for use in formula expressions.
@author Josh Micich
Used to format sheet names as they would appear in cell formula expressions.
@return the sheet name UnChanged if there is no need for delimiting. Otherwise the sheet
name is enclosed in single quotes ('). Any single quotes which were already present in the
sheet name will be converted to double single quotes ('').
Convenience method for when a StringBuilder is already available
@param out - sheet name will be Appended here possibly with delimiting quotes
@return true if the presence of the specified Char in a sheet name would
require the sheet name to be delimited in formulas. This includes every non-alphanumeric
Char besides Underscore '_'.
Used to decide whether sheet names like 'AB123' need delimiting due to the fact that they
look like cell references.
This code is currently being used for translating formulas represented with Ptg
tokens into human readable text form. In formula expressions, a sheet name always has a
trailing '!' so there is little chance for ambiguity. It doesn't matter too much what this
method returns but it is worth noting the likely consumers of these formula text strings:
- POI's own formula parser
- Visual reading by human
- VBA automation entry into Excel cell contents e.g. ActiveCell.Formula = "=c64!A1"
- Manual entry into Excel cell contents
- Some third party formula parser
At the time of writing, POI's formula parser tolerates cell-like sheet names in formulas
with or without delimiters. The same goes for Excel(2007), both manual and automated entry.
For better or worse this implementation attempts to replicate Excel's formula renderer.
Excel uses range checking on the apparent 'row' and 'column' components. Note however that
the maximum sheet size varies across versions.
@see org.apache.poi.hssf.util.CellReference
Note - this method assumes the specified rawSheetName has only letters and digits. It
cannot be used to match absolute or range references (using the dollar or colon char).
Some notable cases:
Input | Result | Comments |
"A1" | true | |
"a111" | true | |
"AA" | false | |
"aa1" | true | |
"A1A" | false | |
"A1A1" | false | |
"A$1:$C$20" | false | Not a plain cell reference |
"SALES20080101" | true |
Still needs delimiting even though well out of range |
@return true if there is any possible ambiguity that the specified rawSheetName
could be interpreted as a valid cell name.
@author Josh Micich
@return whether cell at rowIndex and columnIndex is a subtotal
@see org.apache.poi.ss.formula.functions.Subtotal
Collects Add-in libraries and VB macro functions toGether into one UDF Finder
@author PUdalau
Returns executor by specified name.
Name of function.
Function executor. null if not found
Add a new toolpack
Default UDF Finder - for Adding your own user defined functions.
@author PUdalau
Evaluates formula cells.
For performance reasons, this class keeps a cache of all previously calculated intermediate
cell values. Be sure To call {@link #ClearCache()} if any workbook cells are Changed between
calls To evaluate~ methods on this class.
For POI internal use only
@author Josh Micich
also for debug use. Used in ToString methods
Should be called whenever there are Changes To input cells in the evaluated workbook.
Failure To call this method after changing cell values will cause incorrect behaviour
of the evaluate~ methods of this class
Should be called To tell the cell value cache that the specified (value or formula) cell
Has Changed.
Should be called To tell the cell value cache that the specified cell Has just been
deleted.
Case-insensitive.
@return -1 if sheet with specified name does not exist
@return never null, never {@link BlankEval}
Adds the current cell reference to the exception for easier debugging.
Would be nice to get the formula text as well, but that seems to require
too much digging around and casting to get the FormulaRenderingWorkbook.
Gets the value from a non-formula cell.
@param cell may be null
@return {@link BlankEval} if cell is null or blank, never null
whether print detailed messages about the next formula evaluation
Calculates the number of tokens that the evaluator should skip upon reaching a tAttrSkip.
@return the number of tokens (starting from startIndex+1) that need to be skipped
to achieve the specified distInBytes skip distance.
Dereferences a single value from any AreaEval or RefEval evaluation result.
If the supplied evaluationResult is just a plain value, it is returned as-is.
@return a NumberEval, StringEval, BoolEval,
BlankEval or ErrorEval. Never null.
returns an appropriate Eval impl instance for the Ptg. The Ptg must be
one of: Area3DPtg, AreaPtg, ReferencePtg, Ref3DPtg, IntPtg, NumberPtg,
StringPtg, BoolPtg
special Note: OperationPtg subtypes cannot be
passed here!
Used by the lazy ref evals whenever they need To Get the value of a contained cell.
Return a collection of functions that POI can evaluate
@return names of functions supported by POI
Return a collection of functions that POI does not support
@return names of functions NOT supported by POI
Register a ATP function in runtime.
@param name the function name
@param func the functoin to register
@throws IllegalArgumentException if the function is unknown or already registered.
@since 3.8 beta6
Register a function in runtime.
@param name the function name
@param func the functoin to register
@throws IllegalArgumentException if the function is unknown or already registered.
@since 3.8 beta6
Whether to ignore missing references to external workbooks and
use cached formula results in the main workbook instead.
In some cases exetrnal workbooks referenced by formulas in the main workbook are not avaiable.
With this method you can control how POI handles such missing references:
- by default ignoreMissingWorkbooks=false and POI throws {@link WorkbookNotFoundException}
if an external reference cannot be resolved
- if ignoreMissingWorkbooks=true then POI uses cached formula result
that already exists in the main workbook
@param ignore whether to ignore missing references to external workbooks
@see Bug 52575 for details
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
Excel97 format aka BIFF8
- The total number of available columns is 256 (2^8)
- The total number of available rows is 64k (2^16)
- The maximum number of arguments to a function is 30
- Number of conditional format conditions on a cell is 3
- Length of text cell contents is unlimited
- Length of text cell contents is 32767
Excel2007
- The total number of available columns is 16K (2^14)
- The total number of available rows is 1M (2^20)
- The maximum number of arguments to a function is 255
- Number of conditional format conditions on a cell is unlimited
(actually limited by available memory in Excel)
- Length of text cell contents is unlimited
@return the maximum number of usable rows in each spReadsheet
@return the last (maximum) valid row index, equals to GetMaxRows() - 1
@return the maximum number of usable columns in each spReadsheet
@return the last (maximum) valid column index, equals to GetMaxColumns() - 1
@return the maximum number arguments that can be passed to a multi-arg function (e.g. COUNTIF)
@return the maximum number of conditional format conditions on a cell
@return the last valid column index in a ALPHA-26 representation
(IV
or XFD
).
@return the maximum length of a text cell
The enumeration value indicating the line style of a border in a cell
No border
Thin border
Medium border
dash border
dot border
Thick border
double-line border
hair-line border
Medium dashed border
dash-dot border
medium dash-dot border
dash-dot-dot border
medium dash-dot-dot border
slanted dash-dot border
Utility to identify built-in formats. The following is a list of the formats as
returned by this class.
0, "General"
1, "0"
2, "0.00"
3, "#,##0"
4, "#,##0.00"
5, "$#,##0_);($#,##0)"
6, "$#,##0_);[Red]($#,##0)"
7, "$#,##0.00);($#,##0.00)"
8, "$#,##0.00_);[Red]($#,##0.00)"
9, "0%"
0xa, "0.00%"
0xb, "0.00E+00"
0xc, "# ?/?"
0xd, "# ??/??"
0xe, "m/d/yy"
0xf, "d-mmm-yy"
0x10, "d-mmm"
0x11, "mmm-yy"
0x12, "h:mm AM/PM"
0x13, "h:mm:ss AM/PM"
0x14, "h:mm"
0x15, "h:mm:ss"
0x16, "m/d/yy h:mm"
// 0x17 - 0x24 reserved for international and undocumented
0x25, "#,##0_);(#,##0)"
0x26, "#,##0_);[Red](#,##0)"
0x27, "#,##0.00_);(#,##0.00)"
0x28, "#,##0.00_);[Red](#,##0.00)"
0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)"
0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)"
0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)"
0x2c, "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)"
0x2d, "mm:ss"
0x2e, "[h]:mm:ss"
0x2f, "mm:ss.0"
0x30, "##0.0E+0"
0x31, "@" - This is text format.
0x31 "text" - Alias for "@"
@author Yegor Kozlov
Modified 6/17/09 by Stanislav Shor - positive formats don't need starting '('
The first user-defined format starts at 164.
@deprecated (May 2009) use {@link #getAll()}
@return array of built-in data formats
Get the format string that matches the given format index
@param index of a built in format
@return string represented at index of format or null
if there is not a built-in format at that index
Get the format index that matches the given format string.
Automatically converts "text" to excel's format string to represent text.
@param pFmt string matching a built-in format
@return index of format or -1 if undefined.
Mimics the 'data view' of a cell. This allows formula Evaluator
to return a CellValue instead of precasting the value to String
or Number or bool type.
@author Amol S. Deshmukh < amolweb at ya hoo dot com >
@return Returns the boolValue.
@return Returns the numberValue.
@return Returns the stringValue.
@return Returns the cellType.
@return Returns the errorValue.
High level representation of a chart.
@author Roman Kashitsyn
Abstraction of chart element that can be positioned with manual
layout.
@author Roman Kashitsyn
Returns manual layout for the chart element.
@return manual layout for the chart element.
@return an appropriate ChartDataFactory implementation
@return an appropriate ChartAxisFactory implementation
@return chart legend instance
Delete current chart legend.
@return list of all chart axis
Plots specified data on the chart.
@param data a data to plot
Specifies the possible crossing states of an axis.
@author Roman Kashitsyn
Specifies the value axis shall cross the category axis
between data markers.
Specifies the value axis shall cross the category axis at
the midpoint of a category.
Specifies the possible crossing points for an axis.
@author Roman Kashitsyn
The category axis crosses at the zero point of the value axis (if
possible), or the minimum value (if the minimum is greater than zero) or
the maximum (if the maximum is less than zero).
The axis crosses at the maximum value.
Axis crosses at the minimum value of the chart.
Specifies the possible ways to place a picture on a data point, series, wall, or floor.
@author Roman Kashitsyn
Specifies that the values on the axis shall be reversed
so they go from maximum to minimum.
Specifies that the axis values shall be in the usual
order, minimum to maximum.
Enumeration of all possible axis positions.
@author Roman Kashitsyn
High level representation of chart axis.
@author Roman Kashitsyn
@return axis id
@return axis position
@param position new axis position
@return axis number format
@param format axis number format
@return true if log base is defined, false otherwise
@param logBase a number between 2 and 1000 (inclusive)
@throws ArgumentException if log base not within allowed range
@return axis log base or 0.0 if not Set
@return true if minimum value is defined, false otherwise
@return axis minimum or 0.0 if not Set
@param min axis minimum
@return true if maximum value is defined, false otherwise
@return axis maximum or 0.0 if not Set
@param max axis maximum
@return axis orientation
@param orientation axis orientation
@param crosses axis cross type
@return axis cross type
Declare this axis cross another axis.
@param axis that this axis should cross
A factory for different chart axis.
@author Roman Kashitsyn
returns new value axis
A base for all chart data types.
@author Roman Kashitsyn
Fills a chart with data specified by implementation.
a chart to fill in
chart axis to use
A factory for different chart data types.
@author Roman Kashitsyn
returns an appropriate ScatterChartData instance
High level representation of chart legend.
@author Roman Kashitsyn
legend position
Specifies the possible ways to store a chart element's position.
@author Roman Kashitsyn
Specifies that the Width or Height shall be interpreted as the Right or Bottom of the chart element.
Specifies that the Width or Height shall be interpreted as the width or Height of the chart element.
Specifies whether to layout the plot area by its inside (not including axis
and axis labels) or outside (including axis and axis labels).
@author Roman Kashitsyn
Specifies that the plot area size shall determine the size of the plot area, not including the tick marks and axis labels.
Specifies that the plot area size shall determine the
size of the plot area, the tick marks, and the axis
labels.
Enumeration of all possible chart legend positions.
@author Roman Kashitsyn
High level representation of chart element manual layout.
@author Roman Kashitsyn
Sets the layout target.
@param target new layout target.
Returns current layout target.
@return current layout target
Sets the x-coordinate layout mode.
@param mode new x-coordinate layout mode.
Returns current x-coordinnate layout mode.
@return current x-coordinate layout mode.
Sets the y-coordinate layout mode.
@param mode new y-coordinate layout mode.
Returns current y-coordinate layout mode.
@return current y-coordinate layout mode.
Returns the x location of the chart element.
@return the x location (left) of the chart element or 0.0 if
not Set.
Specifies the x location (left) of the chart element as a
fraction of the width of the chart. If Left Mode is Factor,
then the position is relative to the default position for the
chart element.
Returns current y location of the chart element.
@return the y location (top) of the chart element or 0.0 if not
Set.
Specifies the y location (top) of the chart element as a
fraction of the height of the chart. If Top Mode is Factor,
then the position is relative to the default position for the
chart element.
Specifies how to interpret the Width element for this manual
layout.
@param mode new width layout mode of this manual layout.
Returns current width mode of this manual layout.
@return width mode of this manual layout.
Specifies how to interpret the Height element for this manual
layout.
@param mode new height mode of this manual layout.
Returns current height mode of this
@return height mode of this manual layout.
Specifies the width (if Width Mode is Factor) or right (if
Width Mode is Edge) of the chart element as a fraction of the
width of the chart.
@param ratio a fraction of the width of the chart.
Returns current fraction of the width of the chart.
@return fraction of the width of the chart or 0.0 if not Set.
Specifies the height (if Height Mode is Factor) or bottom (if
Height Mode is edge) of the chart element as a fraction of the
height of the chart.
@param ratio a fraction of the height of the chart.
Returns current fraction of the height of the chart.
@return fraction of the height of the chart or 0.0 if not Set.
@author Roman Kashitsyn
@param xs data source to be used for X axis values
@param ys data source to be used for Y axis values
@return a new scatter charts serie
@return list of all series
Represents scatter charts serie.
@author Roman Kashitsyn
@return data source used for X axis values
@return data source used for Y axis values
@author Roman Kashitsyn
@return cross between type
@param crossBetween cross between type
Move and Resize With Anchor Cells
Specifies that the current drawing shall move and
resize to maintain its row and column anchors (i.e. the
object is anchored to the actual from and to row and column)
Move With Cells but Do Not Resize
Specifies that the current drawing shall move with its
row and column (i.e. the object is anchored to the
actual from row and column), but that the size shall remain absolute.
If Additional rows/columns are Added between the from and to locations of the drawing,
the drawing shall move its to anchors as needed to maintain this same absolute size.
Do Not Move or Resize With Underlying Rows/Columns
Specifies that the current start and end positions shall
be maintained with respect to the distances from the
absolute start point of the worksheet.
If Additional rows/columns are Added before the
drawing, the drawing shall move its anchors as needed
to maintain this same absolute position.
The conditional format operators used for "Highlight Cells That Contain..." rules.
For example, "highlight cells that begin with "M2" and contain "Mountain Gear".
@author Dmitriy Kumshayev
@author Yegor Kozlov
'Between' operator
'Not between' operator
'Equal to' operator
'Not equal to' operator
'Greater than' operator
'Less than' operator
'Greater than or equal to' operator
'Less than or equal to' operator
Allow accessing the Initial value.
This conditional formatting rule Compares a cell value
to a formula calculated result, using an operator
This conditional formatting rule Contains a formula to Evaluate.
When the formula result is true, the cell is highlighted.
Error style constants for error box
STOP style
WARNING style
INFO style
ValidationType enum
'Any value' type - value not restricted
int ('Whole number') type
Decimal type
List type ( combo box type )
Date type
Time type
String length type
Formula ( 'Custom' ) type
Condition operator enum
default value to supply when the operator type is not used
Contains raw Excel error codes (as defined in OOO's excelfileformat.pdf (2.5.6)
@author Michael Harhen
#NULL! - Intersection of two cell ranges is empty
#DIV/0! - Division by zero
#VALUE! - Wrong type of operand
#REF! - Illegal or deleted cell reference
#NAME? - Wrong function or range name
#NUM! - Value range overflow
#N/A - Argument or function not available
@return Standard Excel error literal for the specified error code.
@throws ArgumentException if the specified error code is not one of the 7
standard error codes
@return true if the specified error code is a standard Excel error code.
A wrapper around a {@link SimpleDateFormat} instance,
which handles a few Excel-style extensions that
are not supported by {@link SimpleDateFormat}.
Currently, the extensions are around the handling
of elapsed time, eg rendering 1 day 2 hours
as 26 hours.
A substitute class for Format class in Java
Takes a format String, and Replaces Excel specific bits
with our detection sequences
Used to let us know what the date being
formatted is, in Excel terms, which we
may wish to use when handling elapsed
times.
not underlined
single (normal) underline
double underlined
accounting style single underline
accounting style double underline
no type Offsetting (not super or subscript)
superscript
subscript
Allow accessing the Initial value.
normal type of black color.
Dark Red color
Allow accessing the Initial value.
Normal boldness (not bold)
Bold boldness (bold)
Charset represents the basic set of characters associated with a font (that it can display), and
corresponds to the ANSI codepage (8-bit or DBCS) of that character set used by a given language.
@author Gisella Bronzetti
Returns value of this charset
@return value of this charset
The font family this font belongs to. A font family is a set of fonts having common stroke width and serif
characteristics. The font name overrides when there are conflicting values.
@author Gisella Bronzetti
Returns index of this font family
@return index of this font family
Defines the font scheme to which this font belongs.
When a font defInition is part of a theme defInition, then the font is categorized as either a major or minor font scheme component.
When a new theme is chosen, every font that is part of a theme defInition is updated to use the new major or minor font defInition for that
theme.
Usually major fonts are used for styles like headings, and minor fonts are used for body and paragraph text.
@author Gisella Bronzetti
Enumerates error values in SpreadsheetML formula calculations.
@author Yegor Kozlov
Intended to indicate when two areas are required to intersect, but do not.
Example:
In the case of SUM(B1 C1), the space between B1 and C1 is treated as the binary
intersection operator, when a comma was intended. end example]
Intended to indicate when any number, including zero, is divided by zero.
Note: However, any error code divided by zero results in that error code.
Intended to indicate when an incompatible type argument is passed to a function, or
an incompatible type operand is used with an operator.
Example:
In the case of a function argument, text was expected, but a number was provided
Intended to indicate when a cell reference is invalid.
Example:
If a formula Contains a reference to a cell, and then the row or column Containing that cell is deleted,
a #REF! error results. If a worksheet does not support 20,001 columns,
OFFSET(A1,0,20000) will result in a #REF! error.
Intended to indicate when an argument to a function has a compatible type, but has a
value that is outside the domain over which that function is defined. (This is known as
a domain error.)
Example:
Certain calls to ASIN, ATANH, FACT, and SQRT might result in domain errors.
Intended to indicate that the result of a function cannot be represented in a value of
the specified type, typically due to extreme magnitude. (This is known as a range
error.)
Example: FACT(1000) might result in a range error.
Intended to indicate when a designated value is not available.
Example:
Some functions, such as SUMX2MY2, perform a series of operations on corresponding
elements in two arrays. If those arrays do not have the same number of elements, then
for some elements in the longer array, there are no corresponding elements in the
shorter one; that is, one or more values in the shorter array are not available.
This error value can be produced by calling the function NA
@return numeric code of the error
@return string representation of the error
The enumeration value indicating horizontal alignment of a cell,
i.e., whether it is aligned general, left, right, horizontally centered, Filled (replicated),
justified, centered across multiple cells, or distributed.
The horizontal alignment is general-aligned. Text data is left-aligned.
Numbers, dates, and times are rightaligned. Boolean types are centered.
Changing the alignment does not change the type of data.
The horizontal alignment is left-aligned, even in Rightto-Left mode.
Aligns contents at the left edge of the cell. If an indent amount is specified, the contents of
the cell is indented from the left by the specified number of character spaces. The character spaces are
based on the default font and font size for the workbook.
The horizontal alignment is centered, meaning the text is centered across the cell.
The horizontal alignment is right-aligned, meaning that cell contents are aligned at the right edge of the cell,
even in Right-to-Left mode.
The horizontal alignment is justified (flush left and right).
For each line of text, aligns each line of the wrapped text in a cell to the right and left
(except the last line). If no single line of text wraps in the cell, then the text is not justified.
Indicates that the value of the cell should be Filled
across the entire width of the cell. If blank cells to the right also have the fill alignment,
they are also Filled with the value, using a convention similar to centerContinuous.
Additional rules:
- Only whole values can be Appended, not partial values.
- The column will not be widened to 'best fit' the Filled value
- If Appending an Additional occurrence of the value exceeds the boundary of the cell
left/right edge, don't append the Additional occurrence of the value.
- The display value of the cell is Filled, not the underlying raw number.
The horizontal alignment is centered across multiple cells.
The information about how many cells to span is expressed in the Sheet Part,
in the row of the cell in question. For each cell that is spanned in the alignment,
a cell element needs to be written out, with the same style Id which references the centerContinuous alignment.
Indicates that each 'word' in each line of text inside the cell is evenly distributed
across the width of the cell, with flush right and left margins.
When there is also an indent value to apply, both the left and right side of the cell
are pAdded by the indent value.
A 'word' is a set of characters with no space character in them.
Two lines inside a cell are Separated by a carriage return.
Link to an existing file or web page
Link to a place in this document
Link to an E-mail Address
Link to a file
A deprecated indexing scheme for colours that is still required for some records, and for backwards
compatibility with OLE2 formats.
Each element corresponds to a color index (zero-based). When using the default indexed color palette,
the values are not written out, but instead are implied. When the color palette has been modified from default,
then the entire color palette is used.
@author Yegor Kozlov
Returns index of this color
@return index of this color
Specifies printed page order.
@author Gisella Bronzetti
Order pages vertically first, then move horizontally.
Order pages horizontally first, then move vertically
The enumeration value indicating the possible paper size for a sheet
@author Daniele Montagni
Allow accessing the Initial value.
A4 Transverse - 210x297 mm
A4 Plus - 210x330 mm
US Letter Rotated 11 x 8 1/2 in
A4 Rotated - 297x210 mm */
Allow accessing the Initial value.
Extended windows meta file
Windows Meta File
Mac PICT format
JPEG format
PNG format
Device independant bitmap
These enumerations specify how cell comments shall be displayed for paper printing purposes.
@author Gisella Bronzetti
Do not print cell comments.
Print cell comments as displayed.
Print cell comments at end of document.
The enumeration value indicating the print orientation for a sheet.
@author Gisella Bronzetti
orientation not specified
portrait orientation
landscape orientations
Used by HSSFPrintSetup.CellError property
Used to specify the different possible policies
if for the case of null and blank cells
Missing cells are returned as null, Blank cells are returned as normal
Missing cells are returned as null, as are blank cells
A new, blank cell is Created for missing cells. Blank cells are returned as normal
All known types of automatic shapes in DrawingML
@author Yegor Kozlov
Allow accessing the Initial value.
Indicate the position of the margin. One of left, right, top and bottom.
referes to the left margin
referes to the right margin
referes to the top margin
referes to the bottom margin
Define the position of the pane. One of lower/right, upper/right, lower/left and upper/left.
referes to the lower/right corner
referes to the upper/right corner
referes to the lower/left corner
referes to the upper/left corner
@return the rich text string for this textbox.
@return Returns the left margin within the textbox.
@return returns the right margin within the textbox.
@return returns the top margin within the textbox.
s the bottom margin within the textbox.
This enumeration value indicates the type of vertical alignment for a cell, i.e.,
whether it is aligned top, bottom, vertically centered, justified or distributed.
The vertical alignment is aligned-to-top.
The vertical alignment is centered across the height of the cell.
The vertical alignment is aligned-to-bottom.
When text direction is horizontal: the vertical alignment of lines of text is distributed vertically,
where each line of text inside the cell is evenly distributed across the height of the cell,
with flush top and bottom margins.
When text direction is vertical: similar behavior as horizontal justification.
The alignment is justified (flush top and bottom in this case). For each line of text, each
line of the wrapped text in a cell is aligned to the top and bottom (except the last line).
If no single line of text wraps in the cell, then the text is not justified.
When text direction is horizontal: the vertical alignment of lines of text is distributed vertically,
where each line of text inside the cell is evenly distributed across the height of the cell,
with flush top
When text direction is vertical: behaves exactly as distributed horizontal alignment.
The first words in a line of text (appearing at the top of the cell) are flush
with the top edge of the cell, and the last words of a line of text are flush with the bottom edge of the cell,
and the line of text is distributed evenly from top to bottom.
Indicates the sheet is visible.
Indicates the book window is hidden, but can be shown by the user via the user interface.
Indicates the sheet is hidden and cannot be shown in the user interface (UI).
In Excel this state is only available programmatically in VBA:
ThisWorkbook.Sheets("MySheetName").Visible = xlSheetVeryHidden
The Char (!) that Separates sheet names from cell references
The Char (:) that Separates the two cell references in a multi-cell area reference
The Char (') used to quote sheet names when they contain special Chars
Create an area ref from a string representation. Sheet names containing special Chars should be
delimited and escaped as per normal syntax rules for formulas.
The area reference must be contiguous (i.e. represent a single rectangle, not a Union of rectangles)
Creates an area ref from a pair of Cell References.
is the reference for a contiguous (i.e.
Unbroken) area, or is it made up of
several different parts?
(If it Is, you will need to call
....
is the reference for a whole-column reference,
such as C:C or D:G ?
Takes a non-contiguous area reference, and
returns an array of contiguous area references.
Returns a reference to every cell covered by this area
Example return values:
Result | Comment |
A1:A1 | Single cell area reference without sheet |
A1:$C$1 | Multi-cell area reference without sheet |
Sheet1!A$1:B4 | Standard sheet name |
'O''Brien''s Sales'!B5:C6' | Sheet name with special Chars |
@return the text representation of this area reference as it would appear in a formula.
Separates Area refs in two parts and returns them as Separate elements in a String array,
each qualified with the sheet name (if present)
@return array with one or two elements. never null
@return false if this area reference involves more than one cell
@return the first cell reference which defines this area. Usually this cell is in the upper
left corner of the area (but this is not a requirement).
Note - if this area reference refers to a single cell, the return value of this method will
be identical to that of GetFirstCell()
@return the second cell reference which defines this area. For multi-cell areas, this is
cell diagonally opposite the 'first cell'. Usually this cell is in the lower right corner
of the area (but this is not a requirement).
See OOO documentation: excelfileformat.pdf sec 2.5.14 - 'Cell Range Address'
Common subclass of 8-bit and 16-bit versions
@author Josh Micich
Validate the range limits against the supplied version of Excel
@param ssVersion the version of Excel to validate against
@throws IllegalArgumentException if the range limits are outside of the allowed range
Runs a bounds check for row numbers
@param row
Runs a bounds check for column numbers
@param column
@return column number for the upper left hand corner
@return row number for the upper left hand corner
@return column number for the lower right hand corner
@return row number for the lower right hand corner
@return the size of the range (number of cells in the area).
@return the text format of this range using specified sheet name.
Creates a CellRangeAddress from a cell range reference string.
usually a standard area ref (e.g. "B1:D8"). May be a single
cell ref (e.g. "B5") in which case the result is a 1 x 1 cell
range. May also be a whole row range (e.g. "3:5"), or a whole
column range (e.g. "C:F")
a CellRangeAddress object
List of CellRangeAddresses. Each structure represents a cell range
Convenience constructor for creating a CellRangeAddressList with a single
CellRangeAddress. Other CellRangeAddresses may be Added later.
@param in the RecordInputstream to read the record from
Get the number of following ADDR structures. The number of this
structures is automatically set when reading an Excel file and/or
increased when you manually Add a new ADDR structure . This is the reason
there isn't a set method for this field .
@return number of ADDR structures
Add a cell range structure.
@param firstRow - the upper left hand corner's row
@param firstCol - the upper left hand corner's col
@param lastRow - the lower right hand corner's row
@param lastCol - the lower right hand corner's col
@return the index of this ADDR structure
@return CellRangeAddress at the given index
@return the total size of for the specified number of ranges,
including the initial 2 byte range count
Allow accessing the Initial value.
@author Avik Sengupta
@author Dennis doubleday (patch to seperateRowColumns())
The character ($) that signifies a row or column value is absolute instead of relative
The character (!) that Separates sheet names from cell references
The character (') used to quote sheet names when they contain special characters
Matches a run of one or more letters followed by a run of one or more digits.
The run of letters is group 1 and the run of digits is group 2.
Each group may optionally be prefixed with a single '$'.
Matches a run of one or more letters. The run of letters is group 1.
The text may optionally be prefixed with a single '$'.
Matches a run of one or more digits. The run of digits is group 1.
The text may optionally be prefixed with a single '$'.
Named range names must start with a letter or underscore. Subsequent characters may include
digits or dot. (They can even end in dot).
Create an cell ref from a string representation. Sheet names containing special characters should be
delimited and escaped as per normal syntax rules for formulas.
takes in a column reference portion of a CellRef and converts it from
ALPHA-26 number format to 0-based base 10.
'A' -> 0
'Z' -> 25
'AA' -> 26
'IV' -> 255
@return zero based column index
Takes in a 0-based base-10 column and returns a ALPHA-26
representation.
eg column #3 -> D
Separates the row from the columns and returns an array of three Strings. The first element
is the sheet name. Only the first element may be null. The second element in is the column
name still in ALPHA-26 number format. The third element is the row.
Example return values:
Result | Comment |
A1 | Cell reference without sheet |
Sheet1!A1 | Standard sheet name |
'O''Brien''s Sales'!A1' | Sheet name with special characters |
@return the text representation of this cell reference as it would appear in a formula.
Appends cell reference with '$' markers for absolute values as required.
Sheet name is not included.
Used to decide whether a name of the form "[A-Z]*[0-9]*" that appears in a formula can be
interpreted as a cell reference. Names of that form can be also used for sheets and/or
named ranges, and in those circumstances, the question of whether the potential cell
reference is valid (in range) becomes important.
Note - that the maximum sheet size varies across Excel versions:
Version | File Format |
Last Column | Last Row |
97-2003 | BIFF8 | "IV" (2^8) | 65536 (2^14) |
2007 | BIFF12 | "XFD" (2^14) | 1048576 (2^20) |
POI currently targets BIFF8 (Excel 97-2003), so the following behaviour can be observed for
this method:
Input |
Result |
"A", "1" | true |
"a", "111" | true |
"A", "65536" | true |
"A", "65537" | false |
"iv", "1" | true |
"IW", "1" | false |
"AAA", "1" | false |
"a", "111" | true |
"Sheet", "1" | false |
@param colStr a string of only letter characters
@param rowStr a string of only digit characters
@return true if the row and col parameters are within range of a BIFF8 spreadsheet.
@return possibly null if this is a 2D reference. Special characters are not
escaped or delimited
Returns the three parts of the cell reference, the
Sheet name (or null if none supplied), the 1 based
row number, and the A based column letter.
This will not include any markers for absolute
references, so use {@link #formatAsString()}
to properly turn references into strings.
Various utility functions that make working with a cells and rows easier. The various methods
that deal with style's allow you to create your CellStyles as you need them. When you apply a
style change to a cell, the code will attempt to see if a style already exists that meets your
needs. If not, then it will create a new style. This is to prevent creating too many styles.
there is an upper limit in Excel on the number of styles that can be supported.
@author Eric Pugh epugh@upstate.com
@author (secondary) Avinash Kewalramani akewalramani@accelrys.com
Get a row from the spreadsheet, and create it if it doesn't exist.
@param rowIndex The 0 based row number
@param sheet The sheet that the row is part of.
@return The row indicated by the rowCounter
Get a specific cell from a row. If the cell doesn't exist, then create it.
@param row The row that the cell is part of
@param columnIndex The column index that the cell is in.
@return The cell indicated by the column.
Creates a cell, gives it a value, and applies a style if provided
@param row the row to create the cell in
@param column the column index to create the cell in
@param value The value of the cell
@param style If the style is not null, then set
@return A new Cell
Create a cell, and give it a value.
@param row the row to create the cell in
@param column the column index to create the cell in
@param value The value of the cell
@return A new Cell.
Take a cell, and align it.
@param cell the cell to set the alignment for
@param workbook The workbook that is being worked with.
@param align the column alignment to use.
@see CellStyle for alignment options
Take a cell, and apply a font to it
@param cell the cell to set the alignment for
@param workbook The workbook that is being worked with.
@param font The Font that you want to set...
This method attempt to find an already existing CellStyle that matches what you want the
style to be. If it does not find the style, then it creates a new one. If it does create a
new one, then it applies the propertyName and propertyValue to the style. This is necessary
because Excel has an upper limit on the number of Styles that it supports.
@param workbook The workbook that is being worked with.
@param propertyName The name of the property that is to be changed.
@param propertyValue The value of the property that is to be changed.
@param cell The cell that needs it's style changes
Returns a map containing the format properties of the given cell style.
@param style cell style
@return map of format properties (String -> Object)
@see #setFormatProperties(org.apache.poi.ss.usermodel.CellStyle, org.apache.poi.ss.usermodel.Workbook, java.util.Map)
Sets the format properties of the given style based on the given map.
@param style cell style
@param workbook parent workbook
@param properties map of format properties (String -> Object)
@see #getFormatProperties(CellStyle)
Utility method that returns the named short value form the given map.
@return zero if the property does not exist, or is not a {@link Short}.
@param properties map of named properties (String -> Object)
@param name property name
@return property value, or zero
Utility method that returns the named boolean value form the given map.
@return false if the property does not exist, or is not a {@link Boolean}.
@param properties map of properties (String -> Object)
@param name property name
@return property value, or false
Utility method that puts the named short value to the given map.
@param properties map of properties (String -> Object)
@param name property name
@param value property value
Utility method that puts the named boolean value to the given map.
@param properties map of properties (String -> Object)
@param name property name
@param value property value
Looks for text in the cell that should be unicode, like an alpha and provides the
unicode version of it.
@param cell The cell to check for unicode values
@return translated to unicode
Represents callback for CellWalk traverse method.
@author Roman Kashitsyn
@param cell current cell
@param ctx information about invokation context
Traverse cell range.
@author Roman Kashitsyn
Should we call handler on empty (blank) cells. Default is
false.
@return true if handler should be called on empty (blank)
cells, false otherwise.
Sets the traverseEmptyCells property.
@param traverseEmptyCells new property value
Traverse cell range from top left to bottom right cell.
@param handler handler to call on each appropriate cell
Inner class to hold walk context.
@author Roman Kashitsyn
@author Roman Kashitsyn
Returns ordinal number of cell in range. Numeration starts
from top left cell and ends at bottom right cell. Here is a
brief example (number in cell is it's ordinal number):
@return ordinal number of current cell
Returns number of current row.
@return number of current row
Returns number of current column.
@return number of current column
Always 64 bits long (MSB, bit-63 is '1')
Convert to an equivalent {@link NormalisedDecimal} representation having 15 decimal digits of precision in the
non-fractional bits of the significand.
@return the number of non-fractional bits after the MSB of the significand
Format class for Excel's SSN Format. This class mimics Excel's built-in
SSN Formatting.
@author James May
Format a number as an SSN
Format class for Excel Zip + 4 Format. This class mimics Excel's
built-in Formatting for Zip + 4.
@author James May
Format a number as Zip + 4
Format class for Excel phone number Format. This class mimics Excel's
built-in phone number Formatting.
@author James May
Format a number as a phone number
Format class that handles Excel style fractions, such as "# #/#" and "#/###"
Format class that does nothing and always returns a constant string.
This format is used to simulate Excel's handling of a format string
of all # when the value is 0. Excel will output "", Java will output "0".
@see DataFormatter#createFormat(double, int, String)
The value the exponent field Gets for all NaN and InfInity values
@param rawBits the 64 bit binary representation of the double value
@return the top 12 bits (sign and biased exponent value)
Width of a long
Minimum precision after discarding whole 32-bit words from the significand
The minimum value in 'Base-10 normalised form'.
When {@link #_binaryExponent} == 46 this is the the minimum {@link #_frac} value
(1014-0.05) * 2^17
Values between (1014-0.05) and 1014 will be represented as '1'
followed by 14 zeros.
Values less than (1014-0.05) will get Shifted by one more power of 10
This frac value rounds to '1' followed by fourteen zeros with an incremented decimal exponent
For 'Base-10 normalised form'
The maximum {@link #_frac} value when {@link #_binaryExponent} == 49
(10^15-0.5) * 2^14
@param nBits number of bits to shift right
Holds values for quick multiplication and division by 10
Number of powers of ten Contained in the significand
219
the value of {@link #_fractionalPart} that represents 0.5
1015
Rounds at the digit with value 10decimalExponent
The decimal exponent increased by one less than the digit count of {@link #_wholePart}
The whole part of the significand (typically 15 digits).
47-50 bits long (MSB may be anywhere from bit 46 to 49)
LSB is units bit.
The fractional part of the significand.
24 bits (only top 14-17 bits significant): a value between 0x000000 and 0xFFFF80
Convert to an equivalent {@link ExpandedDouble} representation (binary frac and exponent).
The resulting transformed object is easily Converted to a 64 bit IEEE double:
- bits 2-53 of the {@link #GetSignificand()} become the 52 bit 'fraction'.
- {@link #GetBinaryExponent()} is biased by 1023 to give the 'exponent'.
The sign bit must be obtained from somewhere else.
@return a new {@link NormalisedDecimal} normalised to base 2 representation.
@return the significand as a fixed point number (with 24 fraction bits and 47-50 whole bits)
Rounds the first whole digit position (considers only units digit, not frational part).
Caller should check total digit count of result to see whether the rounding operation caused
a carry out of the most significant digit
@return the number of powers of 10 which have been extracted from the significand and binary exponent.
assumes both this and other are normalised
This class attempts to reproduce Excel's behaviour for comparing numbers. Results are
mostly the same as those from {@link Double#compare(double, double)} but with some
rounding. For numbers that are very close, this code converts to a format having 15
decimal digits of precision and a decimal exponent, before completing the comparison.
In Excel formula evaluation, expressions like "(0.06-0.01)=0.05" evaluate to "TRUE" even
though the equivalent java expression is false. In examples like this,
Excel achieves the effect by having additional logic for comparison operations.
Note - Excel also gives special treatment to expressions like "0.06-0.01-0.05" which
evaluates to "0" (in java, rounding anomalies give a result of 6.9E-18). The special
behaviour here is for different reasons to the example above: If the last operator in a
cell formula is '+' or '-' and the result is less than 250 times smaller than
first operand, the result is rounded to zero.
Needless to say, the two rules are not consistent and it is relatively easy to find
examples that satisfy
"A=B" is "TRUE" but "A-B" is not "0"
and
"A=B" is "FALSE" but "A-B" is "0"
This rule (for rounding the result of a final addition or subtraction), has not been
implemented in POI (as of Jul-2009).
@return negative, 0, or positive
according to the standard Excel comparison
of values a and b.
If both numbers are subnormal, Excel seems to use standard comparison rules
Usually any normal number is greater (in magnitude) than any subnormal number.
However there are some anomalous cases around the threshold where Excel produces screwy results
@param isNegative both values are either negative or positive. This parameter affects the sign of the comparison result
@return usually isNegative ? -1 : +1
for formatting double values in error messages
Converts the supplied value to the text representation that Excel would give if
the value were to appear in an unformatted cell, or as a literal number in a formula.
Note - the results from this method differ slightly from those of Double.ToString()
In some special cases Excel behaves quite differently. This function attempts to reproduce
those results.
Holds information regarding a split plane or freeze plane for a sheet.
Constant for active pane being the lower right
Constant for active pane being the upper right
Constant for active pane being the lower left
Constant for active pane being the upper left
Returns true if this is a Freeze pane, false if it is a split pane.
Returns the vertical position of the split.
@return 0 if there is no vertical spilt,
or for a freeze pane the number of columns in the TOP pane,
or for a split plane the position of the split in 1/20th of a point.
Returns the horizontal position of the split.
@return 0 if there is no horizontal spilt,
or for a freeze pane the number of rows in the LEFT pane,
or for a split plane the position of the split in 1/20th of a point.
For a horizontal split returns the top row in the BOTTOM pane.
@return 0 if there is no horizontal split, or the top row of the bottom pane.
For a vertical split returns the left column in the RIGHT pane.
@return 0 if there is no vertical split, or the left column in the RIGHT pane.
Returns the active pane
@see #PANE_LOWER_RIGHT
@see #PANE_UPPER_RIGHT
@see #PANE_LOWER_LEFT
@see #PANE_UPPER_LEFT
@return the active pane.
Represents a from/to row/col square. This is a object primitive
that can be used to represent row,col - row,col just as one would use String
to represent a string of characters. Its really only useful for HSSF though.
@author Andrew C. Oliver acoliver at apache dot org
Creates a new instance of Region (0,0 - 0,0)
Convert a List of CellRange objects to an array of regions
@param List of CellRange objects
@return regions
Get the upper left hand corner column number
@return column number for the upper left hand corner
Get the upper left hand corner row number
@return row number for the upper left hand corner
Get the lower right hand corner column number
@return column number for the lower right hand corner
Get the lower right hand corner row number
@return row number for the lower right hand corner
Various utility functions that make working with a region of cells easier.
@author Eric Pugh epugh@upstate.com
@author (secondary) Avinash Kewalramani akewalramani@accelrys.com
Sets the left border for a region of cells by manipulating the cell style of the individual
cells on the left
@param border The new border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
Sets the leftBorderColor attribute of the RegionUtil object
@param color The color of the border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
Sets the borderRight attribute of the RegionUtil object
@param border The new border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
Sets the rightBorderColor attribute of the RegionUtil object
@param color The color of the border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
Sets the borderBottom attribute of the RegionUtil object
@param border The new border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
Sets the bottomBorderColor attribute of the RegionUtil object
@param color The color of the border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
Sets the borderBottom attribute of the RegionUtil object
@param border The new border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
Sets the topBorderColor attribute of the RegionUtil object
@param color The color of the border
@param region The region that should have the border
@param workbook The workbook that the region is on.
@param sheet The sheet that the region is on.
For setting the same property on many cells to the same value
Class {@code SheetBuilder} provides an easy way of building workbook sheets
from 2D array of Objects. It can be used in test cases to improve code
readability or in Swing applications with tables.
@author Roman Kashitsyn
Returns {@code true} if null array elements should be treated as empty
cells.
@return {@code true} if null objects should be treated as empty cells
and {@code false} otherwise
Specifies if null array elements should be treated as empty cells.
@param shouldCreateEmptyCells {@code true} if null array elements should be
treated as empty cells
@return {@code this}
Specifies name of the sheet to build. If not specified, default name (provided by
workbook) will be used instead.
@param sheetName sheet name to use
@return {@code this}
Builds sheet from parent workbook and 2D array with cell
values. Creates rows anyway (even if row contains only null
cells), creates cells if either corresponding array value is not
null or createEmptyCells property is true.
The conversion is performed in the following way:
- Numbers become numeric cells.
java.util.Date
or java.util.Calendar
instances become date cells.
- String with leading '=' char become formulas (leading '='
will be truncated).
- Other objects become strings via
Object.toString()
method call.
@return newly created sheet
Sets the cell value using object type information.
@param cell cell to change
@param value value to set
Holds a collection of Sheet names and their associated
reference numbers.
@author Andrew C. Oliver (acoliver at apache dot org)
Helper methods for when working with Usermodel sheets
@author Yegor Kozlov
Dummy formula Evaluator that does nothing.
YK: The only reason of having this class is that
{@link NPOI.SS.UserModel.DataFormatter#formatCellValue(NPOI.SS.UserModel.Cell)}
returns formula string for formula cells. Dummy Evaluator Makes it to format the cached formula result.
See Bugzilla #50021
Compute width of a single cell
@param cell the cell whose width is to be calculated
@param defaultCharWidth the width of a single character
@param formatter formatter used to prepare the text to be measured
@param useMergedCells whether to use merged cells
@return the width in pixels
Compute width of a column and return the result
@param sheet the sheet to calculate
@param column 0-based index of the column
@param useMergedCells whether to use merged cells
@return the width in pixels
Compute width of a column based on a subset of the rows and return the result
@param sheet the sheet to calculate
@param column 0-based index of the column
@param useMergedCells whether to use merged cells
@param firstRow 0-based index of the first row to consider (inclusive)
@param lastRow 0-based index of the last row to consider (inclusive)
@return the width in pixels
Convert HSSFFont to Font.
The font.
For POI internal use only
@author Josh Micich
Helper methods for when working with Usermodel Workbooks
Creates a valid sheet name, which is conform to the rules.
In any case, the result safely can be used for
{@link org.apache.poi.ss.usermodel.Workbook#setSheetName(int, String)}.
Rules:
- never null
- minimum length is 1
- maximum length is 31
- doesn't contain special chars: 0x0000, 0x0003, / \ ? * ] [
- Sheet names must not begin or end with ' (apostrophe)
Invalid characters are replaced by one space character ' '.
@param nameProposal can be any string, will be truncated if necessary,
allowed to be null
@return a valid string, "empty" if to short, "null" if null
Creates a valid sheet name, which is conform to the rules.
In any case, the result safely can be used for
{@link org.apache.poi.ss.usermodel.Workbook#setSheetName(int, String)}.
Rules:
- never null
- minimum length is 1
- maximum length is 31
- doesn't contain special chars: : 0x0000, 0x0003, / \ ? * ] [
- Sheet names must not begin or end with ' (apostrophe)
@param nameProposal can be any string, will be truncated if necessary,
allowed to be null
@param replaceChar the char to replace invalid characters.
@return a valid string, "empty" if to short, "null" if null
Validates sheet name.
The character count MUST be greater than or equal to 1 and less than or equal to 31.
The string MUST NOT contain the any of the following characters:
- 0x0000
- 0x0003
- colon (:)
- backslash (\)
- asterisk (*)
- question mark (?)
- forward slash (/)
- opening square bracket ([)
- closing square bracket (])
The string MUST NOT begin or end with the single quote (') character.
@param sheetName the name to validate
Fills the specified array.
The array.
The default value.
Assigns the specified byte value to each element of the specified
range of the specified array of bytes. The range to be filled
extends from index fromIndex, inclusive, to index
toIndex, exclusive. (If fromIndex==toIndex, the
range to be filled is empty.)
the array to be filled
the index of the first element (inclusive) to be filled with the specified value
the index of the last element (exclusive) to be filled with the specified value
the value to be stored in all elements of the array
if fromIndex > toIndex
if fromIndex < 0 or toIndex > a.length
Checks that {@code fromIndex} and {@code toIndex} are in
the range and throws an appropriate exception, if they aren't.
Convert Array to ArrayList
source array
Fills the specified array.
The array.
The default value.
Equals the specified a1.
The a1.
The b1.
Returns true if the two specified arrays of Objects are
equal to one another. The two arrays are considered equal if
both arrays contain the same number of elements, and all corresponding
pairs of elements in the two arrays are equal. Two objects e1
and e2 are considered equal if (e1==null ? e2==null
: e1.equals(e2)). In other words, the two arrays are equal if
they contain the same elements in the same order. Also, two array
references are considered equal if both are null.
@param a one array to be tested for equality
@param a2 the other array to be tested for equality
@return true if the two arrays are equal
Moves a number of entries in an array to another point in the array, shifting those inbetween as required.
The array to alter
The (0 based) index of the first entry to move
The (0 based) index of the positition to move to
The number of entries to move
Copies the specified array, truncating or padding with zeros (if
necessary) so the copy has the specified length. This method is temporary
replace for Arrays.copyOf() until we start to require JDK 1.6.
the array to be copied
the length of the copy to be returned
a copy of the original array, truncated or padded with zeros to obtain the specified length
Returns a string representation of the contents of the specified array.
If the array contains other arrays as elements, they are converted to
strings by the {@link Object#toString} method inherited from
Object, which describes their identities rather than
their contents.
The value returned by this method is equal to the value that would
be returned by Arrays.asList(a).toString(), unless a
is null, in which case "null" is returned.
@param a the array whose string representation to return
@return a string representation of a
@see #deepToString(Object[])
@since 1.5
This mask is used to obtain the value of an int as if it were unsigned.
The signum of this BigInteger: -1 for negative, 0 for zero, or
1 for positive. Note that the BigInteger zero must have
a signum of 0. This is necessary to ensures that there is exactly one
representation for each BigInteger value.
@serial
The magnitude of this BigInteger, in big-endian order: the
zeroth element of this array is the most-significant int of the
magnitude. The magnitude must be "minimal" in that the most-significant
int ({@code mag[0]}) must be non-zero. This is necessary to
ensure that there is exactly one representation for each BigInteger
value. Note that this implies that the BigInteger zero has a
zero-length mag array.
One plus the bitCount of this BigInteger. Zeros means unitialized.
@serial
@see #bitCount
@deprecated Deprecated since logical value is offset from stored
value and correction factor is applied in accessor method.
One plus the bitLength of this BigInteger. Zeros means unitialized.
(either value is acceptable).
@serial
@see #bitLength()
@deprecated Deprecated since logical value is offset from stored
value and correction factor is applied in accessor method.
Two plus the index of the lowest-order int in the magnitude of this
BigInteger that contains a nonzero int, or -2 (either value is acceptable).
The least significant int has int-number 0, the next int in order of
increasing significance has int-number 1, and so forth.
@deprecated Deprecated since logical value is offset from stored
value and correction factor is applied in accessor method.
This internal constructor differs from its public cousin
with the arguments reversed in two ways: it assumes that its
arguments are correct, and it doesn't copy the magnitude array.
Translates a byte array containing the two's-complement binary
representation of a BigInteger into a BigInteger. The input array is
assumed to be in big-endian byte-order: the most significant
byte is in the zeroth element.
@param val big-endian two's-complement binary representation of
BigInteger.
@throws NumberFormatException {@code val} is zero bytes long.
This private constructor translates an int array containing the
two's-complement binary representation of a BigInteger into a
BigInteger. The input array is assumed to be in big-endian
int-order: the most significant int is in the zeroth element.
Constructs a BigInteger with the specified value, which may not be zero.
Returns the input array stripped of any leading zero bytes.
Since the source is trusted the copying may be skipped.
Returns the String representation of this BigInteger in the
given radix. If the radix is outside the range from {@link
Character#Min_RADIX} to {@link Character#Max_RADIX} inclusive,
it will default to 10 (as is the case for
{@code Integer.toString}). The digit-to-character mapping
provided by {@code Character.forDigit} is used, and a minus
sign is prepended if appropriate. (This representation is
compatible with the {@link #BigInteger(String, int) (String,
int)} constructor.)
@param radix radix of the String representation.
@return String representation of this BigInteger in the given radix.
@see Integer#toString
@see Character#forDigit
@see #BigInteger(java.lang.String, int)
The BigInteger constant zero.
@since 1.2
The BigInteger constant one.
@since 1.2
The BigInteger constant two. (Not exported.)
The BigInteger constant ten.
@since 1.5
Returns a BigInteger whose value is equal to that of the
specified {@code long}. This "static factory method" is
provided in preference to a ({@code long}) constructor
because it allows for reuse of frequently used BigIntegers.
@param val value of the BigInteger to return.
@return a BigInteger with the specified value.
Returns a BigInteger with the given two's complement representation.
Assumes that the input array will not be modified (the returned
BigInteger will reference the input array if feasible).
Package private method to return bit length for an integer.
Returns the number of bits in the two's complement representation
of this BigInteger that differ from its sign bit. This method is
useful when implementing bit-vector style sets atop BigIntegers.
@return number of bits in the two's complement representation
of this BigInteger that differ from its sign bit.
Returns a BigInteger whose value is the absolute value of this
BigInteger.
@return {@code abs(this)}
Returns a BigInteger whose value is {@code (-this)}.
@return {@code -this}
Returns a BigInteger whose value is (thisexponent).
Note that {@code exponent} is an integer rather than a BigInteger.
@param exponent exponent to which this BigInteger is to be raised.
@return thisexponent
@throws ArithmeticException {@code exponent} is negative. (This would
cause the operation to yield a non-integer value.)
Multiplies int arrays x and y to the specified lengths and places
the result into z. There will be no leading zeros in the resultant array.
Multiply an array by one word k and add to result, return the carry
Squares the contents of the int array x. The result is placed into the
int array z. The contents of x are not changed.
Add one word to the number a mlen words into a. Return the resulting
carry.
Returns the signum function of this BigInteger.
@return -1, 0 or 1 as the value of this BigInteger is negative, zero or
positive.
Returns a byte array containing the two's-complement
representation of this BigInteger. The byte array will be in
big-endian byte-order: the most significant byte is in
the zeroth element. The array will contain the minimum number
of bytes required to represent this BigInteger, including at
least one sign bit, which is {@code (ceil((this.bitLength() +
1)/8))}. (This representation is compatible with the
{@link #BigInteger(byte[]) (byte[])} constructor.)
@return a byte array containing the two's-complement representation of
this BigInteger.
@see #BigInteger(byte[])
Returns the length of the two's complement representation in ints,
including space for at least one sign bit.
Returns the specified int of the little-endian two's complement
representation (int 0 is the least significant). The int number can
be arbitrarily high (values are logically preceded by infinitely many
sign ints).
Returns the index of the int that contains the first nonzero int in the
little-endian binary representation of the magnitude (int 0 is the
least significant). If the magnitude is zero, return value is undefined.
Returns a copy of the input array stripped of any leading zero bytes.
Takes an array a representing a negative 2's-complement number and
returns the minimal (no leading zero bytes) unsigned whose value is -a.
Takes an array a representing a negative 2's-complement number and
returns the minimal (no leading zero ints) unsigned whose value is -a.
Returns the number of zero bits preceding the highest-order
("leftmost") one-bit in the two's complement binary representation
of the specified {@code int} value. Returns 32 if the
specified value has no one-bits in its two's complement representation,
in other words if it is equal to zero.
Note that this method is closely related to the logarithm base 2.
For all positive {@code int} values x:
- floor(log2(x)) = {@code 31 - numberOfLeadingZeros(x)}
- ceil(log2(x)) = {@code 32 - numberOfLeadingZeros(x - 1)}
@return the number of zero bits preceding the highest-order
("leftmost") one-bit in the two's complement binary representation
of the specified {@code int} value, or 32 if the value
is equal to zero.
@since 1.5
Returns the number of zero bits following the lowest-order ("rightmost")
one-bit in the two's complement binary representation of the specified
{@code int} value. Returns 32 if the specified value has no
one-bits in its two's complement representation, in other words if it is
equal to zero.
@return the number of zero bits following the lowest-order ("rightmost")
one-bit in the two's complement binary representation of the
specified {@code int} value, or 32 if the value is equal
to zero.
@since 1.5
Returns the number of one-bits in the two's complement binary
representation of the specified {@code int} value. This function is
sometimes referred to as the population count.
@return the number of one-bits in the two's complement binary
representation of the specified {@code int} value.
@since 1.5
Compares the magnitude array of this BigInteger with the specified
BigInteger's. This is the version of compareTo ignoring sign.
@param val BigInteger whose magnitude array to be compared.
@return -1, 0 or 1 as this magnitude array is less than, equal to or
greater than the magnitude aray for the specified BigInteger's.
Compares this BigInteger with the specified Object for equality.
@param x Object to which this BigInteger is to be compared.
@return {@code true} if and only if the specified Object is a
BigInteger whose value is numerically equal to this BigInteger.
Returns the minimum of this BigInteger and {@code val}.
@param val value with which the minimum is to be computed.
@return the BigInteger whose value is the lesser of this BigInteger and
{@code val}. If they are equal, either may be returned.
Returns the maximum of this BigInteger and {@code val}.
@param val value with which the maximum is to be computed.
@return the BigInteger whose value is the greater of this and
{@code val}. If they are equal, either may be returned.
Returns the hash code for this BigInteger.
@return hash code for this BigInteger.
Converts this BigInteger to an {@code int}. This
conversion is analogous to a
narrowing primitive conversion from {@code long} to
{@code int} as defined in section 5.1.3 of
The Java(TM) Language Specification:
if this BigInteger is too big to fit in an
{@code int}, only the low-order 32 bits are returned.
Note that this conversion can lose information about the
overall magnitude of the BigInteger value as well as return a
result with the opposite sign.
@return this BigInteger converted to an {@code int}.
Converts this BigInteger to a {@code long}. This
conversion is analogous to a
narrowing primitive conversion from {@code long} to
{@code int} as defined in section 5.1.3 of
The Java(TM) Language Specification:
if this BigInteger is too big to fit in a
{@code long}, only the low-order 64 bits are returned.
Note that this conversion can lose information about the
overall magnitude of the BigInteger value as well as return a
result with the opposite sign.
@return this BigInteger converted to a {@code long}.
Returns a BigInteger whose value is {@code (this >> n)}. Sign
extension is performed. The shift distance, {@code n}, may be
negative, in which case this method performs a left shift.
(Computes floor(this / 2n).)
@param n shift distance, in bits.
@return {@code this >> n}
@throws ArithmeticException if the shift distance is {@code
Integer.Min_VALUE}.
@see #shiftLeft
Returns a BigInteger whose value is {@code (~this)}. (This method
returns a negative value if and only if this BigInteger is
non-negative.)
@return {@code ~this}
Returns a BigInteger whose value is {@code (this | val)}. (This method
returns a negative BigInteger if and only if either this or val is
negative.)
@param val value to be OR'ed with this BigInteger.
@return {@code this | val}
Package private methods used by BigDecimal code to multiply a BigInteger
with a long. Assumes v is not equal to INFLATED.
Returns a BigInteger whose value is {@code (this * val)}.
@param val value to be multiplied by this BigInteger.
@return {@code this * val}
Returns a BigInteger whose value is {@code (this + val)}.
@param val value to be added to this BigInteger.
@return {@code this + val}
Adds the contents of the int arrays x and y. This method allocates
a new int array to hold the answer and returns a reference to that
array.
Returns a BigInteger whose value is {@code (this - val)}.
@param val value to be subtracted from this BigInteger.
@return {@code this - val}
Subtracts the contents of the second int arrays (little) from the
first (big). The first int array (big) must represent a larger number
than the second. This method allocates the space necessary to hold the
answer.
Returns a BigInteger whose value is {@code (this / val)}.
@param val value by which this BigInteger is to be divided.
@return {@code this / val}
@throws ArithmeticException if {@code val} is zero.
Holds the magnitude of this MutableBigInteger in big endian order.
The magnitude may start at an offset into the value array, and it may
end before the length of the value array.
The number of ints of the value array that are currently used
to hold the magnitude of this MutableBigInteger. The magnitude starts
at an offset and offset + intLen may be less than value.Length.
The offset into the value array where the magnitude of this
MutableBigInteger begins.
MutableBigInteger with one element value array with the value 1. Used by
BigDecimal divideAndRound to increment the quotient. Use this constant
only when the method is not going to modify this object.
The default constructor. An empty MutableBigInteger is created with
a one word capacity.
Construct a new MutableBigInteger with a magnitude specified by
the int val.
Construct a new MutableBigInteger with the specified value array
up to the length of the array supplied.
Construct a new MutableBigInteger with a magnitude equal to the
specified BigInteger.
Construct a new MutableBigInteger with a magnitude equal to the
specified MutableBigInteger.
Internal helper method to return the magnitude array. The caller is not
supposed to modify the returned array.
Convert this MutableBigInteger to a long value. The caller has to make
sure this MutableBigInteger can be fit into long.
Convert this MutableBigInteger to a BigInteger object.
Clear out a MutableBigInteger for reuse.
Set a MutableBigInteger to zero, removing its offset.
Compare the magnitude of two MutableBigIntegers. Returns -1, 0 or 1
as this MutableBigInteger is numerically less than, equal to, or
greater than b.
Compare this against half of a MutableBigInteger object (Needed for
remainder tests).
Assumes no leading unnecessary zeros, which holds for results
from divide().
Return the index of the lowest set bit in this MutableBigInteger. If the
magnitude of this MutableBigInteger is zero, -1 is returned.
Return the int in use in this MutableBigInteger at the specified
index. This method is not used because it is not inlined on all
platforms.
Return a long which is equal to the unsigned value of the int in
use in this MutableBigInteger at the specified index. This method is
not used because it is not inlined on all platforms.
Ensure that the MutableBigInteger is in normal form, specifically
making sure that there are no leading zeros, and that if the
magnitude is zero, then intLen is zero.
If this MutableBigInteger cannot hold len words, increase the size
of the value array to len words.
Convert this MutableBigInteger into an int array with no leading
zeros, of a length that is equal to this MutableBigInteger's intLen.
Sets the int at index+offset in this MutableBigInteger to val.
This does not get inlined on all platforms so it is not used
as often as originally intended.
Sets this MutableBigInteger's value array to the specified array.
The intLen is set to the specified length.
Sets this MutableBigInteger's value array to a copy of the specified
array. The intLen is set to the length of the new array.
Sets this MutableBigInteger's value array to a copy of the specified
array. The intLen is set to the length of the specified array.
Returns true iff this MutableBigInteger has a value of one.
Returns true iff this MutableBigInteger has a value of zero.
Returns true iff this MutableBigInteger is even.
Returns true iff this MutableBigInteger is odd.
Returns true iff this MutableBigInteger is in normal form. A
MutableBigInteger is in normal form if it has no leading zeros
after the offset, and intLen + offset <= value.Length.
Returns a String representation of this MutableBigInteger in radix 10.
Right shift this MutableBigInteger n bits. The MutableBigInteger is left
in normal form.
Left shift this MutableBigInteger n bits.
A primitive used for division. This method adds in one multiple of the
divisor a back to the dividend result at a specified offset. It is used
when qhat was estimated too large, and must be adjusted.
This method is used for division. It multiplies an n word input a by one
word input x, and subtracts the n word product from q. This is needed
when subtracting qhat*divisor from dividend.
Right shift this MutableBigInteger n bits, where n is
less than 32.
Assumes that intLen > 0, n > 0 for speed
Left shift this MutableBigInteger n bits, where n is
less than 32.
Assumes that intLen > 0, n > 0 for speed
Adds the contents of two MutableBigInteger objects.The result
is placed within this MutableBigInteger.
The contents of the addend are not changed.
Subtracts the smaller of this and b from the larger and places the
result into this MutableBigInteger.
Subtracts the smaller of a and b from the larger and places the result
into the larger. Returns 1 if the answer is in a, -1 if in b, 0 if no
operation was performed.
Multiply the contents of two MutableBigInteger objects. The result is
placed into MutableBigInteger z. The contents of y are not changed.
Multiply the contents of this MutableBigInteger by the word y. The
result is placed into z.
This method is used for division of an n word dividend by a one word
divisor. The quotient is placed into quotient. The one word divisor is
specified by divisor.
@return the remainder of the division is returned.
Calculates the quotient of this div b and places the quotient in the
provided MutableBigInteger objects and the remainder object is returned.
Uses Algorithm D in Knuth section 4.3.1.
Many optimizations to that algorithm have been adapted from the Colin
Plumb C library.
It special cases one word divisors for speed. The content of b is not
changed.
Internally used to calculate the quotient of this div v and places the
quotient in the provided MutableBigInteger object and the remainder is
returned.
@return the remainder of the division will be returned.
Divide this MutableBigInteger by the divisor represented by its magnitude
array. The quotient will be placed into the provided quotient object &
the remainder object is returned.
Compare two longs as if they were unsigned.
Returns true iff one is bigger than two.
This method divides a long quantity by an int to estimate
qhat for two multi precision numbers. It is used when
the signed value of n is less than zero.
Calculate GCD of this and b. This and b are changed by the computation.
Calculate GCD of this and v.
Assumes that this and v are not zero.
Calculate GCD of a and b interpreted as unsigned integers.
Returns the modInverse of this mod p. This and p are not affected by
the operation.
Calculate the multiplicative inverse of this mod mod, where mod is odd.
This and mod are not changed by the calculation.
This method implements an algorithm due to Richard Schroeppel, that uses
the same intermediate representation as Montgomery Reduction
("Montgomery Form"). The algorithm is described in an unpublished
manuscript entitled "Fast Modular Reciprocals."
Uses the extended Euclidean algorithm to compute the modInverse of base
mod a modulus that is a power of 2. The modulus is 2^k.
Manage operations dealing with bit-mapped fields.
@author Marc Johnson (mjohnson at apache dot org)
@author Andrew C. Oliver (acoliver at apache dot org)
Create a instance
the mask specifying which bits apply to this
BitField. Bits that are set in this mask are the
bits that this BitField operates on
Create a instance
the mask specifying which bits apply to this
BitField. Bits that are set in this mask are the
bits that this BitField operates on
Clear the bits.
the int data containing the bits we're interested in
the value of holder with the specified bits cleared (set to 0)
Clear the bits.
the short data containing the bits we're interested in
the value of holder with the specified bits cleared (set to 0)
Obtain the value for the specified BitField, appropriately
shifted right. Many users of a BitField will want to treat the
specified bits as an int value, and will not want to be aware
that the value is stored as a BitField (and so shifted left so
many bits)
the int data containing the bits we're interested in
the selected bits, shifted right appropriately
Obtain the value for the specified BitField, unshifted
the short data containing the bits we're interested in
the selected bits
Obtain the value for the specified BitField, appropriately
shifted right, as a short. Many users of a BitField will want
to treat the specified bits as an int value, and will not want
to be aware that the value is stored as a BitField (and so
shifted left so many bits)
the short data containing the bits we're interested in
the selected bits, shifted right appropriately
Obtain the value for the specified BitField, appropriately
shifted right. Many users of a BitField will want to treat the
specified bits as an int value, and will not want to be aware
that the value is stored as a BitField (and so shifted left so
many bits)
the int data containing the bits we're interested in
the selected bits, shifted right appropriately
Are all of the bits set or not? This is a stricter test than
isSet, in that all of the bits in a multi-bit set must be set
for this method to return true
the int data containing the bits we're interested in
true if all of the bits are set otherwise, false.
is the field set or not? This is most commonly used for a
single-bit field, which is often used to represent a boolean
value; the results of using it for a multi-bit field is to
determine whether *any* of its bits are set
the int data containing the bits we're interested in
true if any of the bits are set; otherwise, false.
Set the bits.
the int data containing the bits we're interested in
the value of holder with the specified bits set to 1
Set a boolean BitField
the int data containing the bits we're interested in
indicating whether to set or clear the bits
the value of holder with the specified bits set or cleared
Set the bits.
the short data containing the bits we're interested in
the value of holder with the specified bits set to 1
Set a boolean BitField
the short data containing the bits we're interested in
indicating whether to set or clear the bits
the value of holder with the specified bits set or cleared
Obtain the value for the specified BitField, appropriately
shifted right, as a short. Many users of a BitField will want
to treat the specified bits as an int value, and will not want
to be aware that the value is stored as a BitField (and so
shifted left so many bits)
the short data containing the bits we're interested in
the new value for the specified bits
the selected bits, shifted right appropriately
Sets the value.
the byte data containing the bits we're interested in
The value.
Set a boolean BitField
the byte data containing the bits we're interested in
indicating whether to set or clear the bits
the value of holder with the specified bits set or cleared
Clears the bits.
the byte data containing the bits we're interested in
the value of holder with the specified bits cleared
Set the bits.
the byte data containing the bits we're interested in
the value of holder with the specified bits set to 1
Returns immutable Btfield instances.
@author Jason Height (jheight at apache dot org)
Gets the instance.
The mask.
representation of a byte (8-bit) field at a fixed location within a
byte array
@author Marc Johnson (mjohnson at apache dot org
behavior of a field at a fixed location within a byte array
@author Marc Johnson (mjohnson at apache dot org
set the value from its offset into an array of bytes
the byte array from which the value is to be read
set the value from an Stream
the Stream from which the value is to be read
return the value as a String
write the value out to an array of bytes at the appropriate offset
the array of bytes to which the value is to be written
Initializes a new instance of the class.
The offset.
Initializes a new instance of the class.
The offset.
The value.
Initializes a new instance of the class.
The offset.
The data.
Initializes a new instance of the class.
The offset.
The _value.
The data.
set the value from its offset into an array of bytes
the byte array from which the value is to be read
set the value from an Stream
the Stream from which the value is to be read
set the ByteField's current value and write it to a byte array
value to be set
the byte array to write the value to
Returns a that represents the current .
A that represents the current .
write the value out to an array of bytes at the appropriate offset
the array of bytes to which the value is to be written
Gets or sets the value.
The value.
Represents a class ID (16 bytes). Unlike other little-endian
type the {@link ClassID} is not just 16 bytes stored in the wrong
order. Instead, it is a double word (4 bytes) followed by two
words (2 bytes each) followed by 8 bytes.
@author Rainer Klute
klute@rainer-klute.de
@version $Id: ClassID.java 489730 2006-12-22 19:18:16Z bayard $
@since 2002-02-09
The number of bytes occupied by this object in the byte
stream.
The bytes making out the class ID in correct order,
i.e. big-endian.
Creates a and Reads its value from a byte array.
The byte array to Read from.
The offset of the first byte to Read.
Creates a and initializes its value with 0x00 bytes.
Reads the class ID's value from a byte array by turning little-endian into big-endian.
The byte array to Read from
The offset within the
A byte array containing the class ID.
Writes the class ID to a byte array in the little-endian format.
The byte array to Write to.
The offset within the
Checks whether this ClassID is equal to another
object.
the object to compare this PropertySet with
true if the objects are equal, else
false
Serves as a hash function for a particular type.
A hash code for the current .
Returns a human-Readable representation of the Class ID in standard
format "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}".
A String representation of the Class ID represented by this object..
Gets the length.
The number of bytes occupied by this object in the byte stream.
Gets or sets the bytes making out the class ID. They are returned in correct order, i.e. big-endian.
the bytes making out the class ID..
This class comes from Java
This interface comes from Java
Adds the specified o.
The o.
Determines whether [contains] [the specified o].
The o.
true if [contains] [the specified o]; otherwise, false.
Removes the specified o.
The o.
Removes all of the elements from this set (optional operation).
The set will be empty after this call returns.
Initializes a new instance of the class.
Initializes a new instance of the class.
The s.
Adds the specified o.
The o.
Determines whether [contains] [the specified o].
The o.
true if [contains] [the specified o]; otherwise, false.
Copies the elements of the to an , starting at a particular index.
The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing.
The zero-based index in at which copying begins.
is null.
is less than zero.
is multidimensional.
-or-
is equal to or greater than the length of .
-or-
The number of elements in the source is greater than the available space from to the end of the destination .
The type of the source cannot be cast automatically to the type of the destination .
Returns an enumerator that iterates through a collection.
An object that can be used to iterate through the collection.
Removes the specified o.
The o.
Removes all of the elements from this set.
The set will be empty after this call returns.
Gets the number of elements contained in the .
The number of elements contained in the .
Gets a value indicating whether access to the is synchronized (thread safe).
true if access to the is synchronized (thread safe); otherwise, false.
Gets an object that can be used to synchronize access to the .
An object that can be used to synchronize access to the .
This class comes from Java
Initializes a new instance of the class.
Removes the specified key.
The key.
Gets the enumerator.
Determines whether the specified key contains key.
The key.
true if the specified key contains key; otherwise, false.
Adds the specified key.
The key.
The value.
Clears this instance.
Loads the specified in stream.
The in stream.
Loads the convert.
The string.
Converts encoded \uxxxx to unicode chars
and changes special saved chars to their original forms
Continues the line.
The line.
Gets the count.
The count.
Gets or sets the with the specified key.
Gets the keys.
The keys.
CRC Verification
Initializes a new instance of the class.
CRC Bytes.
The buffer.
String CRC
the string
File CRC
the input file
Stream CRC
the input stream
dump data in hexadecimal format; derived from a HexDump utility I
wrote in June 2001.
@author Marc Johnson
@author Glen Stampoultzis (glens at apache.org)
Shorts to hex.
The value.
char array of 2 (zero padded) uppercase hex chars and prefixed with '0x'
Bytes to hex.
The value.
char array of 1 (zero padded) uppercase hex chars and prefixed with '0x'
Ints to hex.
The value.
char array of 4 (zero padded) uppercase hex chars and prefixed with '0x'
char array of 4 (zero padded) uppercase hex chars and prefixed with '0x'
The value.
char array of 4 (zero padded) uppercase hex chars and prefixed with '0x'
Toes the hex chars.
The p value.
The n bytes.
char array of uppercase hex chars, zero padded and prefixed with '0x'
This method reads hex data from a filename and returns a byte array.
The file may contain line comments that are preceeded with a # symbol.
The filename to read
The bytes read from the file.
If there was a problem while reading the file.
Same as ReadData(String) except that this method allows you to specify sections within
a file. Sections are referenced using section headers in the form:
The stream.
The section.
Reads the data.
The filename.
The section.
Reads the data.
The stream.
The EOF char.
Reads from string.
The data.
Reads to EOL.
The stream.
construct the with its offset into its containing byte array class.
offset of the field within its byte array.
construct the with its offset into its containing
byte array and initialize its value
offset of the field within its byte array
the initial value
Construct the with its offset into its containing
byte array and initialize its value from its byte array
offset of the field within its byte array
the byte array to Read the value from
construct the with its offset into its containing
byte array, initialize its value, and write the value to a byte
offset of the field within its byte array
the initial value
the byte array to write the value to
Set the IntegerField's current value and write it to a byte array
value to be Set
the byte array to write the value to
Set the value from its offset into an array of bytes
The data.
Set the value from an Stream
the Stream from which the value is to be Read
write the value out to an array of bytes at the appropriate offset
the array of bytes to which the value is to be written
Same as using the constructor with the same
parameter list. Avoid creation of an useless object.
offset of the field within its byte array
the initial value
the byte array to write the value to
Returns a that represents the current .
A that represents the current .
get or Set the IntegerField's current value
The value.
A List of int's; as full an implementation of the java.Util.List interface as possible, with an eye toward minimal creation of objects
the mimicry of List is as follows:
- if possible, operations designated 'optional' in the List
interface are attempted
- wherever the List interface refers to an Object, substitute
int
- wherever the List interface refers to a Collection or List,
substitute IntList
the mimicry is not perfect, however:
- operations involving Iterators or ListIterators are not
supported
- Remove(Object) becomes RemoveValue to distinguish it from
Remove(int index)
- subList is not supported
@author Marc Johnson
create an IntList of default size
create a copy of an existing IntList
the existing IntList
create an IntList with a predefined Initial size
the size for the internal array
add the specfied value at the specified index
the index where the new value is to be Added
the new value
Appends the specified element to the end of this list
element to be Appended to this list.
return true (as per the general contract of the Collection.add method
Appends all of the elements in the specified collection to the
end of this list, in the order that they are returned by the
specified collection's iterator. The behavior of this
operation is unspecified if the specified collection is
modified while the operation is in progress. (Note that this
will occur if the specified collection is this list, and it's
nonempty.)
collection whose elements are to be Added to this list.
return true if this list Changed as a result of the call.
Inserts all of the elements in the specified collection into
this list at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements
to the right (increases their indices). The new elements will
appear in this list in the order that they are returned by the
specified collection's iterator. The behavior of this
operation is unspecified if the specified collection is
modified while the operation is in progress. (Note that this
will occur if the specified collection is this list, and it's
nonempty.)
index at which to insert first element from the specified collection.
elements to be inserted into this list.
return true if this list Changed as a result of the call.
Removes all of the elements from this list. This list will be
empty After this call returns (unless it throws an exception).
Returns true if this list Contains the specified element. More
formally, returns true if and only if this list Contains at
least one element e such that o == e
element whose presence in this list is to be Tested.
return true if this list Contains the specified element.
Returns true if this list Contains all of the elements of the
specified collection.
collection to be Checked for Containment in this list.
return true if this list Contains all of the elements of the specified collection.
Compares the specified object with this list for Equality.
Returns true if and only if the specified object is also a
list, both lists have the same size, and all corresponding
pairs of elements in the two lists are Equal. (Two elements e1
and e2 are equal if e1 == e2.) In other words, two lists are
defined to be equal if they contain the same elements in the
same order. This defInition ensures that the Equals method
works properly across different implementations of the List
interface.
the object to be Compared for Equality with this list.
return true if the specified object is equal to this list.
Returns the element at the specified position in this list.
index of element to return.
return the element at the specified position in this list.
Returns the hash code value for this list. The hash code of a
list is defined to be the result of the following calculation:
hashCode = 1;
Iterator i = list.Iterator();
while (i.HasNext()) {
Object obj = i.Next();
hashCode = 31*hashCode + (obj==null ? 0 : obj.HashCode());
}
This ensures that list1.Equals(list2) implies that
list1.HashCode()==list2.HashCode() for any two lists, list1 and
list2, as required by the general contract of Object.HashCode.
return the hash code value for this list.
Returns the index in this list of the first occurrence of the
specified element, or -1 if this list does not contain this
element. More formally, returns the lowest index i such that
(o == Get(i)), or -1 if there is no such index.
element to search for.
return the index in this list of the first occurrence of the
specified element, or -1 if this list does not contain
this element.
Returns true if this list Contains no elements.
return true if this list Contains no elements.
Returns the index in this list of the last occurrence of the
specified element, or -1 if this list does not contain this
element. More formally, returns the highest index i such that
(o == Get(i)), or -1 if there is no such index.
element to search for.
the index in this list of the last occurrence of the
specified element, or -1 if this list does not contain
this element.
Removes the element at the specified position in this list.
Shifts any subsequent elements to the left (subtracts one from
their indices). Returns the element that was Removed from the
list.
the index of the element to Removed.
return the element previously at the specified position.
Removes the first occurrence in this list of the specified
element (optional operation). If this list does not contain
the element, it is unChanged. More formally, Removes the
element with the lowest index i such that (o.Equals(get(i)))
(if such an element exists).
element to be Removed from this list, if present.
return true if this list Contained the specified element.
Removes from this list all the elements that are Contained in
the specified collection
collection that defines which elements will be Removed from the list.
return true if this list Changed as a result of the call.
Retains only the elements in this list that are Contained in
the specified collection. In other words, Removes from this
list all the elements that are not Contained in the specified
collection.
collection that defines which elements this Set will retain.
return true if this list Changed as a result of the call.
Replaces the element at the specified position in this list with the specified element
index of element to Replace.
element to be stored at the specified position.
the element previously at the specified position.
Returns the number of elements in this list. If this list
Contains more than Int32.MaxValue elements, returns
Int32.MaxValue.
the number of elements in this IntList
Returns an array Containing all of the elements in this list in
proper sequence. Obeys the general contract of the
Collection.ToArray method.
an array Containing all of the elements in this list in proper sequence.
Returns an array Containing all of the elements in this list in
proper sequence. Obeys the general contract of the
Collection.ToArray(Object[]) method.
the array into which the elements of this list are to
be stored, if it is big enough; otherwise, a new array
is allocated for this purpose.
return an array Containing the elements of this list.
the number of elements in this IntList
A List of objects that are indexed AND keyed by an int; also allows for Getting
the index of a value in the list
I am happy is someone wants to re-implement this without using the
internal list and hashmap. If so could you please make sure that
you can add elements half way into the list and have the value-key mappings
update
@author Jason Height
create an IntMapper of default size
Appends the specified element to the end of this list
element to be Appended to this list.
return true (as per the general contract of the Collection.add method)
Gets the index of T object.
The o.
Gets the enumerator.
Gets the size.
Gets the T object at the specified index.
Reads all the data from the input stream, and returns
the bytes Read.
The stream.
Tony Qu changed the code
Reads the fully.
The stream.
The b.
Same as the normal
in.Read(b, off, len)
, but tries to ensure that the entire len number of bytes is Read.
If the end of file is reached before any bytes are Read, returns -1.
If the end of the file is reached after some bytes are
Read, returns the number of bytes Read.
If the end of the file isn't reached before len
bytes have been Read, will return len bytes.
The stream.
The b.
The off.
The len.
Copies all the data from the given InputStream to the OutputStream. It
leaves both streams open, so you will still need to close them once done.
Adapts a plain byte array to
@author Josh Micich
Adapts a plain byte array to
@author Josh Micich
Wraps an providing
This class does not buffer any input, so the stream Read position maintained
by this class is consistent with that of the inner stream.
@author Josh Micich
Wraps an providing
@author Josh Micich
a utility class for handling little-endian numbers, which the 80x86 world is
replete with. The methods are all static, and input/output is from/to byte
arrays, or from InputStreams.
@author Marc Johnson (mjohnson at apache dot org)
@author Andrew Oliver (acoliver at apache dot org)
Initializes a new instance of the class.
get a short value from a byte array
the byte array
a starting offset into the byte array
the short (16-bit) value
get an unsigned short value from a byte array
the byte array
a starting offset into the byte array
the unsigned short (16-bit) value in an integer
get a short value from a byte array
a starting offset into the byte array
the short (16-bit) value
get a short value from a byte array
the unsigned short (16-bit) value in an integer
get an int value from a byte array
the byte array
a starting offset into the byte array
the int (32-bit) value
get an int value from the beginning of a byte array
the byte array
the int (32-bit) value
Gets the U int.
the byte array
a starting offset into the byte array
the unsigned int (32-bit) value in a long
Gets the U int.
the byte array
the unsigned int (32-bit) value in a long
get a long value from a byte array
the byte array
a starting offset into the byte array
the long (64-bit) value
get a double value from a byte array, reads it in little endian format
then converts the resulting revolting IEEE 754 (curse them) floating
point number to a c# double
the byte array
a starting offset into the byte array
the double (64-bit) value
Puts the short.
the byte array
a starting offset into the byte array
The value.
Added for consistency with other put~() methods
the byte array
a starting offset into the byte array
The value.
Puts the U short.
the byte array
a starting offset into the byte array
The value.
put a short value into beginning of a byte array
the byte array
the short (16-bit) value
Put signed short into output stream
@param value
the short (16-bit) value
@param outputStream
output stream
@throws IOException
if an I/O error occurs
put an int value into a byte array
the byte array
a starting offset into the byte array
the int (32-bit) value
put an int value into beginning of a byte array
the byte array
the int (32-bit) value
Put int into output stream
the int (32-bit) value
output stream
put a long value into a byte array
the byte array
a starting offset into the byte array
the long (64-bit) value
put a double value into a byte array
the byte array
a starting offset into the byte array
the double (64-bit) value
Reads the short.
The stream.
get an int value from an Stream
the Stream from which the int is to be read
the int (32-bit) value
will be propagated back to the caller
if the stream cannot provide enough bytes
get a long value from a Stream
the Stream from which the long is to be read
the long (64-bit) value
will be propagated back to the caller
if the stream cannot provide enough bytes
Us the byte to int.
The b.
get the unsigned value of a byte.
the byte array.
a starting offset into the byte array.
the unsigned value of the byte as a 32 bit integer
Copy a portion of a byte array
the original byte array
Where to start copying from.
Number of bytes to copy.
The byteArray value
if copying would cause access ofdata outside array bounds.
Gets the unsigned byte.
the byte array
Gets the unsigned byte.
the byte array
a starting offset into the byte array
Puts the double.
the byte array
The value.
put a double value into a byte array
@param value
the double (64-bit) value
@param outputStream
output stream
@throws IOException
if an I/O error occurs
Puts the uint.
the byte array
The value.
Put unsigned int into output stream
@param value
the int (32-bit) value
@param outputStream
output stream
@throws IOException
if an I/O error occurs
Puts the uint.
the byte array
a starting offset into the byte array
The value.
Puts the long.
the byte array
The value.
Put long into output stream
@param value
the long (64-bit) value
@param outputStream
output stream
@throws IOException
if an I/O error occurs
Puts the long.
the byte array
The value.
Puts the ulong.
the byte array
a starting offset into the byte array
The value.
Puts the number.
the byte array
a starting offset into the byte array
The value.
The size.
Puts the number.
the byte array
a starting offset into the byte array
The value.
The size.
Puts the short array.
the byte array
a starting offset into the byte array
The value.
Puts the U short.
the byte array
The value.
Put unsigned short into output stream
@param value
the unsigned short (16-bit) value
@param outputStream
output stream
@throws IOException
if an I/O error occurs
Reads from stream.
The stream.
The size.
Reads the long.
The stream.
construct the with its offset into its containing byte array
The offset.
construct the LongField with its offset into its containing
byte array and initialize its value
offset of the field within its byte array
the initial value
Construct the class with its offset into its containing
byte array and initialize its value from its byte array
The offset of the field within its byte array
the byte array to read the value from
construct the class with its offset into its containing
byte array, initialize its value, and write the value to a byte
array
offset of the field within its byte array
the initial value
the byte array to write the value to
set the LongField's current value and write it to a byte array
value to be set
the byte array to write the value to
set the value from its offset into an array of bytes
the byte array from which the value is to be read
set the value from an Stream
the Stream from which the value is to be
write the value out to an array of bytes at the appropriate offset
the array of bytes to which the value is to be written
Same as using the constructor with the same
parameter list. Avoid creation of an useless object.
offset of the field within its byte array
the initial value
the byte array to write the value to
Returns a that represents the current .
A that represents the current .
Getg or sets the LongField's current value
The current value
This class provides common functionality for the
various LZW implementations in the different file
formats.
It's currently used by HDGF and HMEF.
Two good resources on LZW are:
http://en.wikipedia.org/wiki/LZW
http://marknelson.us/1989/10/01/lzw-data-compression/
Does the mask bit mean it's compressed or uncompressed?
How much to append to the code length in the stream
to Get the real code length? Normally 2 or 3
Does the 12 bits of the position Get stored in
Little Endian or Big Endian form?
This controls whether a pos+length of 0x12 0x34
becomes a position of 0x123 or 0x312
Populates the dictionary, and returns where in it
to begin writing new codes.
Generally, if the dictionary is pre-populated, then new
codes should be placed at the end of that block.
Equally, if the dictionary is left with all zeros, then
usually the new codes can go in at the start.
Adjusts the position offset if needed when looking
something up in the dictionary.
Decompresses the given input stream, returning the array of bytes
of the decompressed input.
Perform a streaming decompression of the input.
Works by:
1) Reading a flag byte, the 8 bits of which tell you if the
following 8 codes are compressed our un-compressed
2) Consider the 8 bits in turn
3) If the bit is Set, the next code is un-compressed, so
add it to the dictionary and output it
4) If the bit isn't Set, then read in the length and start
position in the dictionary, and output the bytes there
5) Loop until we've done all 8 bits, then read in the next
flag byte
Given an integer, turn it into a java byte, handling
the wrapping.
This is a convenience method
Given a java byte, turn it into an integer between 0
and 255 (i.e. handle the unwrapping).
This is a convenience method
A Logger class that strives to make it as easy as possible for
developers to write Log calls, while simultaneously making those
calls as cheap as possible by performing lazy evaluation of the Log
message.
@author Marc Johnson (mjohnson at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Nicola Ken Barozzi (nicolaken at apache.org)
package scope so it cannot be instantiated outside of the util
package. You need a POILogger? Go to the POILogFactory for one
Log a message
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 The object to Log. This is converted to a string.
Log a message
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 The object to Log. This is converted to a string.
@param exception An exception to be Logged
Check if a Logger is enabled to Log at the specified level
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first object to place in the message
@param obj2 second object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
@param obj6 sixth Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
@param obj6 sixth Object to place in the message
@param obj7 seventh Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
@param obj6 sixth Object to place in the message
@param obj7 seventh Object to place in the message
@param obj8 eighth Object to place in the message
Log an exception, without a message
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param exception An error message to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param obj6 sixth object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param obj6 sixth object to place in the message
@param obj7 seventh object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param obj6 sixth object to place in the message
@param obj7 seventh object to place in the message
@param obj8 eighth object to place in the message
@param exception An exception to be Logged
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
@param obj2 The second object to match against.
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
@param obj2 The second object to match against.
@param obj3 The third object to match against.
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
@param obj2 The second object to match against.
@param obj3 The third object to match against.
@param obj4 The forth object to match against.
Flattens any contained objects. Only tranverses one level deep.
Log a message
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 The object to Log.
Check if a Logger is enabled to Log at the specified level
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first object to place in the message
@param obj2 second object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
@param obj6 sixth Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
@param obj6 sixth Object to place in the message
@param obj7 seventh Object to place in the message
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third Object to place in the message
@param obj4 fourth Object to place in the message
@param obj5 fifth Object to place in the message
@param obj6 sixth Object to place in the message
@param obj7 seventh Object to place in the message
@param obj8 eighth Object to place in the message
Log a message
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 The object to Log. This is converted to a string.
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param exception An error message to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param obj6 sixth object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param obj6 sixth object to place in the message
@param obj7 seventh object to place in the message
@param exception An exception to be Logged
Log a message. Lazily appends Object parameters together.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param obj1 first Object to place in the message
@param obj2 second Object to place in the message
@param obj3 third object to place in the message
@param obj4 fourth object to place in the message
@param obj5 fifth object to place in the message
@param obj6 sixth object to place in the message
@param obj7 seventh object to place in the message
@param obj8 eighth object to place in the message
@param exception An exception to be Logged
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
@param obj2 The second object to match against.
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
@param obj2 The second object to match against.
@param obj3 The third object to match against.
Logs a formated message. The message itself may contain %
characters as place holders. This routine will attempt to match
the placeholder by looking at the type of parameter passed to
obj1.
If the parameter is an array, it traverses the array first and
matches parameters sequentially against the array items.
Otherwise the parameters after message are matched
in order.
If the place holder matches against a number it is printed as a
whole number. This can be overridden by specifying a precision
in the form %n.m where n is the padding for the whole part and
m is the number of decimal places to display. n can be excluded
if desired. n and m may not be more than 9.
If the last parameter (after flattening) is a Exception it is
Logged specially.
@param level One of DEBUG, INFO, WARN, ERROR, FATAL
@param message The message to Log.
@param obj1 The first object to match against.
@param obj2 The second object to match against.
@param obj3 The third object to match against.
@param obj4 The forth object to match against.
File header for PNG format.
Checks if the offset matches the PNG header.
@param data the data to check.
@param offset the offset to check at.
@return {@code true} if the offset matches.
Map of POILogger instances, with classes as keys
A common instance of NullLogger, as it does nothing
we only need the one
The name of the class to use. Initialised the
first time we need it
Initializes a new instance of the class.
Get a logger, based on a class name
the class whose name defines the log
a POILogger for the specified class
Get a logger, based on a String
the String that defines the log
a POILogger for the specified class
Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
The unsigned byte cast to an Int32, or -1 if at the end of the stream.
The stream does not support reading.
Methods were called after the stream was closed.
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source.
The zero-based byte offset in at which to begin storing the data read from the current stream.
The maximum number of bytes to be read from the current stream.
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
The sum of and is larger than the buffer length.
is null.
or is negative.
An I/O error occurs.
The stream does not support reading.
Methods were called after the stream was closed.
Unreads the specified b.
The b.
Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
An I/O error occurs.
When overridden in a derived class, sets the position within the current stream.
A byte offset relative to the parameter.
A value of type indicating the reference point used to obtain the new position.
The new position within the current stream.
An I/O error occurs.
The stream does not support seeking, such as if the stream is constructed from a pipe or console output.
Methods were called after the stream was closed.
When overridden in a derived class, sets the length of the current stream.
The desired length of the current stream in bytes.
An I/O error occurs.
The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.
Methods were called after the stream was closed.
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
An array of bytes. This method copies bytes from to the current stream.
The zero-based byte offset in at which to begin copying bytes to the current stream.
The number of bytes to be written to the current stream.
The sum of and is greater than the buffer length.
is null.
or is negative.
An I/O error occurs.
The stream does not support writing.
Methods were called after the stream was closed.
Writes a byte to the current position in the stream and advances the position within the stream by one byte.
The byte to write to the stream.
An I/O error occurs.
The stream does not support writing, or the stream is already closed.
Methods were called after the stream was closed.
When overridden in a derived class, gets a value indicating whether the current stream supports reading.
true if the stream supports reading; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
true if the stream supports seeking; otherwise, false.
When overridden in a derived class, gets a value indicating whether the current stream supports writing.
true if the stream supports writing; otherwise, false.
When overridden in a derived class, gets the length in bytes of the stream.
A long value representing the length of the stream in bytes.
A class derived from Stream does not support seeking.
Methods were called after the stream was closed.
When overridden in a derived class, gets or sets the position within the current stream.
The current position within the stream.
An I/O error occurs.
The stream does not support seeking.
Methods were called after the stream was closed.
A common exception thrown by our binary format Parsers
(especially HSSF and DDF), when they hit invalid
format or data when Processing a record.
construct the ShortField with its offset into its containing
byte array
offset of the field within its byte array
if offset is negative
construct the ShortField with its offset into its containing byte array and initialize its value
offset of the field within its byte array
the initial value
if offset is negative
Construct the ShortField with its offset into its containing
byte array and initialize its value from its byte array
offset of the field within its byte array
the byte array to read the value from
if the offset is not
within the range of 0..(data.length - 1)
construct the ShortField with its offset into its containing
byte array, initialize its value, and write its value to its
byte array
offset of the field within its byte array
the initial value
the byte array to write the value to
if offset is negative
set the ShortField's current value and write it to a byte array
value to be set
the byte array to write the value to
if the offset is out
of range
set the value from its offset into an array of bytes
the byte array from which the value is to be read
if the offset is out
of range
set the value from an Stream
the Stream from which the value is to be
read
if an IOException is thrown from reading
the Stream
if there is not enough data
available from the Stream
write the value out to an array of bytes at the appropriate
offset
the array of bytes to which the value is to be
written
if the offset is out
of range
Same as using the constructor with the same
parameter list. Avoid creation of an useless object.
offset of the field within its byte array
the initial value
the byte array to write the value to
Returns a that represents the current .
A that represents the current .
Gets or sets the value.
The value.
A List of short's; as full an implementation of the java.Util.List
interface as possible, with an eye toward minimal creation of
objects
the mimicry of List is as follows:
- if possible, operations designated 'optional' in the List
interface are attempted
- wherever the List interface refers to an Object, substitute
short
- wherever the List interface refers to a Collection or List,
substitute shortList
the mimicry is not perfect, however:
- operations involving Iterators or ListIterators are not
supported
- Remove(Object) becomes RemoveValue to distinguish it from
Remove(short index)
- subList is not supported
create an shortList of default size
create a copy of an existing shortList
the existing shortList
create an shortList with a predefined Initial size
the size for the internal array
add the specfied value at the specified index
the index where the new value is to be Added
the new value
Appends the specified element to the end of this list
element to be Appended to this list.
return true (as per the general contract of the Collection.add method).
Appends all of the elements in the specified collection to the
end of this list, in the order that they are returned by the
specified collection's iterator. The behavior of this
operation is unspecified if the specified collection is
modified while the operation is in progress. (Note that this
will occur if the specified collection is this list, and it's
nonempty.)
collection whose elements are to be Added to this list.
return true if this list Changed as a result of the call.
Inserts all of the elements in the specified collection into
this list at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements
to the right (increases their indices). The new elements will
appear in this list in the order that they are returned by the
specified collection's iterator. The behavior of this
operation is unspecified if the specified collection is
modified while the operation is in progress. (Note that this
will occur if the specified collection is this list, and it's
nonempty.)
index at which to insert first element from the specified collection.
elements to be inserted into this list.
return true if this list Changed as a result of the call.
if the index is out of range (index < 0 || index > size())
Removes all of the elements from this list. This list will be
empty After this call returns (unless it throws an exception).
Returns true if this list Contains the specified element. More
formally, returns true if and only if this list Contains at
least one element e such that o == e
element whose presence in this list is to be Tested.
return true if this list Contains the specified element.
Returns true if this list Contains all of the elements of the specified collection.
collection to be Checked for Containment in this list.
return true if this list Contains all of the elements of the specified collection.
Compares the specified object with this list for Equality.
Returns true if and only if the specified object is also a
list, both lists have the same size, and all corresponding
pairs of elements in the two lists are Equal. (Two elements e1
and e2 are equal if e1 == e2.) In other words, two lists are
defined to be equal if they contain the same elements in the
same order. This defInition ensures that the Equals method
works properly across different implementations of the List
interface.
the object to be Compared for Equality with this list.
return true if the specified object is equal to this list.
Returns the element at the specified position in this list.
index of element to return.
return the element at the specified position in this list.
Returns the hash code value for this list. The hash code of a
list is defined to be the result of the following calculation:
hashCode = 1;
Iterator i = list.Iterator();
while (i.HasNext()) {
Object obj = i.Next();
hashCode = 31*hashCode + (obj==null ? 0 : obj.HashCode());
}
This ensures that list1.Equals(list2) implies that
list1.HashCode()==list2.HashCode() for any two lists, list1 and
list2, as required by the general contract of Object.HashCode.
return the hash code value for this list.
Returns the index in this list of the first occurrence of the
specified element, or -1 if this list does not contain this
element. More formally, returns the lowest index i such that
(o == Get(i)), or -1 if there is no such index.
element to search for.
the index in this list of the first occurrence of the
specified element, or -1 if this list does not contain
this element.
Returns true if this list Contains no elements.
return true if this list Contains no elements.
Returns the index in this list of the last occurrence of the
specified element, or -1 if this list does not contain this
element. More formally, returns the highest index i such that
(o == Get(i)), or -1 if there is no such index.
element to search for.
return the index in this list of the last occurrence of the
specified element, or -1 if this list does not contain this element.
Removes the element at the specified position in this list.
Shifts any subsequent elements to the left (subtracts one from
their indices). Returns the element that was Removed from the
list.
the index of the element to Removed.
return the element previously at the specified position.
Removes the first occurrence in this list of the specified
element (optional operation). If this list does not contain
the element, it is unChanged. More formally, Removes the
element with the lowest index i such that (o.Equals(get(i)))
(if such an element exists).
element to be Removed from this list, if present.
return true if this list Contained the specified element.
Removes from this list all the elements that are Contained in the specified collection
collection that defines which elements will be removed from this list.
return true if this list Changed as a result of the call.
Retains only the elements in this list that are Contained in
the specified collection. In other words, Removes from this
list all the elements that are not Contained in the specified
collection.
collection that defines which elements this Set will retain.
return true if this list Changed as a result of the call.
Replaces the element at the specified position in this list with the specified element
index of element to Replace.
element to be stored at the specified position.
return the element previously at the specified position.
Returns the number of elements in this list. If this list
Contains more than Int32.MaxValue elements, returns
Int32.MaxValue.
return the number of elements in this shortList
Returns an array Containing all of the elements in this list in
proper sequence. Obeys the general contract of the
Collection.ToArray method.
an array Containing all of the elements in this list in
proper sequence.
Returns an array Containing all of the elements in this list in
proper sequence. Obeys the general contract of the
Collection.ToArray(Object[]) method.
the array into which the elements of this list are to
be stored, if it is big enough; otherwise, a new array
is allocated for this purpose.
return an array Containing the elements of this list.
the number of elements in this shortList
Title: String Utility Description: Collection of string handling utilities
@author Andrew C. Oliver
@author Sergei Kozello (sergeikozello at mail.ru)
@author Toshiaki Kamoshida (kamoshida.toshiaki at future dot co dot jp)
@since May 10, 2002
@version 1.0
Constructor for the StringUtil object
Given a byte array of 16-bit unicode characters in Little Endian
Format (most important byte last), return a Java String representation
of it.
{ 0x16, 0x00 } -0x16
the byte array to be converted
the initial offset into the
byte array. it is assumed that string[ offset ] and string[ offset + 1 ] contain the first 16-bit unicode character
the Length of the string
the converted string
Given a byte array of 16-bit unicode characters in little endian
Format (most important byte last), return a Java String representation
of it.
{ 0x16, 0x00 } -0x16
the byte array to be converted
the converted string
Given a byte array of 16-bit unicode characters in big endian
Format (most important byte first), return a Java String representation
of it.
{ 0x00, 0x16 } -0x16
the byte array to be converted
the initial offset into the
byte array. it is assumed that string[ offset ] and string[ offset + 1 ] contain the first 16-bit unicode character
the Length of the string
the converted string
Given a byte array of 16-bit unicode characters in big endian
Format (most important byte first), return a Java String representation
of it.
{ 0x00, 0x16 } -0x16
the byte array to be converted
the converted string
Read 8 bit data (in IsO-8859-1 codepage) into a (unicode) Java
String and return.
(In Excel terms, read compressed 8 bit unicode as a string)
byte array to read
offset to read byte array
Length to read byte array
generated String instance by reading byte array
Takes a unicode (java) string, and returns it as 8 bit data (in IsO-8859-1
codepage).
(In Excel terms, write compressed 8 bit unicode)
the String containing the data to be written
the byte array to which the data Is to be written
an offset into the byte arrat at which the data Is start when written
Takes a unicode string, and returns it as little endian (most
important byte last) bytes in the supplied byte array.
(In Excel terms, write uncompressed unicode)
the String containing the unicode data to be written
the byte array to hold the uncompressed unicode, should be twice the Length of the String
the offset to start writing into the byte array
Takes a unicode string, and returns it as big endian (most
important byte first) bytes in the supplied byte array.
(In Excel terms, write uncompressed unicode)
the String containing the unicode data to be written
the byte array to hold the uncompressed unicode, should be twice the Length of the String.
the offset to start writing into the byte array
Gets the preferred encoding.
the encoding we want to use, currently hardcoded to IsO-8859-1
check the parameter Has multibyte character
string to check
true if Has at least one multibyte character; otherwise, false.
InputStream in is expected to contain:
- ushort nChars
- byte is16BitFlag
- byte[]/char[] characterData
For this encoding, the is16BitFlag is always present even if nChars==0.
InputStream in is expected to contain:
- byte is16BitFlag
- byte[]/char[] characterData
For this encoding, the is16BitFlag is always present even if nChars==0.
This method should be used when the nChars field is not stored
as a ushort immediately before the is16BitFlag. Otherwise, {@link
#readUnicodeString(LittleEndianInput)} can be used.
OutputStream out will get:
- ushort nChars
- byte is16BitFlag
- byte[]/char[] characterData
For this encoding, the is16BitFlag is always present even if nChars==0.
OutputStream out will get:
- byte is16BitFlag
- byte[]/char[] characterData
For this encoding, the is16BitFlag is always present even if nChars==0.
This method should be used when the nChars field is not stored
as a ushort immediately before the is16BitFlag. Otherwise, {@link
#writeUnicodeString(LittleEndianOutput, String)} can be used.
Gets the number of bytes that would be written by WriteUnicodeString(LittleEndianOutput, String)
The value.
Checks to see if a given String needs to be represented as Unicode
The value.
true if string needs Unicode to be represented.; otherwise, false.
Tony Qu change the logic
Encodes non-US-ASCII characters in a string, good for encoding file names for download
http://www.acriticsreview.com/List.aspx?listid=42
Encodes a non-US-ASCII character.
Encodes a non-US-ASCII character.
Encodes a non-US-ASCII character.
Encodes a non-US-ASCII character.
Determines if the character needs to be encoded.
http://www.acriticsreview.com/List.aspx?listid=42
A logger class that strives to make it as easy as possible for
developers to write log calls, while simultaneously making those
calls as cheap as possible by performing lazy Evaluation of the log
message.
@author Marc Johnson (mjohnson at apache dot org)
@author Glen Stampoultzis (glens at apache.org)
@author Nicola Ken Barozzi (nicolaken at apache.org)
Log a message
One of DEBUG, INFO, WARN, ERROR, FATAL
The object to log.
Log a message
One of DEBUG, INFO, WARN, ERROR, FATAL
The object to log. This is Converted to a string.
An exception to be logged
Check if a logger is enabled to log at the specified level
One of DEBUG, INFO, WARN, ERROR, FATAL
Creates a temporary file. Files are collected into one directory and by default are
deleted on exit from the VM. Files can be kept by defining the system property
poi.keep.tmp.files.
Dont forget to close all files or it might not be possible to delete them.
construct the with its offset into its containing byte array
The offset.
construct the LongField with its offset into its containing
byte array and initialize its value
offset of the field within its byte array
the initial value
Construct the class with its offset into its containing
byte array and initialize its value from its byte array
The offset of the field within its byte array
the byte array to read the value from
construct the class with its offset into its containing
byte array, initialize its value, and write the value to a byte
array
offset of the field within its byte array
the initial value
the byte array to write the value to
set the LongField's current value and write it to a byte array
value to be set
the byte array to write the value to
set the value from its offset into an array of bytes
the byte array from which the value is to be read
set the value from an Stream
the Stream from which the value is to be
write the value out to an array of bytes at the appropriate offset
the array of bytes to which the value is to be written
Returns a that represents the current .
A that represents the current .
Getg or sets the LongField's current value
The current value
The enumeration value indicating the style of fill pattern being used for a cell format.
No background
Solidly Filled
Small fine dots
Wide dots
Sparse dots
Thick horizontal bands
Thick vertical bands
Thick backward facing diagonals
Thick forward facing diagonals
Large spots
Brick-like layout
Thin horizontal bands
Thin vertical bands
Thin backward diagonal
Thin forward diagonal
Squares
Diamonds
Less Dots
Least Dots