Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: ce69c1562d9ff440375b37a7037e3e2ce313ac1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik  
 * Rapperswil, University of applied sciences and others
 *
 * This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License 2.0 
 * which accompanies this distribution, and is available at 
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0  
 *  
 * Contributors: 
 *     Institute for Software - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.internal.core.dom.rewrite.commenthandler;

import java.util.List;

import org.eclipse.cdt.core.dom.ast.IASTComment;

/**
 * The CommentHandler is initialized with all the comment which should be processed.
 * During the process of comment assignment this comment collection is work through one
 * after another until no more comments are left.
 * 
 * @author Guido Zgraggen IFS
 */
public class CommentHandler {
	private final List<IASTComment> comments;
	
	public CommentHandler(List<IASTComment> comments) {
		super();
		this.comments = comments;
	}

	public void allreadyAdded(IASTComment com) {
		comments.remove(com);
	}

	public boolean hasMore() {
		return !comments.isEmpty();
	}

	public IASTComment getFirst() {
		return comments.get(0);
	}
}

Back to the top