Package org.eclipse.emf.cdo.common.revision

# Class CDORevisionCrawler.OutputStreamHandler.IDMapper

java.lang.Object
org.eclipse.emf.cdo.common.revision.CDORevisionCrawler.OutputStreamHandler.IDMapper

Direct Known Subclasses:
  `CDORevisionCrawler.OutputStreamHandler.IDMapper.InMemory`

Enclosing class:
  `CDORevisionCrawler.OutputStreamHandler`

public abstract static class CDORevisionCrawler.OutputStreamHandler.IDMapper extends Object
Abstract ID mapper for mapping real IDs to local IDs.

Author:
  Eike Stepper

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`CDORevisionCrawler.OutputStreamHandler.IDMapper.InMemory`
In-memory implementation of IDMapper.

## Constructor Summary

Constructors
Constructor
Description
`IDMapper()`
Constructs an IDMapper.

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`forEach(Consumer<? super CDOID> realIDConsumer)`
Iterates over all real IDs that have been mapped.
`protected CDOID`
`getNextMappedID()`
Returns the next available local ID.
`abstract CDOID`
`lookup(CDOID realID)`
Looks up the mapped local ID for a real ID.
`CDOID`
`map(CDOID realID)`
Maps a real ID to a new local ID.
`protected abstract void`
`register(CDOID realID, CDOID localID)`
Registers a mapping from real ID to local ID.

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

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

## Constructor Details

### IDMapper

public IDMapper()
Constructs an IDMapper.

## Method Details

### map

public CDOID map(CDOID realID)
Maps a real ID to a new local ID.

Parameters:
  `realID` - the real ID
Returns:
  the mapped local ID

### lookup

public abstract CDOID lookup(CDOID realID)
Looks up the mapped local ID for a real ID.

Parameters:
  `realID` - the real ID
Returns:
  the mapped local ID

### forEach

public abstract void forEach(Consumer<? super CDOID> realIDConsumer)
Iterates over all real IDs that have been mapped.

Parameters:
  `realIDConsumer` - the consumer for real IDs

### register

protected abstract void register(CDOID realID, CDOID localID)
Registers a mapping from real ID to local ID.

Parameters:
  `realID` - the real ID
  `localID` - the local ID

### getNextMappedID

protected CDOID getNextMappedID()
Returns the next available local ID.

Returns:
  the next local ID