[]
        
(Showing Draft Content)

IComments

Interface IComments

All Superinterfaces:
Iterable<IComment>

public interface IComments extends Iterable<IComment>
Represents a collection of cell comments.

Each comment in the collection is represented by an IComment object. Use this interface to access and enumerate the comments in a worksheet.


 worksheet.getRange("B2").addComment("Review this value");
 IComments comments = worksheet.getComments();
 IComment comment = comments.get(0);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    Gets the comment at the specified index.
    int
    Returns the number of comment objects in the collection.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • get

      IComment get(int index)
      Gets the comment at the specified index.

      Use this method to retrieve an IComment object from this IComments collection, such as the collection returned by IWorksheet.getComments().

      
       worksheet.getRange("B2").addComment("Review this value");
       IComments comments = worksheet.getComments();
       IComment comment = comments.get(0);
       
      Parameters:
      index - The zero-based index of the comment in the collection.
      Returns:
      The IComment object at the specified index. Returns null if the index is less than 0 or greater than or equal to getCount().
    • getCount

      int getCount()
      Returns the number of comment objects in the collection.

      This value indicates how many IComment objects are contained in this IComments collection, such as the collection returned by IWorksheet.getComments().

      
       worksheet.getRange("A1").addComment("Name is required.");
       worksheet.getRange("B2").addComment("Enter a value.");
       IComments comments = worksheet.getComments();
       int count = comments.getCount();
       
      Returns:
      The number of comment objects in the collection.