public class BringToFrontMapper extends Object implements ReferenceMapper
Constructor and Description |
---|
BringToFrontMapper(int packageId,
int[][] mapping,
int[][] rewriters) |
Modifier and Type | Method and Description |
---|---|
static BringToFrontMapper |
construct(int packageId,
Map<Integer,SortedSet<Integer>> idsByType)
Constructs a ReferenceMapper that will reassign ids and adjust offsets such that for each key
in idsByType, the ids in idsByType will be reassigned to the first n ids of that type.
|
int |
map(int id)
Converts an id to its new value under this mapping.
|
void |
rewrite(int type,
IntBuffer buf)
Given an IntBuffer with an entry for every value of the given type, rearranges the entries in
the buffer to match the id reassignment.
|
public BringToFrontMapper(int packageId, int[][] mapping, int[][] rewriters)
public static BringToFrontMapper construct(int packageId, Map<Integer,SortedSet<Integer>> idsByType)
public int map(int id)
ReferenceMapper
map
in interface ReferenceMapper
public void rewrite(int type, IntBuffer buf)
ReferenceMapper
rewrite
in interface ReferenceMapper