public final class QualifiedKey extends Object
The QualifiedKey is Qualified:
The mapping can indicate a part of a verse. This is an internal implementation detail of the Versification mapping code. Here it is used to distinguish one QualifiedKey from another in equality tests and in containers.
The GNU Lesser General Public License for details.
The copyright to this program is held by its authors.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
QualifiedKey.Qualifier
A Qualifier indicates whether the verse is numbered the same in both the KJV and the other, is missing in the KJV or the other.
|
Modifier and Type | Field and Description |
---|---|
private QualifiedKey.Qualifier |
absentType |
private VerseKey |
qualifiedKey |
private String |
sectionName |
private VerseKey |
wholeKey |
Modifier | Constructor and Description |
---|---|
|
QualifiedKey()
Constructs the QualifiedKey with the ABSENT_IN_LEFT qualifier.
|
|
QualifiedKey(String sectionName) |
protected |
QualifiedKey(Verse key)
Construct a QualifiedKey from a Verse.
|
|
QualifiedKey(VerseRange key)
Construct a QualifiedKey from a Verse.
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
bothNullOrEqual(Object x,
Object y)
Determine whether two objects are equal, allowing nulls
|
static QualifiedKey |
create(VerseKey k)
Create a QualifiedKey from a Verse or a VerseRange.
|
boolean |
equals(Object obj) |
QualifiedKey.Qualifier |
getAbsentType() |
VerseKey |
getKey() |
String |
getSectionName() |
Verse |
getVerse() |
int |
hashCode() |
boolean |
isWhole()
A QualifiedKey is whole if it does not split part of a reference.
|
QualifiedKey |
reversify(Versification target)
Convert this QualifiedKey from one Versification to another.
|
private void |
setKey(Verse key)
Allow override of the key, particular useful if we're constructing in 2 stages like the offset mechanism
|
private void |
setKey(VerseRange key)
Allow override of the key, particular useful if we're constructing in 2 stages like the offset mechanism
|
String |
toString() |
private VerseKey qualifiedKey
private VerseKey wholeKey
private String sectionName
private QualifiedKey.Qualifier absentType
protected QualifiedKey(Verse key)
key
- the verse from which to create this QualifiedKeypublic QualifiedKey(VerseRange key)
key
- the verse range from which to create this QualifiedKeypublic QualifiedKey(String sectionName)
sectionName
- with a given section name, we assume absent in KJVpublic QualifiedKey()
public static QualifiedKey create(VerseKey k)
k
- the Verse or VerseRangeClassCastException
public VerseKey getKey()
public Verse getVerse()
ClassCastException
public QualifiedKey.Qualifier getAbsentType()
public String getSectionName()
public boolean isWhole()
public QualifiedKey reversify(Versification target)
target
- The target versificationprivate void setKey(Verse key)
key
- the new keyprivate void setKey(VerseRange key)
key
- the new key