A massive organize imports and formatting of the sources using default Eclipse code...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / lookup / ImportBinding.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 import net.sourceforge.phpdt.internal.compiler.ast.ImportReference;
15
16 public class ImportBinding extends Binding {
17         public char[][] compoundName;
18
19         public boolean onDemand;
20
21         public ImportReference reference;
22
23         Binding resolvedImport; // must ensure the import is resolved
24
25         public ImportBinding(char[][] compoundName, boolean isOnDemand,
26                         Binding binding, ImportReference reference) {
27                 this.compoundName = compoundName;
28                 this.onDemand = isOnDemand;
29                 this.resolvedImport = binding;
30                 this.reference = reference;
31         }
32
33         /*
34          * API Answer the receiver's binding type from Binding.BindingID.
35          */
36
37         public final int bindingType() {
38                 return IMPORT;
39         }
40
41         public char[] readableName() {
42                 if (onDemand)
43                         return CharOperation.concat(CharOperation.concatWith(compoundName,
44                                         '.'), ".*".toCharArray()); //$NON-NLS-1$
45                 else
46                         return CharOperation.concatWith(compoundName, '.');
47         }
48
49         public String toString() {
50                 return "include : " + new String(readableName()); //$NON-NLS-1$
51         }
52 }