org.jqurantree.orthography
Class Location

java.lang.Object
  extended by org.jqurantree.orthography.Location

public class Location
extends java.lang.Object

The location of an element in the orthography model, consisting of a chapter number, verse number and token number. A 1-based numbering scheme is used, so that the first chapter, first verse or first token will have number 1. Each element in the orthography model has a getLocation() accessor which returns a Location object that specifies the current location.

Author:
Kais Dukes

Constructor Summary
Location(int chapterNumber)
          Creates a new location which references a chapter.
Location(int chapterNumber, int verseNumber)
          Creates a new location which references a verse within a chapter.
Location(int chapterNumber, int verseNumber, int tokenNumber)
          Creates a new location which references a token within a verse.
 
Method Summary
 int getChapterNumber()
          Gets the chapter number.
 int getTokenNumber()
          Gets the token number.
 int getVerseNumber()
          Gets the verse number.
 java.lang.String toString()
          Gets a string representation of the location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Location

public Location(int chapterNumber)
Creates a new location which references a chapter.

Parameters:
chapterNumber - an integer value between 1 and 114 inclusive

Location

public Location(int chapterNumber,
                int verseNumber)
Creates a new location which references a verse within a chapter.

Parameters:
chapterNumber - an integer value between 1 and 114 inclusive
verseNumber - the number of the verse within the chapter

Location

public Location(int chapterNumber,
                int verseNumber,
                int tokenNumber)
Creates a new location which references a token within a verse.

Parameters:
chapterNumber - an integer value between 1 and 114 inclusive
verseNumber - the number of the verse within the chapter
tokenNumber - the number of the token within the verse
Method Detail

getChapterNumber

public int getChapterNumber()
Gets the chapter number.

Returns:
an integer value between 1 and 114 inclusive.

getVerseNumber

public int getVerseNumber()
Gets the verse number.

Returns:
a positive number if the location references a verse or token; zero if the location references a chapter.

getTokenNumber

public int getTokenNumber()
Gets the token number.

Returns:
a positive number if the location references a token; zero otherwise.

toString

public java.lang.String toString()
Gets a string representation of the location. For example (81:3:2) represents chapter 81, verse 3, token 2.

Overrides:
toString in class java.lang.Object
Returns:
a string representing the location


Copyright© Kais Dukes, 2009. All Rights Reserved.