|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.jsword.passage.Verse
public final class Verse
A Verse is a pointer to a single verse. Externally its unique identifier is
a String of the form "Gen 1:1" Internally we use
( v11n, book, chapter, verse )
A Verse is designed to be immutable. This is a necessary from a collections point of view. A Verse should always be valid, although some versions may not return any text for verses that they consider to be untranslated in some way.
for license details.
The copyright to this program is held by it's authors.
,
Serialized FormField Summary | |
---|---|
private BibleBook |
book
The book of the Bible. |
private int |
chapter
The chapter number |
static Verse |
DEFAULT
The default verse |
private int |
ordinal
The ordinal value for this verse within its versification. |
private String |
originalName
The original string for picky users |
private static long |
serialVersionUID
To make serialization work across new versions |
private static NumberShaper |
shaper
Allow the conversion to and from other number representations. |
private Versification |
v11n
The versification for this verse. |
private int |
verse
The verse number |
static String |
VERSE_OSIS_DELIM
What characters should we use to separate parts of an OSIS verse reference |
static String |
VERSE_PREF_DELIM1
What characters should we use to separate the book from the chapter |
static String |
VERSE_PREF_DELIM2
What characters should we use to separate the chapter from the verse |
Constructor Summary | |
---|---|
Verse()
Deprecated. no replacement |
|
Verse(BibleBook book,
int chapter,
int verse)
Deprecated. Use Verse(Versification, BibleBook, int, int) instead |
|
Verse(BibleBook book,
int chapter,
int verse,
boolean patch_up)
Deprecated. Use Verse(Versification, BibleBook, int, int, boolean) instead. |
|
Verse(int ordinal)
Deprecated. Use Verse(Versification, int) instead. |
|
Verse(String original,
BibleBook book,
int chapter,
int verse)
Deprecated. Use Verse(String, Versification, BibleBook, int, int) instead |
|
Verse(String original,
Versification v11n,
BibleBook book,
int chapter,
int verse)
Create a Verse from book, chapter and verse numbers, throwing up if the specified Verse does not exist. |
|
Verse(Versification v11n,
BibleBook book,
int chapter,
int verse)
Create a Verse from book, chapter and verse numbers, throwing up if the specified Verse does not exist. |
|
Verse(Versification v11n,
BibleBook book,
int chapter,
int verse,
boolean patch_up)
Create a Verse from book, chapter and verse numbers, patching up if the specified verse does not exist. |
|
Verse(Versification v11n,
int ordinal)
Set a Verse using a Verse Ordinal number - WARNING Do not use this method unless you really know the dangers of doing so. |
Method Summary | |
---|---|
Verse |
add(int n)
Deprecated. Use Versification.add(Verse, int) |
void |
addAll(Key key)
Adds the specified element to this set if it is not already present. |
boolean |
adjacentTo(Verse that)
Deprecated. Use Versification.isAdjacentVerse(Verse, Verse) |
void |
blur(int by,
RestrictionType restrict)
Widen the range of the verses/keys in this list. |
boolean |
canHaveChildren()
Returns false if the receiver is a leaf node and can not have children. |
void |
clear()
Removes all of the elements from this set (optional operation). |
Verse |
clone()
This needs to be declared here so that it is visible as a method on a derived Key. |
int |
compareTo(Key obj)
|
boolean |
contains(Key key)
Returns true if this set contains the specified element. |
private String |
doGetName(Verse verseBase)
Compute the verse representation given the context. |
boolean |
equals(Object obj)
This needs to be declared here so that it is visible as a method on a derived Key. |
Key |
get(int index)
Gets a key from a specific point in this list of children. |
BibleBook |
getBook()
Return the book that we refer to |
int |
getCardinality()
Returns the number of elements in this set (its cardinality). |
int |
getChapter()
Return the chapter that we refer to |
int |
getChildCount()
Returns the number of children that this node has. |
String |
getName()
A Human readable version of the Key. |
String |
getName(Key base)
Translate the Key into a human readable string, with the assumption that the specified Key has just been output, so if we are in the same region, we do not need to display the region name, and so on. |
int |
getOrdinal()
Return the ordinal value of the verse in its versification. |
String |
getOsisID()
The OSIS defined id specification for this Key. |
String |
getOsisRef()
The OSIS defined reference specification for this Key. |
Key |
getParent()
All keys have parents unless they are the root of a Key. |
String |
getRootName()
A Human readable version of the Key's top level name. |
int |
getVerse()
Return the verse that we refer to |
Versification |
getVersification()
Return the versification to which this verse belongs. |
int |
hashCode()
This needs to be declared here so that it is visible as a method on a derived Key. |
int |
indexOf(Key that)
Reverse a Key into the position the key holds in the list of children |
boolean |
isEmpty()
Does this Key have 0 members |
boolean |
isEndOfBook()
Deprecated. Use Versification.isEndOfBook(Verse) |
boolean |
isEndOfChapter()
Deprecated. Use Versification.isEndOfChapter(Verse) |
boolean |
isSameBook(Verse that)
Deprecated. Use Versification.isSameBook(Verse,Verse) |
boolean |
isSameChapter(Verse that)
Deprecated. Use Versification.isSameChapter(Verse,Verse) |
boolean |
isStartOfBook()
Deprecated. Use Versification.isStartOfBook(Verse) |
boolean |
isStartOfChapter()
Deprecated. Use Versification.isStartOfChapter(Verse) |
Iterator<Key> |
iterator()
|
static Verse |
max(Verse a,
Verse b)
Deprecated. Use Versification.max(Verse,Verse) |
static Verse |
min(Verse a,
Verse b)
Deprecated. Use Versification.min(Verse,Verse) |
protected static int |
parseInt(String text)
This is simply a convenience function to wrap Integer.parseInt() and give us a reasonable exception on failure. |
private void |
readObject(ObjectInputStream in)
Write out the object to the given ObjectOutputStream |
void |
removeAll(Key key)
Removes the specified elements from this set if it is present. |
void |
retainAll(Key key)
Removes all but the specified element from this set. |
Verse |
subtract(int n)
Deprecated. Use Versification.subtract(Verse, int) |
int |
subtract(Verse start)
Deprecated. Use Versification.distance(Verse, Verse) |
String |
toString()
|
Verse[] |
toVerseArray()
Create an array of Verses |
private void |
writeObject(ObjectOutputStream out)
Write out the object to the given ObjectOutputStream |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String VERSE_OSIS_DELIM
public static final String VERSE_PREF_DELIM1
public static final String VERSE_PREF_DELIM2
public static final Verse DEFAULT
private static NumberShaper shaper
private transient Versification v11n
private int ordinal
private transient BibleBook book
private transient int chapter
private transient int verse
private transient String originalName
private static final long serialVersionUID
Constructor Detail |
---|
@Deprecated public Verse()
@Deprecated Verse(String original, BibleBook book, int chapter, int verse)
Verse(String, Versification, BibleBook, int, int)
instead
original
- The original verse referencebook
- The book number (Genesis = 1)chapter
- The chapter numberverse
- The verse numberVerse(String original, Versification v11n, BibleBook book, int chapter, int verse)
original
- The original verse referencev11n
- The versification to which this verse belongsbook
- The book number (Genesis = 1)chapter
- The chapter numberverse
- The verse number@Deprecated public Verse(BibleBook book, int chapter, int verse)
Verse(Versification, BibleBook, int, int)
instead
book
- The book number (Genesis = 1)chapter
- The chapter numberverse
- The verse numberpublic Verse(Versification v11n, BibleBook book, int chapter, int verse)
v11n
- The versification to which this verse belongsbook
- The book number (Genesis = 1)chapter
- The chapter numberverse
- The verse number@Deprecated public Verse(BibleBook book, int chapter, int verse, boolean patch_up)
Verse(Versification, BibleBook, int, int, boolean)
instead.
The actual value of the boolean is ignored. However for future proofing
you should only use 'true'. Do not use patch_up=false, use
Verse(int, int, int)
This so that we can declare this
constructor to not throw an exception. Is there a better way of doing
this?
book
- The book number (Genesis = 1)chapter
- The chapter numberverse
- The verse numberpatch_up
- True to trigger reference fixingpublic Verse(Versification v11n, BibleBook book, int chapter, int verse, boolean patch_up)
The actual value of the boolean is ignored. However for future proofing
you should only use 'true'. Do not use patch_up=false, use
Verse(int, int, int)
This so that we can declare this
constructor to not throw an exception. Is there a better way of doing
this?
v11n
- The versification to which this verse belongsbook
- The book number (Genesis = 1)chapter
- The chapter numberverse
- The verse numberpatch_up
- True to trigger reference fixing@Deprecated public Verse(int ordinal)
Verse(Versification, int)
instead.
ordinal
- The verse idpublic Verse(Versification v11n, int ordinal)
v11n
- The versification to which this verse belongsordinal
- The verse idMethod Detail |
---|
public String toString()
toString
in class Object
public String getName()
Key
getName
in interface Key
public String getName(Key base)
Key
getName
in interface Key
base
- The key to use to cut down unnecessary output.
public String getRootName()
Key
getRootName
in interface Key
public String getOsisRef()
Key
getOsisRef
in interface Key
public String getOsisID()
Key
getOsisID
in interface Key
public Verse clone()
Key
clone
in interface Key
clone
in class Object
public boolean equals(Object obj)
Key
equals
in interface Key
equals
in class Object
public int hashCode()
Key
hashCode
in interface Key
hashCode
in class Object
public int compareTo(Key obj)
compareTo
in interface Comparable<Key>
@Deprecated public boolean adjacentTo(Verse that)
Versification.isAdjacentVerse(Verse, Verse)
that
- The thing to compare against
@Deprecated public int subtract(Verse start)
Versification.distance(Verse, Verse)
gen12.subtract(gen11) == 1
start
- The Verse to compare this to
@Deprecated public Verse subtract(int n)
Versification.subtract(Verse, int)
n
- The number to count down by
@Deprecated public Verse add(int n)
Versification.add(Verse, int)
n
- the number of verses later than the one we're one
public Versification getVersification()
getVersification
in interface VerseKey
public BibleBook getBook()
public int getChapter()
public int getVerse()
@Deprecated public boolean isStartOfChapter()
Versification.isStartOfChapter(Verse)
@Deprecated public boolean isEndOfChapter()
Versification.isEndOfChapter(Verse)
@Deprecated public boolean isStartOfBook()
Versification.isStartOfBook(Verse)
@Deprecated public boolean isEndOfBook()
Versification.isEndOfBook(Verse)
@Deprecated public boolean isSameChapter(Verse that)
Versification.isSameChapter(Verse,Verse)
that
- The verse to compare to
@Deprecated public boolean isSameBook(Verse that)
Versification.isSameBook(Verse,Verse)
that
- The verse to compare to
public int getOrdinal()
@Deprecated public static Verse max(Verse a, Verse b)
Versification.max(Verse,Verse)
a
- The first verse to compareb
- The second verse to compare
@Deprecated public static Verse min(Verse a, Verse b)
Versification.min(Verse,Verse)
a
- The first verse to compareb
- The second verse to compare
public Verse[] toVerseArray()
public Key getParent()
Key
getParent
in interface Key
private String doGetName(Verse verseBase)
verseBase
- the context or null if there is none
protected static int parseInt(String text) throws NoSuchVerseException
text
- The string to be parsed
NoSuchVerseException
private void writeObject(ObjectOutputStream out) throws IOException
out
- The stream to write our state to
IOException
- if the read failsprivate void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
in
- The stream to read our state from
IOException
- if the read fails
ClassNotFoundException
- If the read data is incorrectpublic boolean canHaveChildren()
Key
canHaveChildren
in interface Key
public int getChildCount()
Key
getChildCount
in interface Key
public int getCardinality()
Key
getCardinality
in interface Key
public boolean isEmpty()
Key
isEmpty
in interface Key
public boolean contains(Key key)
Key
contains
in interface Key
key
- element whose presence in this set is to be tested.
public Iterator<Key> iterator()
iterator
in interface Iterable<Key>
public void addAll(Key key)
Key
addAll
in interface Key
key
- element to be added to this set.public void removeAll(Key key)
Key
removeAll
in interface Key
key
- object to be removed from this set, if present.public void retainAll(Key key)
Key
retainAll
in interface Key
key
- object to be left in this set.public void clear()
Key
clear
in interface Key
public Key get(int index)
Key
get
in interface Key
index
- The index of the Key to retrieve
public int indexOf(Key that)
Key
indexOf
in interface Key
that
- The Key to find
public void blur(int by, RestrictionType restrict)
Key
blur
in interface Key
by
- The number of verses/keys to widen byrestrict
- How should we restrict the blurring?Passage
|
Copyright ? 2003-2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |