net.sf.zekr.common.resource
Interface IQuranLocation

All Superinterfaces:
java.lang.Comparable
All Known Implementing Classes:
QuranLocation

public interface IQuranLocation
extends java.lang.Comparable

An immutable interface for a Quran location.

Author:
Mohsen Saboorian

Method Summary
 int getAbsoluteAya()
          Counts the aya number from the start of the Quran.
 int getAya()
           
 IQuranLocation getNext()
          Returns the next location (sura-aya pair).
 IQuranLocation getPrev()
          Returns the previous location (sura-aya pair).
 int getSura()
           
 java.lang.String getSuraName()
           
 java.lang.String getSuraName(boolean localize)
           
 boolean isValid()
           
 java.lang.String toSortableString()
          Pads the sura/aya number so that all strings are of the same width and sortable.
 java.lang.String toString()
          Makes a string representation of this class as: sura#-aya#
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getAya

int getAya()

getSura

int getSura()

getSuraName

java.lang.String getSuraName()
Returns:
the sura name in the language and format specified in view.sura.name property.

getSuraName

java.lang.String getSuraName(boolean localize)
Parameters:
localize - specifies whether or not to localize sura name
Returns:
the sura name either in Arabic or the language and format specified in view.sura.name property (if localize parameter is true).

getAbsoluteAya

int getAbsoluteAya()
Counts the aya number from the start of the Quran. The value can be a number between 1 to 6236.

Returns:
the absolute aya number counted from the start of the Quran.

getNext

IQuranLocation getNext()
Returns the next location (sura-aya pair).

Returns:
the next Quran location, or null if there is nothing

getPrev

IQuranLocation getPrev()
Returns the previous location (sura-aya pair).

Returns:
the previous Quran location, or null if there is nothing

toSortableString

java.lang.String toSortableString()
Pads the sura/aya number so that all strings are of the same width and sortable.

Returns:
a sortable representation of the quran location.

isValid

boolean isValid()

toString

java.lang.String toString()
Makes a string representation of this class as: sura#-aya#

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the Quran location in the format sura#-aya#.