KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > compiler > lookup > ProblemReferenceBinding


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.compiler.lookup;
12
13 public class ProblemReferenceBinding extends ReferenceBinding {
14     private ReferenceBinding closestMatch;
15     private int problemReason;
16     
17 // NOTE: must only answer the subset of the name related to the problem
18

19 public ProblemReferenceBinding(char[][] compoundName, ReferenceBinding closestMatch, int problemReason) {
20     this.compoundName = compoundName;
21     this.closestMatch = closestMatch;
22     this.problemReason = problemReason;
23 }
24 public ProblemReferenceBinding(char[] name, ReferenceBinding closestMatch, int problemReason) {
25     this(new char[][] {name}, closestMatch, problemReason);
26 }
27
28 /**
29  * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#closestMatch()
30  */

31 public ReferenceBinding closestMatch() {
32     return this.closestMatch;
33 }
34
35 /* API
36 * Answer the problem id associated with the receiver.
37 * NoError if the receiver is a valid binding.
38 */

39 public int problemId() {
40     return this.problemReason;
41 }
42
43 /**
44  * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#shortReadableName()
45  */

46 public char[] shortReadableName() {
47     return readableName();
48 }
49
50 }
51
Popular Tags