01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.compiler.lookup;
11:
12: public class ProblemReferenceBinding extends ReferenceBinding {
13: private ReferenceBinding closestMatch;
14: private int problemReason;
15:
16: // NOTE: must only answer the subset of the name related to the problem
17:
18: public ProblemReferenceBinding(char[][] compoundName,
19: ReferenceBinding closestMatch, int problemReason) {
20: this .compoundName = compoundName;
21: this .closestMatch = closestMatch;
22: this .problemReason = problemReason;
23: }
24:
25: public ProblemReferenceBinding(char[] name,
26: ReferenceBinding closestMatch, int problemReason) {
27: this (new char[][] { name }, closestMatch, problemReason);
28: }
29:
30: /**
31: * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#closestMatch()
32: */
33: public ReferenceBinding closestMatch() {
34: return this .closestMatch;
35: }
36:
37: /* API
38: * Answer the problem id associated with the receiver.
39: * NoError if the receiver is a valid binding.
40: */
41: public int problemId() {
42: return this .problemReason;
43: }
44:
45: /**
46: * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#shortReadableName()
47: */
48: public char[] shortReadableName() {
49: return readableName();
50: }
51:
52: }
|