Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.jdt.core.dom;
class NodeSearcher extends ASTVisitor {
	public int position;
	NodeSearcher(int position) {
		this. = position;
	}
	public boolean visit(
		ConstructorDeclaration constructorDeclaration,
		ClassScope scope) {
		if (constructorDeclaration.declarationSourceStart <= this.
			&& this. <= constructorDeclaration.declarationSourceEnd) {
				this. = constructorDeclaration;
				return false;
		}
		return true;
	}
	public boolean visit(
		FieldDeclaration fieldDeclaration,
		MethodScope scope) {
			if (fieldDeclaration.declarationSourceStart <= this.
				&& this. <= fieldDeclaration.declarationSourceEnd) {
					this. = fieldDeclaration;
					return false;
			}
			return true;
	}
	public boolean visit(Initializer initializerMethodScope scope) {
		if (initializer.declarationSourceStart <= this.
			&& this. <= initializer.declarationSourceEnd) {
				this. = initializer;
				return false;
		}
		return true;
	}
	public boolean visit(
		TypeDeclaration memberTypeDeclaration,
		ClassScope scope) {
			if (memberTypeDeclaration.declarationSourceStart <= this.
				&& this. <= memberTypeDeclaration.declarationSourceEnd) {
					this. = memberTypeDeclaration;
					return true;
			}
			return false;
	}
	public boolean visit(
		MethodDeclaration methodDeclaration,
		ClassScope scope) {
		if (methodDeclaration.declarationSourceStart <= this.
			&& this. <= methodDeclaration.declarationSourceEnd) {
				this. = methodDeclaration;
				return false;
		}
		return true;
	}
	public boolean visit(
		TypeDeclaration typeDeclaration,
			if (typeDeclaration.declarationSourceStart <= this.
				&& this. <= typeDeclaration.declarationSourceEnd) {
					this. = typeDeclaration;
					return true;
			}
			return false;
	}
New to GrepCode? Check out our FAQ X