|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.versification.VersificationsMapper
public final class VersificationsMapper
VersificationMapper maps a Verse or a Passage in one Versification (v11n) to another, using the KJV v11n as an intermediary.
Practically speaking, a Verse in one v11n may map:
The internal details of the mapping can be found in VersificationToKJVMapper.
This transitive relationship is not perfect. It assumes that verses outside of the KJV versification map 1:1 between the source and target Versifications. That it uses the KJV as an intermediary is an implementation detail that may change. Do not rely on it.
The GNU Lesser General Public License for details.
Field Summary | |
---|---|
private static VersificationsMapper |
instance
|
private static Versification |
KJV
|
private static org.slf4j.Logger |
LOGGER
|
private static Map<Versification,VersificationToKJVMapper> |
MAPPERS
|
Constructor Summary | |
---|---|
private |
VersificationsMapper()
Prevent instantiation |
Method Summary | |
---|---|
private void |
ensure(Versification versification)
Reads the mapping from file if it does not exist |
void |
ensureMappingDataLoaded(Versification versification)
Call this to ensure mapping data is loaded (maybe for newly installed books). |
private VerseKey |
getKeyFromQualifiedKeys(Versification versification,
List<QualifiedKey> kjvVerses)
|
private VerseKey |
guessKeyFromKjvVerses(Versification targetVersification,
List<QualifiedKey> kjvVerses)
This is a last attempt at trying to get something, on the basis that something is better than nothing. |
static VersificationsMapper |
instance()
|
Passage |
map(Passage key,
Versification target)
Maps a whole passage, and does so verse by verse. |
VerseKey |
mapVerse(Verse v,
Versification targetVersification)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static volatile VersificationsMapper instance
private static final Versification KJV
private static final Map<Versification,VersificationToKJVMapper> MAPPERS
private static final org.slf4j.Logger LOGGER
Constructor Detail |
---|
private VersificationsMapper()
Method Detail |
---|
public static VersificationsMapper instance()
public Passage map(Passage key, Versification target)
key
- the key if the source versificationtarget
- the target versification
public VerseKey mapVerse(Verse v, Versification targetVersification)
v
- the versetargetVersification
- the final versification that we want
private VerseKey guessKeyFromKjvVerses(Versification targetVersification, List<QualifiedKey> kjvVerses)
targetVersification
- the target versificationkjvVerses
- the verses in the KJV versification.
private VerseKey getKeyFromQualifiedKeys(Versification versification, List<QualifiedKey> kjvVerses)
kjvVerses
- the list of keys
public void ensureMappingDataLoaded(Versification versification)
versification
- the versification we want to load mapping data forprivate void ensure(Versification versification)
versification
- the versification we want to load
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |