org.jqurantree.arabic
Class ArabicCharacter

java.lang.Object
  extended by org.jqurantree.arabic.ArabicCharacter

public class ArabicCharacter
extends java.lang.Object

An ArabicCharacter is a single letter or Quranic symbol within ArabicText, including any attached diacritics. Instances of this class are immutable and cannot be changed. The getType() method returns the character's type, such as Alif or Ba.

Methods including isFatha() and isDamma() test for the presence of diacritics. The ArabicCharacter can be converted to plain text using the toString() or toString(EncodingType) methods.

Author:
Kais Dukes

Method Summary
 int getDiacriticCount()
          Gets the number of diacritics attached to the character.
 CharacterType getType()
          Gets the CharacterType of the character, such as Alif or Ba.
 boolean isAlifKhanjareeya()
          Determines if Alif Khanjareeya is attached.
 boolean isDamma()
          Determines if a Damma is attached.
 boolean isDammatan()
          Determines if Dammatan are attached.
 boolean isFatha()
          Determines if a Fatha is attached.
 boolean isFathatan()
          Determines if Fathatan are attached.
 boolean isHamzaAbove()
          Determines if a Hamza is present above the character.
 boolean isHamzaBelow()
          Determines if a Hamza is present below the character.
 boolean isHamzatWasl()
          Determines if Hamzat Wasl is attached.
 boolean isKasra()
          Determines if a Kasra is attached.
 boolean isKasratan()
          Determines if Kasratan are attached.
 boolean isLetter()
          Determines if the character is an Arabic letter.
 boolean isMaddah()
          Determines if a Maddah is attached.
 boolean isShadda()
          Determines if a Shadda is attached.
 boolean isSingleDiacritic(DiacriticType diacriticType)
          Determines if only a single diacritic is attached.
 boolean isSukun()
          Determines if a Sukun is attached.
 java.lang.String toBuckwalter()
          Converts the character to a string using Buckwalter transliteration.
 java.lang.String toSimpleEncoding()
          Converts the character to a string using simple encoding.
 java.lang.String toString()
          Converts the character to a string using the default encoding scheme.
 java.lang.String toString(EncodingType encodingType)
          Converts the character to a string using the specified encoding type.
 java.lang.String toUnicode()
          Converts the character to Unicode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getType

public CharacterType getType()
Gets the CharacterType of the character, such as Alif or Ba.

Returns:
the character's type, indicating which Arabic letter or Quranic symbol the character represents.

isFatha

public boolean isFatha()
Determines if a Fatha is attached.

Returns:
true if a Fatha is attached; false otherwise.

isDamma

public boolean isDamma()
Determines if a Damma is attached.

Returns:
true if a Damma is attached; false otherwise.

isKasra

public boolean isKasra()
Determines if a Kasra is attached.

Returns:
true if a Kasra is attached; false otherwise.

isFathatan

public boolean isFathatan()
Determines if Fathatan are attached.

Returns:
true if Fathatan are attached; false otherwise.

isDammatan

public boolean isDammatan()
Determines if Dammatan are attached.

Returns:
true if Dammatan are attached; false otherwise.

isKasratan

public boolean isKasratan()
Determines if Kasratan are attached.

Returns:
true if Kasratan are attached; false otherwise.

isShadda

public boolean isShadda()
Determines if a Shadda is attached.

Returns:
true if a Shadda is attached; false otherwise.

isSukun

public boolean isSukun()
Determines if a Sukun is attached.

Returns:
true if a Sukun is attached; false otherwise.

isMaddah

public boolean isMaddah()
Determines if a Maddah is attached.

Returns:
true if a Maddah is attached; false otherwise.

isHamzaAbove

public boolean isHamzaAbove()
Determines if a Hamza is present above the character.

Returns:
true if a Hamza is present above the character; false otherwise.

isHamzaBelow

public boolean isHamzaBelow()
Determines if a Hamza is present below the character.

Returns:
true if a Hamza is present below the character; false otherwise.

isHamzatWasl

public boolean isHamzatWasl()
Determines if Hamzat Wasl is attached.

Returns:
true if Hamzat Wasl is attached; false otherwise.

isAlifKhanjareeya

public boolean isAlifKhanjareeya()
Determines if Alif Khanjareeya is attached.

Returns:
true if Alif Khanjareeya is attached; false otherwise.

isSingleDiacritic

public boolean isSingleDiacritic(DiacriticType diacriticType)
Determines if only a single diacritic is attached.

Parameters:
diacriticType - the single diacritic
Returns:
true if the character has only the specified diacritic and no others; false otherwise.

getDiacriticCount

public int getDiacriticCount()
Gets the number of diacritics attached to the character.

Returns:
a positive number if the character has any attached diacritics, otherwise zero.

isLetter

public boolean isLetter()
Determines if the character is an Arabic letter.

Returns:
true if the character is an Arabic letter, and not a Quranic symbol; false otherwise.

toString

public java.lang.String toString()
Converts the character to a string using the default encoding scheme. For Arabic characters, the default encoding is simple encoding.

Overrides:
toString in class java.lang.Object
Returns:
a string representing the character in the defaulting encoding.

toString

public java.lang.String toString(EncodingType encodingType)
Converts the character to a string using the specified encoding type.

Returns:
a string representing the character in the specified encoding.

toUnicode

public java.lang.String toUnicode()
Converts the character to Unicode.

Returns:
a Unicode representation of the ArabicCharacter. A string is returned and not a char since a single Arabic letter with diacritics is represented by several characters in Unicode.

toBuckwalter

public java.lang.String toBuckwalter()
Converts the character to a string using Buckwalter transliteration.

Returns:
a string representing the character in Buckwalter transliteration.

toSimpleEncoding

public java.lang.String toSimpleEncoding()
Converts the character to a string using simple encoding.

Returns:
a string representing the character in simple encoding.


Copyright© Kais Dukes, 2009. All Rights Reserved.