Class InlineRun
- java.lang.Object
-
- org.apache.fop.complexscripts.bidi.InlineRun
-
public class InlineRun extends java.lang.ObjectTheInlineRunclass is a utility class, the instances of which are used to capture a sequence of reordering levels associated with an inline area.This work was originally authored by Glenn Adams (gadams@apache.org).
-
-
Constructor Summary
Constructors Constructor Description InlineRun(InlineArea inline, int[] levels)Primary constructor.InlineRun(InlineArea inline, int level, int count)Alternate constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)private java.lang.StringgenerateLevels(int[] levels)InlineAreagetInline()Obtain inline area that generated this inline run.intgetMaxLevel()Obtain maximum bidi level for this run.intgetMinLevel()Obtain minimum bidi level for this run.inthashCode()booleanisHomogenous()Determine if this run has homogenous (same valued) bidi levels.private static int[]makeLevels(int level, int count)booleanmaybeNeedsMirroring()Determine if run needs mirroring.voidmaybeReverseWord(boolean mirror)Reverse inline area if it is a word area and it requires reversal.voidreverse()Reverse run (by incrementing reversal count, not actually reversing).private voidsetMinMax(int[] levels)java.util.Listsplit()Split this inline run into homogenous runs.java.lang.StringtoString()voidupdateMinMax(int[] mm)Update a min/max array to correspond with this run's min/max values.
-
-
-
Field Detail
-
inline
private InlineArea inline
-
levels
private int[] levels
-
minLevel
private int minLevel
-
maxLevel
private int maxLevel
-
reversals
private int reversals
-
-
Constructor Detail
-
InlineRun
public InlineRun(InlineArea inline, int[] levels)
Primary constructor.- Parameters:
inline- which generated this inline runlevels- levels array
-
InlineRun
public InlineRun(InlineArea inline, int level, int count)
Alternate constructor.- Parameters:
inline- which generated this inline runlevel- for each indexcount- of indices
-
-
Method Detail
-
getInline
public InlineArea getInline()
Obtain inline area that generated this inline run.- Returns:
- inline area that generated this inline run.
-
getMinLevel
public int getMinLevel()
Obtain minimum bidi level for this run.- Returns:
- minimum bidi level
-
getMaxLevel
public int getMaxLevel()
Obtain maximum bidi level for this run.- Returns:
- maximum bidi level
-
setMinMax
private void setMinMax(int[] levels)
-
isHomogenous
public boolean isHomogenous()
Determine if this run has homogenous (same valued) bidi levels.- Returns:
- true if homogenous
-
split
public java.util.List split()
Split this inline run into homogenous runs.- Returns:
- list of new runs
-
updateMinMax
public void updateMinMax(int[] mm)
Update a min/max array to correspond with this run's min/max values.- Parameters:
mm- reference to min/max array
-
maybeNeedsMirroring
public boolean maybeNeedsMirroring()
Determine if run needs mirroring.- Returns:
- true if run is homogenous and (positive) odd (i.e., right to left)
-
reverse
public void reverse()
Reverse run (by incrementing reversal count, not actually reversing).
-
maybeReverseWord
public void maybeReverseWord(boolean mirror)
Reverse inline area if it is a word area and it requires reversal.- Parameters:
mirror- if true then also mirror characters
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
generateLevels
private java.lang.String generateLevels(int[] levels)
-
makeLevels
private static int[] makeLevels(int level, int count)
-
-