|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jqurantree.arabic.ArabicTextBuilder
public class ArabicTextBuilder
The ArabicTextBuilder class is used to construct
ArabicText by wrapping a mutable sequence of
ArabicCharacters. Since
ArabicText instances are immutable, a builder is required to
construct new instances. This class is analogous to the Java
StringBuilder class. The class manages an internal
byte[] buffer which grows on demand.
| Constructor Summary | |
|---|---|
ArabicTextBuilder()
Creates a new Arabic text builder with the default initial capacity. |
|
ArabicTextBuilder(int characterCapacity)
Creates a new Arabic text builder with the specified character capacity. |
|
| Method Summary | |
|---|---|
void |
add(CharacterType characterType)
Appends a new character to the end of the buffer. |
void |
add(CharacterType characterType,
DiacriticType... diaciritcTypes)
Appends a new character with attached diacritics to the end of the buffer. |
void |
add(DiacriticType diacriticType)
Attaches a diacritic to the last character in the buffer. |
void |
addWhitespace()
Appends a space character to the end of the buffer. |
byte[] |
toByteArray()
Gets a copy of the internal byte[] buffer holding only used
characters. |
java.lang.String |
toString()
Converts the Arabic text builder to a string. |
ArabicText |
toText()
Creates a new ArabicText instance from the characters in the
buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ArabicTextBuilder()
public ArabicTextBuilder(int characterCapacity)
characterCapacity - the initial size of the byte[] buffer measured in
characters. Each character will occupy 3 bytes in the buffer.| Method Detail |
|---|
public void add(CharacterType characterType)
characterType - the type of Arabic letter or Quranic symbol to append, such as
Alif or Ba.public void add(DiacriticType diacriticType)
diacriticType - the type of diacritic to attach, such as Fatha or
Shadda.
public void add(CharacterType characterType,
DiacriticType... diaciritcTypes)
characterType - the type of Arabic letter or Quranic symbol to append, such as
Alif or Ba.diaciritcTypes - a list of diacritics to attach, such as Fatha or
Shadda.public void addWhitespace()
public java.lang.String toString()
string. The returned
string will represent the characters in the buffer using Unicode
encoding.
toString in class java.lang.Objectpublic ArabicText toText()
ArabicText instance from the characters in the
buffer.
ArabicText instancepublic byte[] toByteArray()
byte[] buffer holding only used
characters.
byte[] array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||