KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2004, 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 /**
14  * Handle representing a binary field that is resolved.
15  * The uniqueKey contains the genericSignature of the resolved field. Use BindingKey to decode it.
16  */

17 public class ResolvedBinaryField extends BinaryField {
18     
19     private String JavaDoc uniqueKey;
20     
21     /*
22      * See class comments.
23      */

24     public ResolvedBinaryField(JavaElement parent, String JavaDoc name, String JavaDoc uniqueKey) {
25         super(parent, name);
26         this.uniqueKey = uniqueKey;
27     }
28     
29     /* (non-Javadoc)
30      * @see org.eclipse.jdt.internal.core.BinaryField#getKey()
31      */

32     public String JavaDoc getKey() {
33         return this.uniqueKey;
34     }
35     
36     /* (non-Javadoc)
37      * @see org.eclipse.jdt.core.IField#isResolved()
38      */

39     public boolean isResolved() {
40         return true;
41     }
42
43     /**
44      * @private Debugging purposes
45      */

46     protected void toStringInfo(int tab, StringBuffer JavaDoc buffer, Object JavaDoc info, boolean showResolvedInfo) {
47         super.toStringInfo(tab, buffer, info, showResolvedInfo);
48         if (showResolvedInfo) {
49             buffer.append(" {key="); //$NON-NLS-1$
50
buffer.append(this.uniqueKey);
51             buffer.append("}"); //$NON-NLS-1$
52
}
53     }
54
55     public JavaElement unresolved() {
56         SourceRefElement handle = new BinaryField(this.parent, this.name);
57         handle.occurrenceCount = this.occurrenceCount;
58         return handle;
59     }
60 }
61
Popular Tags