org.jqurantree.orthography
Class Chapter

java.lang.Object
  extended by org.jqurantree.orthography.Chapter
All Implemented Interfaces:
java.lang.Iterable<Verse>

public class Chapter
extends java.lang.Object
implements java.lang.Iterable<Verse>

One of the 114 chapters in the Holy Quran, with a unique chapter name and number. Each chapter (sura in Arabic) is divided into a sequence of Verses.

Author:
Kais Dukes

Constructor Summary
Chapter(int chapterNumber, ArabicText name, ArabicText bismillah, Verse[] verses)
          Creates a new chapter, used by JQuranTree when constructing the orthography model.
 
Method Summary
 ArabicText getBismillah()
          Gets the bismillah phrase preceding the chapter's verses.
 int getChapterNumber()
          Gets the chapter number.
 Location getLocation()
          Gets the chapter's location.
 ArabicText getName()
          Gets the name of the chapter as ArabicText.
 int getTokenCount()
          Gets the number of tokens in the chapter.
 Verse getVerse(int verseNumber)
          Gets a verse in the chapter by verse number.
 Verse getVerse(Location location)
          Gets a verse in the chapter by Location reference.
 int getVerseCount()
          Gets the number of verses in the chapter.
 java.util.Iterator<Verse> iterator()
          Gets an iterator used to enumerate over all verses in the chapter.
 java.lang.String toString()
          Gets a string representation of the chapter's location, for example "Chapter 18".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chapter

public Chapter(int chapterNumber,
               ArabicText name,
               ArabicText bismillah,
               Verse[] verses)
Creates a new chapter, used by JQuranTree when constructing the orthography model.

Parameters:
chapterNumber - the chapter's number, between 1 and 114 inclusive
name - the chapter's name
bismillah - the bismillah phrase preceding the chapter's verses if present; null otherwise
verses - an array holding the chapter's verses
Method Detail

getChapterNumber

public int getChapterNumber()
Gets the chapter number.

Returns:
the chapter number, between 1 and 114 inclusive

getLocation

public Location getLocation()
Gets the chapter's location.

Returns:
a location referencing the chapter

getName

public ArabicText getName()
Gets the name of the chapter as ArabicText.

Returns:
the chapter's name

getBismillah

public ArabicText getBismillah()
Gets the bismillah phrase preceding the chapter's verses.

Returns:
the bismillah phrase preceding the chapter's verses if present; null otherwise

getVerse

public Verse getVerse(int verseNumber)
Gets a verse in the chapter by verse number.

Parameters:
verseNumber - the verse number, a positive integer
Returns:
the specified verse

getVerse

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

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

getVerseCount

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

Returns:
a positive integer

getTokenCount

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

Returns:
a positive integer

iterator

public java.util.Iterator<Verse> iterator()
Gets an iterator used to enumerate over all verses in the chapter.

Specified by:
iterator in interface java.lang.Iterable<Verse>
Returns:
a verse iterator

toString

public java.lang.String toString()
Gets a string representation of the chapter's location, for example "Chapter 18".

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


Copyright© Kais Dukes, 2009. All Rights Reserved.