本文整理了Java中org.apache.poi.hssf.usermodel.HSSFSheet.findCellCommentLocations()
方法的一些代码示例,展示了HSSFSheet.findCellCommentLocations()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFSheet.findCellCommentLocations()
方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFSheet
类名称:HSSFSheet
方法名:findCellCommentLocations
[英]Finds all cell comments in this sheet and adds them to the specified locations map
[中]查找此工作表中的所有单元格注释,并将其添加到指定的位置映射中
代码示例来源:origin: org.apache.poi/poi
/**
* Returns all cell comments on this sheet.
* @return A map of each Comment in the sheet, keyed on the cell address where
* the comment is located.
*/
@Override
public Map<CellAddress, HSSFComment> getCellComments() {
HSSFPatriarch patriarch = getDrawingPatriarch();
if (null == patriarch) {
patriarch = createDrawingPatriarch();
}
Map<CellAddress, HSSFComment> locations = new TreeMap<>();
findCellCommentLocations(patriarch, locations);
return locations;
}
/**
代码示例来源:origin: org.apache.poi/poi
/**
* Finds all cell comments in this sheet and adds them to the specified locations map
*
* @param container a container that may contain HSSFComments
* @param locations the map to store the HSSFComments in
*/
private void findCellCommentLocations(HSSFShapeContainer container, Map<CellAddress, HSSFComment> locations) {
for (Object object : container.getChildren()) {
HSSFShape shape = (HSSFShape) object;
if (shape instanceof HSSFShapeGroup) {
findCellCommentLocations((HSSFShapeGroup) shape, locations);
continue;
}
if (shape instanceof HSSFComment) {
HSSFComment comment = (HSSFComment) shape;
if (comment.hasPosition()) {
locations.put(new CellAddress(comment.getRow(), comment.getColumn()), comment);
}
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* Returns all cell comments on this sheet.
* @return A map of each Comment in the sheet, keyed on the cell address where
* the comment is located.
*/
@Override
public Map<CellAddress, HSSFComment> getCellComments() {
HSSFPatriarch patriarch = getDrawingPatriarch();
if (null == patriarch) {
patriarch = createDrawingPatriarch();
}
Map<CellAddress, HSSFComment> locations = new TreeMap<>();
findCellCommentLocations(patriarch, locations);
return locations;
}
/**
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* Finds all cell comments in this sheet and adds them to the specified locations map
*
* @param container a container that may contain HSSFComments
* @param locations the map to store the HSSFComments in
*/
private void findCellCommentLocations(HSSFShapeContainer container, Map<CellAddress, HSSFComment> locations) {
for (Object object : container.getChildren()) {
HSSFShape shape = (HSSFShape) object;
if (shape instanceof HSSFShapeGroup) {
findCellCommentLocations((HSSFShapeGroup) shape, locations);
continue;
}
if (shape instanceof HSSFComment) {
HSSFComment comment = (HSSFComment) shape;
if (comment.hasPosition()) {
locations.put(new CellAddress(comment.getRow(), comment.getColumn()), comment);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!