Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.jsword.versification
Class OSISNames

    java.lang.Object
      org.crosswire.jsword.versification.OSISNames

    public final class OSISNames

extends Object

BibleNames is a static class that deals with Book name lookup conversions. We start counting at 1 for books (so Genesis=1, Revelation=66). However internally books start counting at 0 and go up to 65.

Author:
  Joe Walker [joe at eireneh dot com], DM Smith [dmsmith555 at yahoo dot com]
See Also:
  `for license details. The copyright to this program is held by it's authors.`

Field Summary
`(package private) static OSISNames` | `instance` A singleton used to do initialization.
`private static Pattern` | `normPattern` remove spaces and punctuation in Bible Names
`private static String` | `OSIS_KEY`
`private static Locale` | `OSIS_LOCALE` The Locale of OSIS Names
`private static String[]` | `osisBooks` Standard OSIS names for the book of the Bible, in mixed case
`private static Map` | `osisMap` Standard OSIS names for the book of the Bible, in lowercase, generated at runtime

Constructor Summary
`private` | `OSISNames()` Ensure that we can not be instantiated

Method Summary
`static int` | `getBookNumber(String find)` Get number of a book from its name.
`static String` | `getName(int book)` Get the OSIS name for a book.
`private static String` | `getString(ResourceBundle resources, String key)`
`private static void` | `initialize()` Load up the resources for Bible book and section names, and cache the upper and lower versions of them.
`static boolean` | `isBookName(String find)` Is the given string a valid book name.
`private static String` | `normalize(String str)` Normalize by stripping punctuation and whitespace.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### normPattern

    private static Pattern normPattern

  remove spaces and punctuation in Bible Names

### OSIS_LOCALE

    private static final Locale OSIS_LOCALE

  The Locale of OSIS Names

### instance

    static final OSISNames instance

  A singleton used to do initialization. Could be used to change static methods to non-static

### OSIS_KEY

    private static final String OSIS_KEY

See Also:
  Constant Field Values

### osisBooks

    private static String[] osisBooks

  Standard OSIS names for the book of the Bible, in mixed case

### osisMap

    private static Map osisMap

  Standard OSIS names for the book of the Bible, in lowercase, generated at runtime

Constructor Detail

### OSISNames

    private OSISNames()

  Ensure that we can not be instantiated

Method Detail

### getName

    public static String getName(int book)
                          throws NoSuchVerseException

  Get the OSIS name for a book.

  Parameters:
    `book` - The book number (1-66)
  Returns:
    the OSIS defined short name for a book
  Throws:
    `NoSuchVerseException` - If the book number is not valid

### getBookNumber

    public static int getBookNumber(String find)

  Get number of a book from its name.

  Parameters:
    `find` - The string to identify
  Returns:
    The book number (1 to 66) On error -1

### isBookName

    public static boolean isBookName(String find)

  Is the given string a valid book name. If this method returns true then getBookNumber() will return a number and not throw an exception.

  Parameters:
    `find` - The string to identify
  Returns:
    The book number (1 to 66)

### normalize

    private static String normalize(String str)

  Normalize by stripping punctuation and whitespace.

  Parameters:
    `str` - the string to normalize
  Returns:
    the normalized string

### initialize

    private static void initialize()

  Load up the resources for Bible book and section names, and cache the upper and lower versions of them.

### getString

    private static String getString(ResourceBundle resources,
                                    String key)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¨ 2003-2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD