org.jqurantree.orthography
Class Document

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

public class Document
extends java.lang.Object

The top-level class in the orthography model, providing a structured representation of the entire text of the Holy Quran. This class provides static methods to access other elements of the orthography model, including chapters, verses and tokens.

Author:
Kais Dukes

Method Summary
static Chapter getChapter(int chapterNumber)
          Gets a chapter in the document by chapter number.
static Chapter getChapter(Location location)
          Gets a chapter in the document by Location reference.
static int getChapterCount()
          Gets the number of the chapters in the document.
static java.lang.Iterable<Chapter> getChapters()
          Gets an iterator used to enumerate over all chapters in the document.
static java.lang.String getName()
          Gets the name of the document.
static Token getToken(int chapterNumber, int verseNumber, int tokenNumber)
          Gets a token in the document by chapter, verse and token number.
static Token getToken(Location location)
          Gets a token in the document by Location reference.
static int getTokenCount()
          Gets the number of tokens in the document.
static java.lang.Iterable<Token> getTokens()
          Gets an iterator used to enumerate over all tokens in the document.
static Verse getVerse(int chapterNumber, int verseNumber)
          Gets a verse in the document by chapter and verse number.
static Verse getVerse(Location location)
          Gets a verse in the document by Location reference.
static int getVerseCount()
          Gets the number of verses in the document.
static java.lang.Iterable<Verse> getVerses()
          Gets an iterator used to enumerate over all verses in the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public static java.lang.String getName()
Gets the name of the document.

Returns:
"The Holy Quran"

getChapterCount

public static int getChapterCount()
Gets the number of the chapters in the document.

Returns:
114, the number chapters in the Holy Quran

getVerseCount

public static int getVerseCount()
Gets the number of verses in the document.

Returns:
6236, the number of verses in the Holy Quran

getTokenCount

public static int getTokenCount()
Gets the number of tokens in the document.

Returns:
the total number of tokens in the Holy Quran

getChapter

public static Chapter getChapter(int chapterNumber)
Gets a chapter in the document by chapter number.

Parameters:
chapterNumber - the chapter number, between 1 and 114 inclusive
Returns:
the specified chapter

getChapter

public static Chapter getChapter(Location location)
Gets a chapter in the document by Location reference.

Parameters:
location - the chapter's location
Returns:
the specified chapter

getChapters

public static java.lang.Iterable<Chapter> getChapters()
Gets an iterator used to enumerate over all chapters in the document.

Returns:
a chapter iterator

getVerse

public static Verse getVerse(int chapterNumber,
                             int verseNumber)
Gets a verse in the document by chapter and verse number.

Parameters:
chapterNumber - the chapter number, between 1 and 114 inclusive
verseNumber - the verse number, a positive integer
Returns:
the specified verse

getVerse

public static Verse getVerse(Location location)
Gets a verse in the document by Location reference.

Parameters:
location - the verse's location
Returns:
the specified verse

getVerses

public static java.lang.Iterable<Verse> getVerses()
Gets an iterator used to enumerate over all verses in the document.

Returns:
a verse iterator

getToken

public static Token getToken(int chapterNumber,
                             int verseNumber,
                             int tokenNumber)
Gets a token in the document by chapter, verse and token number.

Parameters:
chapterNumber - the chapter number, between 1 and 114 inclusive
verseNumber - the verse number, a positive integer
tokenNumber - the tokenNumber, a positive integer
Returns:
the specified token

getToken

public static Token getToken(Location location)
Gets a token in the document by Location reference.

Parameters:
location - the token's location
Returns:
the specified token

getTokens

public static java.lang.Iterable<Token> getTokens()
Gets an iterator used to enumerate over all tokens in the document.

Returns:
a token iterator


Copyright© Kais Dukes, 2009. All Rights Reserved.