Skip to main content
summaryrefslogblamecommitdiffstats
blob: 852058220b8c2bdffafa1c9195fd3597f4296cd2 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                       
                                                    








                                                              
                                              

                                


                                   



                                                                                         
          






                                                                            





                                                           







                                                            





                                              


                                       




                                                                                     
                                                                                        
          
  
package org.eclipse.jdt.internal.core.builder.impl;

/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
import org.eclipse.jdt.internal.core.Assert;
import org.eclipse.jdt.internal.core.builder.IPackage;
import org.eclipse.jdt.internal.core.builder.IType;

/**
 * 
 */
public class NamespaceNode extends AbstractNode {
	protected IPackage fPackage;
	/**
	 * Creates a new namespace node for the given package
	 */
	public NamespaceNode (IPackage pkg) {
		fPackage = pkg;
	}
	public IType[] getTypes(){
		return null;
	}	
	/**
	 * Adds a node that this node depends on.  Backwards link is added automatically
	 */
	public void addDependency(INode nodeThatIDependOn) {
	}
	/**
	 * Returns a copy of this node, without copying dependencies.  Used
	 * by DependencyGraph.copy().
	 */
	public AbstractNode copy() {
		return new NamespaceNode(fPackage);
	}
	/**
	 * Returns the element which this node represents.
	 */
	public Object getElement() {
		return fPackage;
	}
	/**
	 * Returns the number of bytes that this node uses.
	 * For debugging and profiling purposes only.
	 */
	int getFootprint() {
		/* one slot for package */
		return super.getFootprint() + 4;
	}
	/**
	 * Returns what kind of node this is.
	 */
	public int getKind() {
		return NAMESPACE_NODE;
	}
	public IPackage getPackage() {
		return fPackage;
	}
	/**
	 * Prints a string representation of the node.  This method is for debugging
	 * purposes only.
	 */
	public String toString() {
		return "NamespaceNode("/*nonNLS*/ + fPackage.getName() + ")"/*nonNLS*/;
	}
}

Back to the top