📄 abstractstartdirective.java
字号:
/**
* Copyright (c) 2003-2005 Craig Setera
* All Rights Reserved.
* Licensed under the Eclipse Public License - v 1.0
* For more information see http://www.eclipse.org/legal/epl-v10.html
*/
package eclipseme.core.internal.preprocessor.directive;
import java.util.ArrayList;
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.dom.Comment;
import eclipseme.core.internal.preprocessor.Directive;
import eclipseme.core.internal.preprocessor.IDirectiveContainer;
/**
* Abstract superclass of directives that start a block.
* <p />
* Copyright (c) 2003-2005 Craig Setera<br>
* All Rights Reserved.<br>
* Licensed under the Eclipse Public License - v 1.0<p/>
* <br>
* $Revision: 1.3 $
* <br>
* $Date: 2006/11/12 01:11:01 $
* <br>
* @author Craig Setera
*/
public abstract class AbstractStartDirective
extends AbstractConditionalDirective
implements IDirectiveContainer
{
protected ArrayList children;
/**
* Construct a new instance.
*
* @param resource
* @param comment
* @param commentText
*/
public AbstractStartDirective(
IResource resource,
Comment comment,
String commentText)
{
super(resource, comment, commentText);
children = new ArrayList();
}
/**
* @see eclipseme.core.internal.preprocessor.Directive#isContainerStart()
*/
public boolean isContainerStart() {
return true;
}
/**
* Add a new child directive.<br/>
* This method will throw an illegal argument exception
* if the child that is being added is not an allowable
* child of this directive.
*
* @param directive
* @throws IllegalArgumentException
*/
public void addChild(Directive directive) throws IllegalArgumentException {
children.add(directive);
}
/**
* Return the children directives of this directive.
*
* @return
*/
public Directive[] getChildren() {
return (Directive[]) children.toArray(new Directive[children.size()]);
}
/**
* Return a boolean indicating whether or not this directive has any
* children.
*
* @return
*/
public boolean hasChildren() {
return children.size() > 0;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -