public class Block
extends java.lang.Object
Block
object represents a rectangular block of
Cells
.Modifier and Type | Class | Description |
---|---|---|
static class |
Block.Direction |
Possible directionalities of the
Block . |
Constructor | Description |
---|---|
Block(Block parent,
int left,
int right,
int top,
int bottom) |
Construct a
Block at the given boundary column and row
numbers. |
Block(Block parent,
int left,
int right,
int top,
int bottom,
int iterationNbr) |
Construct a
Block at the given boundary column and row
numbers, with a 0-based iteration number. |
Block(Block parent,
org.apache.poi.ss.usermodel.Cell tag) |
Construct a
Block that coincides with the given
Cell . |
Block(Block parent,
org.apache.poi.ss.usermodel.Cell startTag,
org.apache.poi.ss.usermodel.Cell endTag) |
Construct a
Block that lies in between the given start and
end tags. |
Modifier and Type | Method | Description |
---|---|---|
void |
collapse() |
Collapses the block to zero size in columns and rows.
|
void |
expand(int cols,
int rows) |
Expands the block the given number of columns and rows.
|
int |
getBottomRowNum() |
Returns the bottom row number (0-based).
|
Block.Direction |
getDirection() |
Returns the specific
Direction of this Block . |
int |
getIterationNbr() |
Returns this
Block's iteration number, which is non-zero
only for blocks copied for processing a looping tag. |
int |
getLeftColNum() |
Returns the left column number (0-based).
|
Block |
getParent() |
Returns this
Block's parent Block . |
int |
getRightColNum() |
Returns the right column number (0-based).
|
int |
getTopRowNum() |
Returns the top row number (0-based).
|
void |
reactToGrowth(Block sibling,
int colGrowth,
int rowGrowth) |
When this
Block is a copy, it may have to react to "sibling"
Blocks when the "sibling" is processed first and it grows or
shrinks during processing. |
void |
setDirection(Block.Direction dir) |
Sets the specific
Direction of this Block . |
java.lang.String |
toString() |
Returns a
String representation of this Block . |
void |
translate(int cols,
int rows) |
Translates the block the given number of columns and rows.
|
public Block(Block parent, org.apache.poi.ss.usermodel.Cell startTag, org.apache.poi.ss.usermodel.Cell endTag)
Block
that lies in between the given start and
end tags.parent
- The Block's
parent.startTag
- The Cell
containing the start tag.endTag
- The Cell
containing the end tag.public Block(Block parent, org.apache.poi.ss.usermodel.Cell tag)
Block
that coincides with the given
Cell
. This is used for bodiless tags.parent
- The Block's
parent.tag
- The Cell
containing the bodiless tag.public Block(Block parent, int left, int right, int top, int bottom)
Block
at the given boundary column and row
numbers.parent
- The Block's
parent.left
- The left-most column number (0-based).right
- The right-most column index (0-based).top
- The top-most row number (0-based).bottom
- The bottom-most row number (0-based).public Block(Block parent, int left, int right, int top, int bottom, int iterationNbr)
Block
at the given boundary column and row
numbers, with a 0-based iteration number.parent
- The Block's
parent.left
- The left-most column number (0-based).right
- The right-most column index (0-based).top
- The top-most row number (0-based).bottom
- The bottom-most row number (0-based).iterationNbr
- The 0-based iteration number, which will be non-zero
only if created as part of processing a looping tag.public int getLeftColNum()
public int getRightColNum()
public int getTopRowNum()
public int getBottomRowNum()
public Block.Direction getDirection()
Direction
of this Block
.Block
.Block.Direction
public void setDirection(Block.Direction dir)
Direction
of this Block
.dir
- An enumerated type that determines the directionality of this
Block
.Block.Direction
public void translate(int cols, int rows)
cols
- The number of columns to move the block (can be negative).rows
- The number of rows to move the block (can be negative).public void expand(int cols, int rows)
cols
- The number of columns to expand the block (can be negative).rows
- The number of rows to expand the block (can be negative).public void collapse()
public java.lang.String toString()
String
representation of this Block
.toString
in class java.lang.Object
String
representation of this Block
.public Block getParent()
Block's
parent Block
.Block's
parent Block
.public int getIterationNbr()
Block's
iteration number, which is non-zero
only for blocks copied for processing a looping tag.public void reactToGrowth(Block sibling, int colGrowth, int rowGrowth)
Block
is a copy, it may have to react to "sibling"
Blocks
when the "sibling" is processed first and it grows or
shrinks during processing. Here are the cases:
Block
.
Block
. Expand downward to match the
sibling's row growth.
sibling
- The sibling Block
that grew or shrank.colGrowth
- The number of columns the sibling Block
grew (or shrank if negative).rowGrowth
- The number of rows the sibling Block
grew
(or shrank if negative).Copyright © 2012–2018 Jett Team. All rights reserved.