Refactory
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / lookup / ProblemBinding.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.lookup;
12
13 import net.sourceforge.phpdt.core.compiler.CharOperation;
14
15 public class ProblemBinding extends Binding {
16         public char[] name;
17
18         public ReferenceBinding searchType;
19
20         private int problemId;
21
22         // NOTE: must only answer the subset of the name related to the problem
23
24         public ProblemBinding(char[][] compoundName, int problemId) {
25                 this(CharOperation.concatWith(compoundName, '.'), problemId);
26         }
27
28         // NOTE: must only answer the subset of the name related to the problem
29
30         public ProblemBinding(char[][] compoundName, ReferenceBinding searchType,
31                         int problemId) {
32                 this(CharOperation.concatWith(compoundName, '.'), searchType, problemId);
33         }
34
35         ProblemBinding(char[] name, int problemId) {
36                 this.name = name;
37                 this.problemId = problemId;
38         }
39
40         ProblemBinding(char[] name, ReferenceBinding searchType, int problemId) {
41                 this(name, problemId);
42                 this.searchType = searchType;
43         }
44
45         /*
46          * API Answer the receiver's binding type from Binding.BindingID.
47          */
48
49         public final int bindingType() {
50                 return VARIABLE | TYPE;
51         }
52
53         /*
54          * API Answer the problem id associated with the receiver. NoError if the
55          * receiver is a valid binding.
56          */
57
58         public final int problemId() {
59                 return problemId;
60         }
61
62         public char[] readableName() {
63                 return name;
64         }
65 }