|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.versification.BookName
public final class BookName
BookName represents the different ways a book of the bible is named.
The GNU Lesser General Public License for details.
Field Summary | |
---|---|
private String[] |
alternateNames
|
private BibleBook |
book
|
private static CaseType |
bookCase
How the book names are reported. |
private static boolean |
fullBookName
Whether long or short, full or abbreviated names are used. |
private Locale |
locale
The locale for the Book Name |
private String |
longName
|
private String |
normalizedLongName
|
private String |
normalizedShortName
|
private static Pattern |
normPattern
remove spaces and some punctuation in Book Name (make sure , is allowed) |
private String |
shortName
|
Constructor Summary | |
---|---|
BookName(Locale locale,
BibleBook book,
String longName,
String shortName,
String alternateNames)
Create a BookName for a Book of the Bible in a given language. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
BibleBook |
getBook()
Get the BibleBook to which this set of names is tied. |
static int |
getCase()
This is only used by config |
static CaseType |
getDefaultCase()
How do we report the names of the books?. |
String |
getLongName()
Get the full name of a book (e.g. |
String |
getNormalizedLongName()
|
String |
getNormalizedShortName()
|
String |
getPreferredName()
Get the preferred name of a book. |
String |
getShortName()
Get the short name of a book (e.g. |
int |
hashCode()
|
static boolean |
isFullBookName()
This is only used by config |
boolean |
match(String normalizedName)
Match the normalized name as closely as possible. |
static String |
normalize(String str,
Locale locale)
Normalize by stripping punctuation and whitespace and lowercasing. |
static void |
setCase(CaseType newBookCase)
How do we report the names of the books?. |
static void |
setCase(int bookCase)
This is only used by config. |
static void |
setFullBookName(boolean fullName)
Set whether the name should be full or abbreviated, long or short. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static Pattern normPattern
private BibleBook book
private String longName
private String normalizedLongName
private String shortName
private String normalizedShortName
private String[] alternateNames
private Locale locale
private static CaseType bookCase
private static boolean fullBookName
Constructor Detail |
---|
public BookName(Locale locale, BibleBook book, String longName, String shortName, String alternateNames)
locale
- the language of this BookNamebook
- the Book's canonical numberlongName
- the Book's long nameshortName
- the Book's short name, if anyalternateNames
- optional comma separated list of alternates for the BookMethod Detail |
---|
public BibleBook getBook()
public String getPreferredName()
public String getLongName()
public String getShortName()
public String getNormalizedLongName()
public String getNormalizedShortName()
public boolean match(String normalizedName)
normalizedName
- the already normalized name to match against.
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public static String normalize(String str, Locale locale)
str
- the string to normalize
public static void setCase(int bookCase)
bookCase
- The new case to use for reporting book names
IllegalArgumentException
- If the case is not between 0 and 2getCase()
public static int getCase()
setCase(CaseType)
public static void setCase(CaseType newBookCase)
newBookCase
- The new case to use for reporting book names
IllegalArgumentException
- If the case is not between 0 and 2getCase()
public static boolean isFullBookName()
setFullBookName(boolean)
public static void setFullBookName(boolean fullName)
fullName
- The new case to use for reporting book namesisFullBookName()
public static CaseType getDefaultCase()
setCase(int)
|
Copyright ยจ 2003-2015 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |