/**
* <copyright>
* </copyright>
*
*
*/
package robot.resource.robot.mopp;
public class RobotSyntaxElementDecorator {
/**
* the syntax element to be decorated
*/
private robot.resource.robot.grammar.RobotSyntaxElement decoratedElement;
/**
* an array of child decorators (one decorator per child of the decorated syntax
* element
*/
private RobotSyntaxElementDecorator[] childDecorators;
/**
* a list of the indices that must be printed
*/
private java.util.List<Integer> indicesToPrint = new java.util.ArrayList<Integer>();
public RobotSyntaxElementDecorator(robot.resource.robot.grammar.RobotSyntaxElement decoratedElement, RobotSyntaxElementDecorator[] childDecorators) {
super();
this.decoratedElement = decoratedElement;
this.childDecorators = childDecorators;
}
public void addIndexToPrint(Integer index) {
indicesToPrint.add(index);
}
public robot.resource.robot.grammar.RobotSyntaxElement getDecoratedElement() {
return decoratedElement;
}
public RobotSyntaxElementDecorator[] getChildDecorators() {
return childDecorators;
}
public Integer getNextIndexToPrint() {
if (indicesToPrint.size() == 0) {
return null;
}
return indicesToPrint.remove(0);
}
public String toString() {
return "" + getDecoratedElement();
}
}