Package org.eclipse.cdt.core.browser

# Class TypeReference

java.lang.Object
org.eclipse.cdt.core.browser.TypeReference

All Implemented Interfaces:
  `ITypeReference`

public class TypeReference extends Object implements ITypeReference

Restriction:
  This class is not intended to be subclassed by clients.
Restriction:
  This class is not intended to be instantiated by clients.

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`offsetIsLineNumber`

## Constructor Summary

Constructors
Constructor
Description
`TypeReference(IWorkingCopy workingCopy, org.eclipse.core.resources.IProject project)`
`TypeReference(IWorkingCopy workingCopy, org.eclipse.core.resources.IProject project, int offset, int length)`
`TypeReference(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.IProject project)`
`TypeReference(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.IProject project, int offset, int length)`
`TypeReference(org.eclipse.core.runtime.IPath path, org.eclipse.core.resources.IProject project)`
`TypeReference(org.eclipse.core.runtime.IPath path, org.eclipse.core.resources.IProject project, int offset, int length)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`ICElement[]`
`getCElements()`
Returns the CElements located at the stored offset and length, or `null` if not found.
`int`
`getLength()`
Returns the length.
`org.eclipse.core.runtime.IPath`
`getLocation()`
Returns the absolute path in the local file system to this reference, or null if no path can be determined.
`int`
`getOffset()`
Returns the offset.
`org.eclipse.core.runtime.IPath`
`getPath()`
Returns the full, absolute path of this reference relative to the workspace, or null if no path can be determined.
`org.eclipse.core.resources.IProject`
`getProject()`
Returns the project.
`org.eclipse.core.runtime.IPath`
`getRelativeIncludePath(org.eclipse.core.resources.IProject project)`
Gets the path for this location, relative to one of the given project's include paths.
`org.eclipse.core.runtime.IPath`
`getRelativePath(org.eclipse.core.runtime.IPath relativeToPath)`
Gets the path for this location, relative to the given path.
`org.eclipse.core.resources.IResource`
`getResource()`
Returns the resource.
`ITranslationUnit`
`getTranslationUnit()`
Returns a translation unit for this location.
`IWorkingCopy`
`getWorkingCopy()`
Returns the working copy.
`int`
`hashCode()`
`boolean`
`isLineNumber()`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### offsetIsLineNumber

public boolean offsetIsLineNumber

## Constructor Details

### TypeReference

public TypeReference(org.eclipse.core.runtime.IPath path, org.eclipse.core.resources.IProject project, int offset, int length)

### TypeReference

public TypeReference(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.IProject project, int offset, int length)

### TypeReference

public TypeReference(IWorkingCopy workingCopy, org.eclipse.core.resources.IProject project, int offset, int length)

### TypeReference

public TypeReference(org.eclipse.core.runtime.IPath path, org.eclipse.core.resources.IProject project)

### TypeReference

public TypeReference(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.IProject project)

### TypeReference

public TypeReference(IWorkingCopy workingCopy, org.eclipse.core.resources.IProject project)

## Method Details

### getPath

public org.eclipse.core.runtime.IPath getPath()
Description copied from interface: `ITypeReference`
Returns the full, absolute path of this reference relative to the workspace, or null if no path can be determined.

Specified by:
  `getPath` in interface `ITypeReference`

### getLocation

public org.eclipse.core.runtime.IPath getLocation()
Description copied from interface: `ITypeReference`
Returns the absolute path in the local file system to this reference, or null if no path can be determined.

Specified by:
  `getLocation` in interface `ITypeReference`

### getResource

public org.eclipse.core.resources.IResource getResource()
Description copied from interface: `ITypeReference`
Returns the resource.

Specified by:
  `getResource` in interface `ITypeReference`

### getWorkingCopy

public IWorkingCopy getWorkingCopy()
Description copied from interface: `ITypeReference`
Returns the working copy.

Specified by:
  `getWorkingCopy` in interface `ITypeReference`

### getProject

public org.eclipse.core.resources.IProject getProject()
Description copied from interface: `ITypeReference`
Returns the project.

Specified by:
  `getProject` in interface `ITypeReference`

### getTranslationUnit

public ITranslationUnit getTranslationUnit()
Description copied from interface: `ITypeReference`
Returns a translation unit for this location.

Specified by:
  `getTranslationUnit` in interface `ITypeReference`

### getCElements

public ICElement[] getCElements()
Description copied from interface: `ITypeReference`
Returns the CElements located at the stored offset and length, or `null` if not found.

Specified by:
  `getCElements` in interface `ITypeReference`

### getOffset

public int getOffset()
Description copied from interface: `ITypeReference`
Returns the offset.

Specified by:
  `getOffset` in interface `ITypeReference`

### getLength

public int getLength()
Description copied from interface: `ITypeReference`
Returns the length.

Specified by:
  `getLength` in interface `ITypeReference`

### getRelativeIncludePath

public org.eclipse.core.runtime.IPath getRelativeIncludePath(org.eclipse.core.resources.IProject project)
Description copied from interface: `ITypeReference`
Gets the path for this location, relative to one of the given project's include paths.

Specified by:
  `getRelativeIncludePath` in interface `ITypeReference`
Parameters:
  `project` - the project to use as a reference.
Returns:
  The path to this location, relative to the longest matching include path in the given project.

### getRelativePath

public org.eclipse.core.runtime.IPath getRelativePath(org.eclipse.core.runtime.IPath relativeToPath)
Description copied from interface: `ITypeReference`
Gets the path for this location, relative to the given path.

Specified by:
  `getRelativePath` in interface `ITypeReference`
Parameters:
  `relativeToPath` - the path to use as a reference.
Returns:
  The path to this location, relative to the given path.

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### isLineNumber

public boolean isLineNumber()

Specified by:
  `isLineNumber` in interface `ITypeReference`