当前位置: 首页>>代码示例>>Java>>正文


Java JavaElement.JEM_COMPILATIONUNIT属性代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.core.JavaElement.JEM_COMPILATIONUNIT属性的典型用法代码示例。如果您正苦于以下问题:Java JavaElement.JEM_COMPILATIONUNIT属性的具体用法?Java JavaElement.JEM_COMPILATIONUNIT怎么用?Java JavaElement.JEM_COMPILATIONUNIT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jdt.internal.core.JavaElement的用法示例。


在下文中一共展示了JavaElement.JEM_COMPILATIONUNIT属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: nextToken

public String nextToken() {
	int start = this.index;
	StringBuffer buffer = null;
	switch (this.memento[this.index++]) {
		case JavaElement.JEM_ESCAPE:
			buffer = new StringBuffer();
			buffer.append(this.memento[this.index]);
			start = ++this.index;
			break;
		case JavaElement.JEM_COUNT:
			return COUNT;
		case JavaElement.JEM_JAVAPROJECT:
			return JAVAPROJECT;
		case JavaElement.JEM_PACKAGEFRAGMENTROOT:
			return PACKAGEFRAGMENTROOT;
		case JavaElement.JEM_PACKAGEFRAGMENT:
			return PACKAGEFRAGMENT;
		case JavaElement.JEM_FIELD:
			return FIELD;
		case JavaElement.JEM_METHOD:
			return METHOD;
		case JavaElement.JEM_INITIALIZER:
			return INITIALIZER;
		case JavaElement.JEM_COMPILATIONUNIT:
			return COMPILATIONUNIT;
		case JavaElement.JEM_CLASSFILE:
			return CLASSFILE;
		case JavaElement.JEM_TYPE:
			return TYPE;
		case JavaElement.JEM_PACKAGEDECLARATION:
			return PACKAGEDECLARATION;
		case JavaElement.JEM_IMPORTDECLARATION:
			return IMPORTDECLARATION;
		case JavaElement.JEM_LOCALVARIABLE:
			return LOCALVARIABLE;
		case JavaElement.JEM_TYPE_PARAMETER:
			return TYPE_PARAMETER;
		case JavaElement.JEM_ANNOTATION:
			return ANNOTATION;
	}
	loop: while (this.index < this.length) {
		switch (this.memento[this.index]) {
			case JavaElement.JEM_ESCAPE:
				if (buffer == null) buffer = new StringBuffer();
				buffer.append(this.memento, start, this.index - start);
				start = ++this.index;
				break;
			case JavaElement.JEM_COUNT:
			case JavaElement.JEM_JAVAPROJECT:
			case JavaElement.JEM_PACKAGEFRAGMENTROOT:
			case JavaElement.JEM_PACKAGEFRAGMENT:
			case JavaElement.JEM_FIELD:
			case JavaElement.JEM_METHOD:
			case JavaElement.JEM_INITIALIZER:
			case JavaElement.JEM_COMPILATIONUNIT:
			case JavaElement.JEM_CLASSFILE:
			case JavaElement.JEM_TYPE:
			case JavaElement.JEM_PACKAGEDECLARATION:
			case JavaElement.JEM_IMPORTDECLARATION:
			case JavaElement.JEM_LOCALVARIABLE:
			case JavaElement.JEM_TYPE_PARAMETER:
			case JavaElement.JEM_ANNOTATION:
				break loop;
		}
		this.index++;
	}
	if (buffer != null) {
		buffer.append(this.memento, start, this.index - start);
		return buffer.toString();
	} else {
		return new String(this.memento, start, this.index - start);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:73,代码来源:MementoTokenizer.java


注:本文中的org.eclipse.jdt.internal.core.JavaElement.JEM_COMPILATIONUNIT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。