|
fop 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.complexscripts.util.GlyphSequence
public class GlyphSequence
A GlyphSequence encapsulates a sequence of character codes, a sequence of glyph codes, and a sequence of character associations, where, for each glyph in the sequence of glyph codes, there is a corresponding character association. Character associations server to relate the glyph codes in a glyph sequence to the specific characters in an original character code sequence with which the glyph codes are associated.
This work was originally authored by Glenn Adams (gadams@apache.org).
Constructor Summary | |
---|---|
GlyphSequence(GlyphSequence gs)
Instantiate a glyph sequence using an existing glyph sequence, where the new glyph sequence shares the character array of the existing sequence (but not the buffer object), and creates new copies of glyphs buffer and association list. |
|
GlyphSequence(GlyphSequence gs,
int[] bga,
int[] iga,
int[] lga,
CharAssociation[] bal,
CharAssociation[] ial,
CharAssociation[] lal)
Instantiate a glyph sequence using an existing glyph sequence, where the new glyph sequence shares the character array of the existing sequence (but not the buffer object), but uses the specified backtrack, input, and lookahead glyph arrays to populate the glyphs, and uses the specified of glyphs buffer and association list. |
|
GlyphSequence(java.nio.IntBuffer characters,
java.nio.IntBuffer glyphs,
java.util.List associations)
Instantiate a glyph sequence, reusing (i.e., not copying) the referenced character and glyph buffers and associations. |
|
GlyphSequence(java.nio.IntBuffer characters,
java.nio.IntBuffer glyphs,
java.util.List associations,
boolean predications)
Instantiate a glyph sequence, reusing (i.e., not copying) the referenced character and glyph buffers and associations. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
int |
compareGlyphs(java.nio.IntBuffer gb)
Compare glyphs. |
static java.util.List |
concatAssociations(CharAssociation[] baa,
CharAssociation[] iaa,
CharAssociation[] laa)
Concatenante association arrays. |
static java.nio.IntBuffer |
concatGlyphs(int[] bga,
int[] iga,
int[] lga)
Concatenante glyph arrays. |
CharAssociation |
getAssociation(int index)
Obtain association at specified index. |
java.util.List |
getAssociations()
Obtain reference to underlying associations list. |
CharAssociation[] |
getAssociations(int offset,
int count)
Obtain count associations starting at offset. |
int[] |
getCharacterArray(boolean copy)
Obtain array of characters. |
int |
getCharacterCount()
Obtain the number of characters in character array, where each character constitutes a unicode scalar value. |
java.nio.IntBuffer |
getCharacters()
Obtain reference to underlying character buffer. |
int |
getGlyph(int index)
Obtain glyph id at specified index. |
int[] |
getGlyphArray(boolean copy)
Obtain array of glyphs. |
int |
getGlyphCount()
Obtain the number of glyphs in glyphs array, where each glyph constitutes a font specific glyph index. |
java.nio.IntBuffer |
getGlyphs()
Obtain reference to underlying glyph buffer. |
int[] |
getGlyphs(int offset,
int count)
Obtain count glyphs starting at offset. |
java.lang.Object |
getPredication(int offset,
java.lang.String key)
Get predication KEY at glyph sequence OFFSET. |
boolean |
getPredications()
Obtain predications state. |
static GlyphSequence |
join(GlyphSequence gs,
GlyphSequence[] sa)
Join (concatenate) glyph sequences. |
static GlyphSequence |
reorder(GlyphSequence gs,
int source,
int count,
int target)
Reorder sequence such that [SOURCE,SOURCE+COUNT) is moved just prior to TARGET. |
static boolean |
sameGlyphs(int[] ga1,
int[] ga2)
Determine if two arrays of glyphs are identical. |
void |
setGlyph(int index,
int gi)
Set glyph id at specified index. |
void |
setPredication(int offset,
java.lang.String key,
java.lang.Object value)
Set predication |
void |
setPredications(boolean enable)
Enable or disable predications. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GlyphSequence(java.nio.IntBuffer characters, java.nio.IntBuffer glyphs, java.util.List associations, boolean predications)
characters
- a (possibly null) buffer of associated (originating) charactersglyphs
- a (possibly null) buffer of glyphsassociations
- a (possibly null) array of glyph to character associationspredications
- true if predications are enabledpublic GlyphSequence(java.nio.IntBuffer characters, java.nio.IntBuffer glyphs, java.util.List associations)
characters
- a (possibly null) buffer of associated (originating) charactersglyphs
- a (possibly null) buffer of glyphsassociations
- a (possibly null) array of glyph to character associationspublic GlyphSequence(GlyphSequence gs)
gs
- an existing glyph sequencepublic GlyphSequence(GlyphSequence gs, int[] bga, int[] iga, int[] lga, CharAssociation[] bal, CharAssociation[] ial, CharAssociation[] lal)
gs
- an existing glyph sequencebga
- backtrack glyph arrayiga
- input glyph arraylga
- lookahead glyph arraybal
- backtrack association listial
- input association listlal
- lookahead association listMethod Detail |
---|
public java.nio.IntBuffer getCharacters()
public int[] getCharacterArray(boolean copy)
copy
is true, then
a newly instantiated array is returned, otherwise a reference to
the underlying buffer's array is returned. N.B. in case a reference
to the undelying buffer's array is returned, the length
of the array is not necessarily the number of characters in array.
To determine the number of characters, use getCharacterCount()
.
copy
- true if to return a newly instantiated array of characters
public int getCharacterCount()
public int getGlyph(int index) throws java.lang.IndexOutOfBoundsException
index
- to obtain glyph
java.lang.IndexOutOfBoundsException
- if index is less than zero
or exceeds last valid positionpublic void setGlyph(int index, int gi) throws java.lang.IndexOutOfBoundsException
index
- to set glyphgi
- glyph index
java.lang.IndexOutOfBoundsException
- if index is greater or equal to
the limit of the underlying glyph bufferpublic java.nio.IntBuffer getGlyphs()
public int[] getGlyphs(int offset, int count)
count
is
negative, then it is treated as if the number of available glyphs
were specified.
offset
- into glyph sequencecount
- of glyphs to obtain starting at offset, or negative,
indicating all avaialble glyphs starting at offset
public int[] getGlyphArray(boolean copy)
copy
is true, then
a newly instantiated array is returned, otherwise a reference to
the underlying buffer's array is returned. N.B. in case a reference
to the undelying buffer's array is returned, the length
of the array is not necessarily the number of glyphs in array.
To determine the number of glyphs, use getGlyphCount()
.
copy
- true if to return a newly instantiated array of glyphs
public int getGlyphCount()
public CharAssociation getAssociation(int index) throws java.lang.IndexOutOfBoundsException
index
- into associations array
java.lang.IndexOutOfBoundsException
- if index is less than zero
or exceeds last valid positionpublic java.util.List getAssociations()
public CharAssociation[] getAssociations(int offset, int count)
offset
- into glyph sequencecount
- of associations to obtain starting at offset, or negative,
indicating all avaialble associations starting at offset
public void setPredications(boolean enable)
enable
- true if predications are to be enabled; otherwise false to disablepublic boolean getPredications()
public void setPredication(int offset, java.lang.String key, java.lang.Object value)
offset
- offset (index) into glyph sequencekey
- predication keyvalue
- predication valuepublic java.lang.Object getPredication(int offset, java.lang.String key)
offset
- offset (index) into glyph sequencekey
- predication key
public int compareGlyphs(java.nio.IntBuffer gb)
gb
- buffer containing glyph indices with which this glyph sequence's glyphs are to be compared
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static boolean sameGlyphs(int[] ga1, int[] ga2)
ga1
- first glyph arrayga2
- second glyph array
public static java.nio.IntBuffer concatGlyphs(int[] bga, int[] iga, int[] lga)
bga
- backtrack glyph arrayiga
- input glyph arraylga
- lookahead glyph array
public static java.util.List concatAssociations(CharAssociation[] baa, CharAssociation[] iaa, CharAssociation[] laa)
baa
- backtrack association arrayiaa
- input association arraylaa
- lookahead association array
public static GlyphSequence join(GlyphSequence gs, GlyphSequence[] sa)
gs
- original glyph sequence from which to reuse character array referencesa
- array of glyph sequences, whose glyph arrays and association lists are to be concatenated
public static GlyphSequence reorder(GlyphSequence gs, int source, int count, int target)
gs
- input sequencesource
- index of sub-sequence to reordercount
- length of sub-sequence to reordertarget
- index to which source sub-sequence is to be moved
|
fop 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |