[]
集合中的每个注释都由 IComment 对象表示。使用此接口可以访问和枚举工作表中的注释。
worksheet.getRange("B2").addComment("Review this value");
IComments comments = worksheet.getComments();
IComment comment = comments.get(0);
forEach, iterator, spliterator使用此方法可以从此 IComments 集合(例如 IWorksheet.getComments() 返回的集合)中检索 IComment 对象。
worksheet.getRange("B2").addComment("Review this value");
IComments comments = worksheet.getComments();
IComment comment = comments.get(0);
index - 注释在集合中的从零开始的索引。IComment 对象。如果索引小于 0 或大于等于 getCount(),则返回 null。此值表示此 IComments 集合中包含多少个 IComment 对象,例如 IWorksheet.getComments() 返回的集合。
worksheet.getRange("A1").addComment("Name is required.");
worksheet.getRange("B2").addComment("Enter a value.");
IComments comments = worksheet.getComments();
int count = comments.getCount();