fop 1.1

## org.apache.fop.complexscripts.util
Class GlyphSequence.CharAssociation

    java.lang.Object
      org.apache.fop.complexscripts.util.GlyphSequence.CharAssociation

All Implemented Interfaces:
  java.lang.Cloneable

Enclosing class:
  GlyphSequence

    public static class GlyphSequence.CharAssociation

extends java.lang.Object
implements java.lang.Cloneable

A structure class encapsulating an interval of characters expressed as an offset and count of Unicode scalar values (in an IntBuffer). A `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.

Constructor Summary
`GlyphSequence.CharAssociation(int[] subIntervals)` Instantiate a non-disjoint character association.
`GlyphSequence.CharAssociation(int offset, int count)` Instantiate a non-disjoint character association.
`GlyphSequence.CharAssociation(int offset, int count, int[] subIntervals)` Instantiate a character association.

Method Summary
`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.GlyphSequence.CharAssociation.PredicationMerger` `getPredicationMerger(java.lang.String key)` Obtain predication merger for KEY.
`int` `getStart()`
`int` `getSubIntervalCount()`
`int[]` `getSubIntervals()`
`boolean` `isDisjoint()`
`static GlyphSequence.CharAssociation` `join(GlyphSequence.CharAssociation[] aa)` Join (merge) multiple associations into a single, potentially disjoint association.
`void` `mergePredication(java.lang.String key, java.lang.Object value)` Merge predication <KEY,VALUE>.
`void` `mergePredications(GlyphSequence.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 GlyphSequence.CharAssociation[]` `replicate(GlyphSequence.CharAssociation a, int repeat)` Replicate association to form `repeat` new associations.
`void` `setPredication(java.lang.String key, java.lang.Object value)` Set predication <KEY,VALUE>.
`static void` `setPredicationMerger(java.lang.String key, org.apache.fop.complexscripts.util.GlyphSequence.CharAssociation.PredicationMerger pm)` Register predication merger PM for KEY.

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GlyphSequence.CharAssociation

    public GlyphSequence.CharAssociation(int offset,
                                         int count,
                                         int[] subIntervals)

  Instantiate a character association.

  Parameters:
    `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)

### GlyphSequence.CharAssociation

    public GlyphSequence.CharAssociation(int offset,
                                         int count)

  Instantiate a non-disjoint character association.

  Parameters:
    `offset` - into array of UTF-16 code elements (in associated CharSequence)
    `count` - of UTF-16 character code elements (in associated CharSequence)

### GlyphSequence.CharAssociation

    public GlyphSequence.CharAssociation(int[] subIntervals)

  Instantiate a non-disjoint character association.

  Parameters:
    `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)

Method Detail

### getOffset

    public int getOffset()

  Returns:
    offset (start of association interval)

### getCount

    public int getCount()

  Returns:
    count (number of characer codes in association)

### getStart

    public int getStart()

  Returns:
    start of association interval

### getEnd

    public int getEnd()

  Returns:
    end of association interval

### isDisjoint

    public boolean isDisjoint()

  Returns:
    true if association is disjoint

### getSubIntervals

    public int[] getSubIntervals()

  Returns:
    subintervals of disjoint association

### getSubIntervalCount

    public int getSubIntervalCount()

  Returns:
    count of subintervals of disjoint association

### contained

    public boolean contained(int offset,
                             int count)

  Parameters:
    `offset` - of interval in sequence
    `count` - length of interval
  Returns:
    true if this association is contained within [offset,offset+count)

### setPredication

    public void setPredication(java.lang.String key,
                               java.lang.Object value)

  Set predication <KEY,VALUE>.

  Parameters:
    `key` - predication key
    `value` - predication value

### getPredication

    public java.lang.Object getPredication(java.lang.String key)

  Get predication KEY.

  Parameters:
    `key` - predication key
  Returns:
    predication KEY at OFFSET or null if none exists

### mergePredication

    public void mergePredication(java.lang.String key,
                                 java.lang.Object value)

  Merge predication <KEY,VALUE>.

  Parameters:
    `key` - predication key
    `value` - predication value

### mergePredicationValues

    public 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. Uses registered `PredicationMerger` if one exists, otherwise uses V2 if non-null, otherwise uses V1.

  Parameters:
    `key` - predication key
    `v1` - first (original) predication value
    `v2` - second (to be merged) predication value
  Returns:
    merged value

### mergePredications

    public void mergePredications(GlyphSequence.CharAssociation ca)

  Merge predications from another CA.

  Parameters:
    `ca` - from which to merge

### clone

    public java.lang.Object clone()

  Overrides:
    `clone` in class `java.lang.Object`

### setPredicationMerger

    public static void setPredicationMerger(java.lang.String key,
                                            org.apache.fop.complexscripts.util.GlyphSequence.CharAssociation.PredicationMerger pm)

  Register predication merger PM for KEY.

  Parameters:
    `key` - for predication merger
    `pm` - predication merger

### getPredicationMerger

    public static org.apache.fop.complexscripts.util.GlyphSequence.CharAssociation.PredicationMerger getPredicationMerger(java.lang.String key)

  Obtain predication merger for KEY.

  Parameters:
    `key` - for predication merger
  Returns:
    predication merger or null if none exists

### replicate

    public static GlyphSequence.CharAssociation[] replicate(GlyphSequence.CharAssociation a,
                                                            int repeat)

  Replicate association to form `repeat` new associations.

  Parameters:
    `a` - association to replicate
    `repeat` - count
  Returns:
    array of replicated associations

### join

    public static GlyphSequence.CharAssociation join(GlyphSequence.CharAssociation[] aa)

  Join (merge) multiple associations into a single, potentially disjoint association.

  Parameters:
    `aa` - array of associations to join
  Returns:
    (possibly disjoint) association containing joined associations

fop 1.1

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.