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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commentUpdated(XSSFComment comment)
Called after the comment is updated, so that we can reflect that in our cacheXSSFComment
createNewComment(ClientAnchor clientAnchor)
Create a new comment and add to the CommentTable.int
findAuthor(java.lang.String author)
XSSFComment
findCellComment(CellAddress cellAddress)
Finds the cell comment at cellAddress, if one existsjava.lang.String
getAuthor(long authorId)
java.util.Iterator<CellAddress>
getCellAddresses()
Returns all cell addresses that have comments.int
getNumberOfAuthors()
int
getNumberOfComments()
void
referenceUpdated(CellAddress oldReference, XSSFComment comment)
Called after the reference is updated, so that we can reflect that in our cacheboolean
removeComment(CellAddress cellRef)
Remove the comment at cellRef location, if one existsvoid
setSheet(Sheet sheet)
This method is for internal POI use only.
-
-
-
Method Detail
-
setSheet
@Internal void setSheet(Sheet sheet)
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
java.lang.String getAuthor(long authorId)
-
findAuthor
int findAuthor(java.lang.String author)
-
findCellComment
XSSFComment findCellComment(CellAddress cellAddress)
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
boolean removeComment(CellAddress cellRef)
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
java.util.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
XSSFComment createNewComment(ClientAnchor clientAnchor)
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
void referenceUpdated(CellAddress oldReference, XSSFComment comment)
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(XSSFComment)
-
commentUpdated
void commentUpdated(XSSFComment comment)
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:
referenceUpdated(CellAddress, XSSFComment)
-
-