org.jqurantree.orthography
Class Verse

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

public class Verse
extends ArabicText

The verse class represents one of the numbered verses in a chapter. Each Chapter is divided into a sequence of verses (ayat in Arabic), with a total of 6236 verses in the Holy Quran. The verses contain the actual words used in the Quran. This class derives from the ArabicText class.

Author:
Kais Dukes

Field Summary
 
Fields inherited from class org.jqurantree.arabic.ArabicText
buffer, characterCount, offset
 
Constructor Summary
Verse(int chapterNumber, int verseNumber, java.lang.String text)
          Creates a new verse, used by JQuranTree when constructing the orthography model.
 
Method Summary
 Chapter getChapter()
          Gets the chapter that contains the verse.
 int getChapterNumber()
          Gets the chapter number.
 Location getLocation()
          Gets the verse's location.
 Token getToken(int tokenNumber)
          Gets a token in the verse by token number.
 Token getToken(Location location)
          Gets a token in the verse by Location reference.
 int getTokenCount()
          Gets the number of tokens in the verse.
 java.lang.Iterable<Token> getTokens()
          Gets an iterator used to enumerate over all tokens in the verse.
 int getVerseNumber()
          Gets the verse number.
 java.lang.String toString()
          Converts the verse to a string.
 
Methods inherited from class org.jqurantree.arabic.ArabicText
fromBuckwalter, fromEncoding, fromUnicode, getCharacter, getCharacterType, getLength, getLetterCount, getSubstring, iterator, removeDiacritics, removeNonLetters, toBuckwalter, toSimpleEncoding, toString, toString, toUnicode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Verse

public Verse(int chapterNumber,
             int verseNumber,
             java.lang.String text)
Creates a new verse, used by JQuranTree when constructing the orthography model.

Parameters:
chapterNumber - the chapter number, between 1 and 114 inclusive
verseNumber - the verse number, a positive integer
text - the Unicode text of the verse
Method Detail

getLocation

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

Returns:
a location referencing the verse

getChapter

public Chapter getChapter()
Gets the chapter that contains the verse.

Returns:
the verse's chapter

getChapterNumber

public int getChapterNumber()
Gets the chapter number.

Returns:
the chapter number, between 1 and 114 inclusive

getVerseNumber

public int getVerseNumber()
Gets the verse number.

Returns:
the verse number, a positive integer

getTokens

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

Returns:
a token iterator

getToken

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

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

getToken

public Token getToken(int tokenNumber)
Gets a token in the verse by token number.

Parameters:
tokenNumber - the token number, a positive integer
Returns:
the specified token

getTokenCount

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

Returns:
a positive integer

toString

public java.lang.String toString()
Converts the verse to a string. The format used is the location followed by the Buckwalter transliteration of the verse, For example "(114:2) maliki {ln~aAsi".

Overrides:
toString in class ArabicText
Returns:
a string representing the verse
See Also:
UnicodeEncoder


Copyright© Kais Dukes, 2009. All Rights Reserved.