KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > SourceRefElementInfo


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.core;
12
13 import org.eclipse.jdt.core.ISourceRange;
14
15 /**
16  * Element info for ISourceReference elements.
17  */

18 /* package */ class SourceRefElementInfo extends JavaElementInfo {
19     protected int fSourceRangeStart, fSourceRangeEnd;
20 /**
21  * @see org.eclipse.jdt.internal.compiler.env.ISourceType#getDeclarationSourceEnd()
22  * @see org.eclipse.jdt.internal.compiler.env.ISourceMethod#getDeclarationSourceEnd()
23  * @see org.eclipse.jdt.internal.compiler.env.ISourceField#getDeclarationSourceEnd()
24  */

25 public int getDeclarationSourceEnd() {
26     return fSourceRangeEnd;
27 }
28 /**
29  * @see org.eclipse.jdt.internal.compiler.env.ISourceType#getDeclarationSourceStart()
30  * @see org.eclipse.jdt.internal.compiler.env.ISourceMethod#getDeclarationSourceStart()
31  * @see org.eclipse.jdt.internal.compiler.env.ISourceField#getDeclarationSourceStart()
32  */

33 public int getDeclarationSourceStart() {
34     return fSourceRangeStart;
35 }
36 protected ISourceRange getSourceRange() {
37     return new SourceRange(fSourceRangeStart, fSourceRangeEnd - fSourceRangeStart + 1);
38 }
39 protected void setSourceRangeEnd(int end) {
40     fSourceRangeEnd = end;
41 }
42 protected void setSourceRangeStart(int start) {
43     fSourceRangeStart = start;
44 }
45 }
46
Popular Tags