Package org.apache.poi.xssf.model
Interface Comments
- All Known Implementing Classes:
CommentsTable
public interface Comments
An interface exposing useful functions for dealing with Excel Workbook Comments.
It is intended that this interface should support low level access and not expose
all the comments in memory
-
Method Summary
Modifier and TypeMethodDescriptionvoidcommentUpdated(XSSFComment comment) Called after the comment is updated, so that we can reflect that in our cachecreateNewComment(ClientAnchor clientAnchor) Create a new comment and add to the CommentTable.intfindAuthor(String author) findCellComment(CellAddress cellAddress) Finds the cell comment at cellAddress, if one existsgetAuthor(long authorId) Returns all cell addresses that have comments.intintvoidreferenceUpdated(CellAddress oldReference, XSSFComment comment) Called after the reference is updated, so that we can reflect that in our cachebooleanremoveComment(CellAddress cellRef) Remove the comment at cellRef location, if one existsvoidThis method is for internal POI use only.
-
Method Details
-
setSheet
This method is for internal POI use only. POI uses it to link the sheet and comments table. This method will not move comments from one sheet to another (if a user tries to use this method for that purpose).- Parameters:
sheet- the sheet that this comments table is associated with- Since:
- POI 5.2.0
-
getNumberOfComments
int getNumberOfComments() -
getNumberOfAuthors
int getNumberOfAuthors() -
getAuthor
-
findAuthor
-
findCellComment
Finds the cell comment at cellAddress, if one exists- Parameters:
cellAddress- the address of the cell to find a comment- Returns:
- cell comment if one exists, otherwise returns null
-
removeComment
Remove the comment at cellRef location, if one exists- Parameters:
cellRef- the location of the comment to remove- Returns:
- returns true if a comment was removed
-
getCellAddresses
Iterator<CellAddress> getCellAddresses()Returns all cell addresses that have comments.- Returns:
- An iterator to traverse all cell addresses that have comments.
- Since:
- 4.0.0
-
createNewComment
Create a new comment and add to the CommentTable.- Parameters:
clientAnchor- the anchor for this comment- Returns:
- new XSSFComment
- Since:
- POI 5.2.0
-
referenceUpdated
Called after the reference is updated, so that we can reflect that in our cache- Parameters:
oldReference- the comment to remove from the commentRefs mapcomment- the comment to replace in the commentRefs map- Since:
- POI 5.2.0
- See Also:
-
commentUpdated
Called after the comment is updated, so that we can reflect that in our cache- Parameters:
comment- the comment to replace in the commentRefs map- Since:
- POI 5.2.0
- See Also:
-