Class InlineRun
- java.lang.Object
-
- org.apache.fop.complexscripts.bidi.InlineRun
-
public class InlineRun extends java.lang.Object
TheInlineRun
class 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 boolean
equals(java.lang.Object o)
private java.lang.String
generateLevels(int[] levels)
InlineArea
getInline()
Obtain inline area that generated this inline run.int
getMaxLevel()
Obtain maximum bidi level for this run.int
getMinLevel()
Obtain minimum bidi level for this run.int
hashCode()
boolean
isHomogenous()
Determine if this run has homogenous (same valued) bidi levels.private static int[]
makeLevels(int level, int count)
boolean
maybeNeedsMirroring()
Determine if run needs mirroring.void
maybeReverseWord(boolean mirror)
Reverse inline area if it is a word area and it requires reversal.void
reverse()
Reverse run (by incrementing reversal count, not actually reversing).private void
setMinMax(int[] levels)
java.util.List
split()
Split this inline run into homogenous runs.java.lang.String
toString()
void
updateMinMax(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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
generateLevels
private java.lang.String generateLevels(int[] levels)
-
makeLevels
private static int[] makeLevels(int level, int count)
-
-