[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

ICommentsThreaded

Interface ICommentsThreaded

All Superinterfaces:
Iterable<ICommentThreaded>

public interface ICommentsThreaded extends Iterable<ICommentThreaded>
表示工作表中顶级线程式批注对象的集合,或单个线程式批注中的回复集合。

每个线程式批注都由 ICommentThreaded 对象表示。使用 IWorksheet.getCommentsThreaded() 可以访问工作表中的所有线程式批注,或使用 ICommentThreaded.getReplies() 访问特定线程式批注的回复。


 ICommentThreaded comment = worksheet.getRange("C3").addCommentThreaded("Check the sales total.", "Nancy");
 comment.addReply("I updated the number.", "Bill");
 
 ICommentsThreaded commentsThreaded = worksheet.getCommentsThreaded();
 ICommentsThreaded replies = comment.getReplies();
 ICommentThreaded firstReply = replies.get(0);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    获取指定索引处的线程式批注。
    int
    获取集合中的线程式批注数量。

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • get

      ICommentThreaded get(int index)
      获取指定索引处的线程式批注。

      此集合可以表示工作表中的所有顶级线程式批注,也可以表示单个 ICommentThreaded 的回复。

      
       ICommentThreaded comment = worksheet.getRange("C3").addCommentThreaded("Check the sales total.", "Nancy");
       comment.addReply("I updated the number.", "Bill");
       ICommentsThreaded replies = comment.getReplies();
       ICommentThreaded firstReply = replies.get(0);
       
      Parameters:
      index - 线程式批注在集合中的从零开始的索引。
      Returns:
      指定索引处的 ICommentThreaded 对象。
    • getCount

      int getCount()
      获取集合中的线程式批注数量。

      此集合可以表示工作表中的所有顶级线程式批注,也可以表示单个 ICommentThreaded 的回复。返回的值反映当前集合中的项数。

      
       ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
       comment.addReply("I updated the number.", "Jamie");
       ICommentsThreaded replies = comment.getReplies();
       int count = replies.getCount();
       
      Returns:
      集合中的线程式批注数量。