public class CharAssociation
extends java.lang.Object
implements java.lang.Cloneable
CharAssociation
is used to maintain a
backpointer from a glyph to one or more character intervals from which the glyph was derived.
Each glyph in a glyph sequence is associated with a single CharAssociation
instance.
A CharAssociation
instance is additionally (and optionally) used to record
predication information about the glyph, such as whether the glyph was produced by the
application of a specific substitution table or whether its position was adjusted by a specific
poisitioning table.
This work was originally authored by Glenn Adams (gadams@apache.org).
Constructor and Description |
---|
CharAssociation(int[] subIntervals)
Instantiate a non-disjoint character association.
|
CharAssociation(int offset,
int count)
Instantiate a non-disjoint character association.
|
CharAssociation(int offset,
int count,
int[] subIntervals)
Instantiate a character association.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
contained(int offset,
int count) |
int |
getCount() |
int |
getEnd() |
int |
getOffset() |
java.lang.Object |
getPredication(java.lang.String key)
Get predication KEY.
|
static org.apache.fop.complexscripts.util.CharAssociation.PredicationMerger |
getPredicationMerger(java.lang.String key)
Obtain predication merger for KEY.
|
int |
getStart() |
int |
getSubIntervalCount() |
int[] |
getSubIntervals() |
boolean |
isDisjoint() |
static CharAssociation |
join(CharAssociation[] aa)
Join (merge) multiple associations into a single, potentially disjoint
association.
|
void |
mergePredication(java.lang.String key,
java.lang.Object value)
Merge predication
|
void |
mergePredications(CharAssociation ca)
Merge predications from another CA.
|
static java.lang.Object |
mergePredicationValues(java.lang.String key,
java.lang.Object v1,
java.lang.Object v2)
Merge predication values V1 and V2 on KEY.
|
static CharAssociation[] |
replicate(CharAssociation a,
int repeat)
Replicate association to form
repeat new associations. |
void |
setPredication(java.lang.String key,
java.lang.Object value)
Set predication
|
static void |
setPredicationMerger(java.lang.String key,
org.apache.fop.complexscripts.util.CharAssociation.PredicationMerger pm)
Register predication merger PM for KEY.
|
java.lang.String |
toString() |
public CharAssociation(int offset, int count, int[] subIntervals)
offset
- into array of Unicode scalar values (in associated IntBuffer)count
- of Unicode scalar values (in associated IntBuffer)subIntervals
- if disjoint, then array of sub-intervals, otherwise null; even
members of array are sub-interval starts, and odd members are sub-interval
ends (exclusive)public CharAssociation(int offset, int count)
offset
- into array of UTF-16 code elements (in associated CharSequence)count
- of UTF-16 character code elements (in associated CharSequence)public CharAssociation(int[] subIntervals)
subIntervals
- if disjoint, then array of sub-intervals, otherwise null; even
members of array are sub-interval starts, and odd members are sub-interval
ends (exclusive)public int getOffset()
public int getCount()
public int getStart()
public int getEnd()
public boolean isDisjoint()
public int[] getSubIntervals()
public int getSubIntervalCount()
public boolean contained(int offset, int count)
offset
- of interval in sequencecount
- length of intervalpublic void setPredication(java.lang.String key, java.lang.Object value)
key
- predication keyvalue
- predication valuepublic java.lang.Object getPredication(java.lang.String key)
key
- predication keypublic void mergePredication(java.lang.String key, java.lang.Object value)
key
- predication keyvalue
- predication valuepublic static java.lang.Object mergePredicationValues(java.lang.String key, java.lang.Object v1, java.lang.Object v2)
PredicationMerger
if one exists, otherwise uses V2 if non-null, otherwise uses V1.key
- predication keyv1
- first (original) predication valuev2
- second (to be merged) predication valuepublic void mergePredications(CharAssociation ca)
ca
- from which to mergepublic java.lang.Object clone()
clone
in class java.lang.Object
public static void setPredicationMerger(java.lang.String key, org.apache.fop.complexscripts.util.CharAssociation.PredicationMerger pm)
key
- for predication mergerpm
- predication mergerpublic static org.apache.fop.complexscripts.util.CharAssociation.PredicationMerger getPredicationMerger(java.lang.String key)
key
- for predication mergerpublic static CharAssociation[] replicate(CharAssociation a, int repeat)
repeat
new associations.a
- association to replicaterepeat
- countpublic static CharAssociation join(CharAssociation[] aa)
aa
- array of associations to joinpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.