Top Description Inners Fields Constructors Methods
org.apache.poi.ss.util.cellwalk

public Class CellWalk

extends Object
Class Inheritance
Imports
org.apache.poi.ss.usermodel.Cell, .CellType, .Row, .Sheet, org.apache.poi.ss.util.CellRangeAddress

Traverse cell range.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
CellWalk.SimpleCellWalkContext

Inner class to hold walk context.

Field Summary

Modifier and TypeField and Description
private final CellRangeAddress
private final Sheet
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
isEmpty(Cell cell)

public boolean

Returns:

true if handler should be called on empty (blank) cells, false otherwise.
isTraverseEmptyCells
()

Should we call handler on empty (blank) cells.

public void
setTraverseEmptyCells(boolean
new property value
traverseEmptyCells
)

Sets the traverseEmptyCells property.

public void
traverse(CellHandler
handler to call on each appropriate cell
handler
)

Traverse cell range from top left to bottom right cell.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rangeback to summary
private final CellRangeAddress range
sheetback to summary
private final Sheet sheet
traverseEmptyCellsback to summary
private boolean traverseEmptyCells

Constructor Detail

CellWalkback to summary
public CellWalk(Sheet sheet, CellRangeAddress range)

Method Detail

isEmptyback to summary
private boolean isEmpty(Cell cell)
isTraverseEmptyCellsback to summary
public boolean isTraverseEmptyCells()

Should we call handler on empty (blank) cells. Default is false.

Returns:boolean

true if handler should be called on empty (blank) cells, false otherwise.

setTraverseEmptyCellsback to summary
public void setTraverseEmptyCells(boolean traverseEmptyCells)

Sets the traverseEmptyCells property.

Parameters
traverseEmptyCells:boolean

new property value

traverseback to summary
public void traverse(CellHandler handler)

Traverse cell range from top left to bottom right cell.

Parameters
handler:CellHandler

handler to call on each appropriate cell

org.apache.poi.ss.util.cellwalk back to summary

private Class CellWalk.SimpleCellWalkContext

extends Object
implements CellWalkContext
Class Inheritance
  • java.lang.Object
  • org.apache.poi.ss.util.cellwalk.CellWalk.SimpleCellWalkContext
All Implemented Interfaces
org.apache.poi.ss.util.cellwalk.CellWalkContext

Inner class to hold walk context.

Field Summary

Modifier and TypeField and Description
private int
private long
private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
public long
getOrdinalNumber()

Implements org.apache.poi.ss.util.cellwalk.CellWalkContext.getOrdinalNumber.

Returns ordinal number of cell in range.

public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colNumberback to summary
private int colNumber
ordinalNumberback to summary
private long ordinalNumber
rowNumberback to summary
private int rowNumber

Constructor Detail

SimpleCellWalkContextback to summary
private SimpleCellWalkContext()

Method Detail

getColumnNumberback to summary
public int getColumnNumber()

Implements org.apache.poi.ss.util.cellwalk.CellWalkContext.getColumnNumber.

Doc from org.apache.poi.ss.util.cellwalk.CellWalkContext.getColumnNumber.

Returns number of current column.

Returns:int

number of current column

Annotations
@Override
getOrdinalNumberback to summary
public long getOrdinalNumber()

Implements org.apache.poi.ss.util.cellwalk.CellWalkContext.getOrdinalNumber.

Doc from org.apache.poi.ss.util.cellwalk.CellWalkContext.getOrdinalNumber.

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 its ordinal number):

ordinal number example
12
34
Returns:long

ordinal number of current cell

Annotations
@Override
getRowNumberback to summary
public int getRowNumber()

Implements org.apache.poi.ss.util.cellwalk.CellWalkContext.getRowNumber.

Doc from org.apache.poi.ss.util.cellwalk.CellWalkContext.getRowNumber.

Returns number of current row.

Returns:int

number of current row

Annotations
@Override