Package org.eclipse.emf.compare.ide.ui.internal.logical

# Class EMFResourceMapping

java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.core.resources.mapping.ResourceMapping
org.eclipse.emf.compare.ide.ui.internal.logical.EMFResourceMapping

All Implemented Interfaces:
  `org.eclipse.core.runtime.IAdaptable`

public class EMFResourceMapping extends org.eclipse.core.resources.mapping.ResourceMapping
This will be used to represent an EMF resource's mapping. It will allow us to properly resolve the whole logical model of that EMF resource and return the proper traversal so that 'model-aware' tools can work on the whole logical model instead of considering only single files.

## Constructor Summary

Constructors
Constructor
Description
`EMFResourceMapping(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.mapping.ResourceMappingContext initialContext, SynchronizationModel synchronizationModel, String providerId)`
Instantiates our mapping given its underlying physical `IResource`.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object other)`
`final SynchronizationModel`
`getLatestModel()`
Returns the latest synchronization model built from a call to `getTraversals(ResourceMappingContext, IProgressMonitor)`.
`Object`
`getModelObject()`
`String`
`getModelProviderId()`
`org.eclipse.core.resources.IProject[]`
`getProjects()`
`org.eclipse.core.resources.mapping.ResourceTraversal[]`
`getTraversals(org.eclipse.core.resources.mapping.ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor)`
`int`
`hashCode()`

### Methods inherited from class org.eclipse.core.resources.mapping.ResourceMapping

`accept, contains, findMarkers, getModelProvider`

### Methods inherited from class org.eclipse.core.runtime.PlatformObject

`getAdapter`

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

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

## Constructor Details

### EMFResourceMapping

public EMFResourceMapping(org.eclipse.core.resources.IResource resource, org.eclipse.core.resources.mapping.ResourceMappingContext initialContext, SynchronizationModel synchronizationModel, String providerId)
Instantiates our mapping given its underlying physical `IResource`.

Parameters:
  `resource` - The physical resource of this mapping.
  `initialContext` - The context with which this mapping was initially created.
  `providerId` - The Model provider for which this mapping should be created.
  `traversal` - The pre-computed local traversal composing this resource's logical model.

## Method Details

### getModelObject

public Object getModelObject()

Specified by:
  `getModelObject` in class `org.eclipse.core.resources.mapping.ResourceMapping`
See Also:
  - `ResourceMapping.getModelObject()`

### getModelProviderId

public String getModelProviderId()

Specified by:
  `getModelProviderId` in class `org.eclipse.core.resources.mapping.ResourceMapping`
See Also:
  - `ResourceMapping.getModelProviderId()`

### getTraversals

public org.eclipse.core.resources.mapping.ResourceTraversal[] getTraversals(org.eclipse.core.resources.mapping.ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException

Specified by:
  `getTraversals` in class `org.eclipse.core.resources.mapping.ResourceMapping`
Throws:
  `org.eclipse.core.runtime.CoreException`
See Also:
  - `ResourceMapping.getTraversals(org.eclipse.core.resources.mapping.ResourceMappingContext, org.eclipse.core.runtime.IProgressMonitor)`

### getLatestModel

public final SynchronizationModel getLatestModel()
Returns the latest synchronization model built from a call to `getTraversals(ResourceMappingContext, IProgressMonitor)`.

Note that this will return `null` until `getTraversals(ResourceMappingContext, IProgressMonitor)` has been called at least once.

This internal API is not meant to be used outside of EMF Compare.

Returns:
  The latest synchronization model built from a call to `getTraversals(ResourceMappingContext, IProgressMonitor)`.
Restriction:
  This method is not intended to be referenced by clients.

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `org.eclipse.core.resources.mapping.ResourceMapping`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `org.eclipse.core.resources.mapping.ResourceMapping`

### getProjects

public org.eclipse.core.resources.IProject[] getProjects()

Specified by:
  `getProjects` in class `org.eclipse.core.resources.mapping.ResourceMapping`
See Also:
  - `ResourceMapping.getProjects()`