org.eclipse.wst.common.componentcore.resources
Class ComponentHandle

java.lang.Object
  extended byorg.eclipse.wst.common.componentcore.resources.ComponentHandle

public class ComponentHandle
extends java.lang.Object

Provides a handle to a component within a project.

This class provides a way to access ArtifactEdit instances. The component referenced by its handle may not exist.

The following class is not intended to be extended.

Since:
1.0

Method Summary
static ComponentHandle create(IProject aProject, java.lang.String aComponentName)
          Creates a component handle that indicates a component with the name aComponentName contained by the project aProject.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
          The name of the component.
 IProject getProject()
          A handle to a valid, accessible project.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
The name of the component.

Returns:
The name of the component

getProject

public IProject getProject()
A handle to a valid, accessible project.

Returns:
The project that contains the component

create

public static ComponentHandle create(IProject aProject,
                                     java.lang.String aComponentName)
Creates a component handle that indicates a component with the name aComponentName contained by the project aProject.

Parameters:
aProject - The project that will contain the component
aComponentName - The name of the component
Returns:
A ComponentHandle that references the component indicated by the project and component name.

toString

public java.lang.String toString()
Returns:
A string representation of the form [projectpath]:componentName

hashCode

public int hashCode()
Returns:
A hashCode derived from the string representation

equals

public boolean equals(java.lang.Object obj)
Parameters:
obj - Another object to compare for equality.
Returns:
true if obj instanceof ComponentHandle && this.project == obj.project && this.name == obj.name