| Modifier and Type | Method and Description |
|---|---|
void |
addForwardMapping(int forwardId)
Adds a lookup for the 'forwarded' index to the current highest index value.
|
void |
addMapping(int forwardId)
Adds a lookup for the 'forwarded' index to the current highest index value, and a reverse lookup from this
substitute index back to the original.
|
IdMapping |
build() |
static IdMapping.Builder |
ofCardinality(int cardinality)
Create a
IdMapping where the cardinality is known, to use with
addMapping(int) to simultaneously populate both forwardMapping and reverseMapping. |
static IdMapping.Builder |
ofUnknownCardinality()
Create an
IdMapping where the cardinality is not known up front. |
public static IdMapping.Builder ofCardinality(int cardinality)
IdMapping where the cardinality is known, to use with
addMapping(int) to simultaneously populate both forwardMapping and reverseMapping.public static IdMapping.Builder ofUnknownCardinality()
IdMapping where the cardinality is not known up front. Since cardinality
is unknown, reverseMapping is initialized to an empty array, and addForwardMapping(int) should
be used to build the forwardMapping, when build() is called reverseMapping will be
computed to produce the completed IdMapping. This is less efficient than
ofCardinality(int), so it should be preferred if the value cardinality is in fact knownpublic void addMapping(int forwardId)
reverseMapping is initialized correctly.public void addForwardMapping(int forwardId)
addMapping(int) should be used instead since the
reverseMapping is only computed if knownCardinality is falsepublic IdMapping build()
Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.