|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.lpex.bidi.BidiText
public class BidiText
Bidi text is a combination of a sequence of characters and a set of Bidi flags which represent Bidi attributes used during Bidi Layout transformations.
Layout transformations allow to convert a given instance of Bidi text into another instance with possibly different Bidi flags while conserving the semantics of the text.
A BidiText object contains a BidiFlagSet to store the Bidi flags characterizing its character data. The characters are contained in a character array. This array may contain more data than the Bidi text to process. The part of the array to process is called the "interesting" data, and is defined by its length and its offset from the beginning of the character array.
Multi-threading considerations: Each thread must use its own instances of this class.
Field Summary | |
---|---|
int |
count
length of the "interesting" data within the character array |
char[] |
data
character array containing the data |
BidiFlagSet |
flags
BidiFlagSet qualifying the character data |
int |
offset
offset of the "interesting" data within the character array |
Constructor Summary | |
---|---|
BidiText()
Constructor with no arguments to create a flags member with a DEFAULT value. |
|
BidiText(BidiFlagSet initFlags)
Constructs a BidiText object based on an existing BidiFlagSet. |
|
BidiText(BidiFlagSet initFlags,
char[] initData)
Constructs a BidiText object based on an existing BidiFlagSet and the data in a character array. |
|
BidiText(BidiFlagSet initFlags,
char[] initData,
int offset,
int length,
int capacity)
Constructs a BidiText object based on an existing BidiFlagSet and the data in part of a character array. |
|
BidiText(BidiFlagSet initFlags,
String str)
Constructs a BidiText object based on an existing BidiFlagSet and the data in a string. |
Method Summary | |
---|---|
boolean |
equals(BidiText other)
Compares two BidiText objects. |
boolean |
equals(Object obj)
|
int |
hashCode()
|
void |
setCharsRef(char[] newData,
int newOffset,
int newLength)
Replaces the character data reference in the BidiText object. |
char[] |
toCharArray()
Extracts the character data from a BidiText in character array format |
String |
toString()
Extracts the character data from a BidiText in string format |
BidiText |
transform(BidiFlagSet dstFlags)
Transforms the data in the "this" BidiText object and return the resulting BidiText object. |
BidiText |
transform(BidiTransform bdx)
Transforms the data in the "this" BidiText object and return the resulting BidiText object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public BidiFlagSet flags
public char[] data
public int offset
public int count
Constructor Detail |
---|
public BidiText()
public BidiText(BidiFlagSet initFlags)
public BidiText(BidiFlagSet initFlags, char[] initData)
The argument flags and data are duplicated. Changing them will not affect the BidiText instance.
initFlags
- The Bidi flags of the data.initData
- The character data.public BidiText(BidiFlagSet initFlags, char[] initData, int offset, int length, int capacity)
The argument flags and data are duplicated. Changing them will not affect the BidiText instance.
initFlags
- The Bidi flags of the data.initData
- The character data.offset
- The offset of the "interesting" data in initData.length
- The length of the "interesting" data in initData.capacity
- The length of the created character array (may be
larger than "length" to reserve space for
adding more data).public BidiText(BidiFlagSet initFlags, String str)
The argument flags and data are duplicated. Changing them will not affect the BidiText instance.
initFlags
- The Bidi flags of the data.str
- The character data.Method Detail |
---|
public boolean equals(BidiText other)
other
- The BidiText to compare to this.
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void setCharsRef(char[] newData, int newOffset, int newLength)
This method avoids the overhead of creating a character array and copying the source data to it, when the source data is already contained in a character array.
This method can be used after creating a BidiText object with no arguments, or to reuse a BidiText object with new data.
This is a convenience method. It is also possible to manipulate directly the data, offset and count members of the BidiText instance.
newData
- A reference to the character data.newOffset
- The offset of the "interesting" data in newData.newLength
- The length of the "interesting" data in newData.public char[] toCharArray()
public String toString()
toString
in class Object
public BidiText transform(BidiFlagSet dstFlags)
The source BidiText is never modified by the transform.
The destination BidiText has its Bidi flags set to those of the argument.
A typical usage of this method could be:
BidiText src = new BidiText(); // source text BidiFlagSet dstFlags; // Bidi flags for destination BidiText dst; // destination reference src.flags.setAllFlags( {flag values for source} ); dstFlags.setAllFlags( {flag values for destination} ); // assign values to src.data, src.offset, src.count dst = src.transform(dstFlags);
dstFlags
- Bidi flags of the destination BidiText.
public BidiText transform(BidiTransform bdx)
The source BidiText is never modified by the transform.
The destination BidiText has its Bidi flags set to those of the argument.
Output fields of the BidiTransform object are set by this method. srcToDstMap, DstToSrcMap and propertyMap may be set by this method if the corresponding options have been required in BidiTransform when calling it.
By default, transformed output data is written to the destination BidiText character array but no maps are created.
A typical usage of this method could be:
BidiTransform bdx = new BidiTransform(); BidiText src = new BidiText(); // source text BidiText dst; // destination reference src.flags.setAllFlags( {flag values for source} ); bdx.flags.setAllFlags( {flag values for destination} ); // assign values to src.data, src.offset, src.count dst = src.transform(bdx);
This method is still in construction. Currently only the default options are implemented. No maps are created.
bdx
- The BidiTransform object defining the transformation.
|
LPEX 4.4.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |