コード例 #1
0
 @SuppressWarnings({"MethodWithMultipleLoops"})
 public boolean hasChanges() {
   if (commentsMap.isEmpty()) return false;
   for (List<Comment> commentList : commentsMap.values()) {
     for (Comment comment : commentList) {
       if (comment.isNew()) return true;
     }
   }
   return false;
 }
コード例 #2
0
 @SuppressWarnings({"MethodWithMultipleLoops"})
 public String toString() {
   StringBuffer sb = new StringBuffer();
   sb.append('{');
   boolean first = true;
   for (Map.Entry<RelativePosition, List<Comment>> entry : commentsMap.entrySet()) {
     if (!first) {
       sb.append(", ");
       first = false;
     }
     sb.append("[").append(entry.getKey()).append(" -> ");
     for (Comment comment : entry.getValue()) {
       sb.append(',').append(comment.getText());
     }
     sb.append("]");
   }
   sb.append('}');
   return sb.toString();
 }
コード例 #3
0
 /** Add the specified comment string to the list of trailing comments. */
 public void addTrailingComment(String s) {
   addTrailingComment(Comment.create(s));
 }
コード例 #4
0
 /** Add the specified comment string to the list of preceding comments. */
 public void addPrecedingComment(String s) {
   addPrecedingComment(Comment.create(s));
 }