public class RMXStringRun
extends java.lang.Object
implements java.lang.Cloneable, java.lang.CharSequence
Constructor and Description |
---|
RMXStringRun()
Creates a new run.
|
RMXStringRun(java.util.Map theAttrs,
int aStart,
int anEnd)
Creates a new run with given attributes at given start/end.
|
Modifier and Type | Method and Description |
---|---|
void |
addLength(int aLength,
int anIndex)
Adds length to run for char index.
|
char |
charAt(int anIndex)
CharSequence method returning character at given index.
|
RMXStringRun |
clone()
Returns a basic clone of this object.
|
RMXStringRun |
cloneDeep(RMXString anXString)
Returns a clone of this run, including a clone of the next run(s) if present.
|
int |
end()
Returns the end character index for this run.
|
boolean |
equals(java.lang.Object anObj)
Returns whether this run is equal to the given object.
|
java.lang.Object |
getAttribute(RMTextTypes.Attribute aKey)
Returns a specific attribute for the given key.
|
java.lang.Object |
getAttribute(RMTextTypes.Attribute aKey,
boolean useDefault)
Returns a specific attribute for the given key.
|
java.util.Map |
getAttributes()
Returns the attributes map.
|
float |
getCharSpacing()
Returns the char spacing.
|
RMColor |
getColor()
Returns the color for this run.
|
RMFont |
getFont()
Returns the font for this run.
|
RMFormat |
getFormat()
Returns the format for this run.
|
RMXStringRun |
getNext()
Return next run.
|
RMXString.Outline |
getOutline()
Returns the outline info for this run (null for none).
|
static RMXString.Outline |
getOutline(java.util.Map attrs)
Returns the Outline record for the given attributes map (or null for none).
|
RMParagraph |
getParagraph()
Returns the paragraph for this run.
|
RMXStringRun |
getRun(int anIndex)
Returns the run at given index.
|
RMXStringRun |
getRunAt(int anIndex,
boolean isInclusive)
Returns the XString run that contains or ends (if given option is true) at given index.
|
int |
getRunCount()
Returns the run count.
|
RMXStringRun |
getRunLast()
Returns the last run.
|
int |
getScripting()
Returns the scripting for this run (1=SuperScripting, -1=Subscripting, 0=none).
|
int |
getUnderlineStyle()
Returns the underline style of this run.
|
static int |
getUnderlineStyle(java.util.Map attrs)
Returns the underline style of this run.
|
RMXString |
getXString()
Returns the xstring that this run works for.
|
boolean |
isUnderlined()
Returns whether this run is underlined.
|
static boolean |
isUnderlined(java.util.Map attrs)
Returns whether this run is underlined.
|
int |
length()
Returns the length in characters for this run.
|
void |
removeLength(int aLength,
int anIndex)
Removes a length from run(s) for char index.
|
void |
setAttribute(RMTextTypes.Attribute aKey,
java.lang.Object aValue)
Adds a specific attribute for the given key (will remove if attribute is null).
|
void |
setAttributes(int aStart,
int anEnd,
java.util.Map theAttrs)
Set attributes.
|
void |
setFont(RMFont aFont)
Sets the font for this run.
|
void |
shift(int anAmount)
Shifts run by given amound.
|
RMXStringRun |
split(int anIndex)
Splits the run at the given index and returns a run containing the remaining characters (and identical attributes).
|
int |
start()
Returns the start character index for this run.
|
java.lang.CharSequence |
subSequence(int aStart,
int anEnd)
CharSequence method return character sequence for range.
|
java.lang.String |
toString()
Returns a string representation of this run.
|
public RMXStringRun()
public RMXStringRun(java.util.Map theAttrs, int aStart, int anEnd)
public RMXString getXString()
public int start()
public int end()
public int length()
length
in interface java.lang.CharSequence
public char charAt(int anIndex)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int aStart, int anEnd)
subSequence
in interface java.lang.CharSequence
public java.util.Map getAttributes()
public java.lang.Object getAttribute(RMTextTypes.Attribute aKey)
public java.lang.Object getAttribute(RMTextTypes.Attribute aKey, boolean useDefault)
public void setAttribute(RMTextTypes.Attribute aKey, java.lang.Object aValue)
public RMFont getFont()
public void setFont(RMFont aFont)
public RMColor getColor()
public RMParagraph getParagraph()
public boolean isUnderlined()
public int getUnderlineStyle()
public static boolean isUnderlined(java.util.Map attrs)
public static int getUnderlineStyle(java.util.Map attrs)
public RMXString.Outline getOutline()
public static RMXString.Outline getOutline(java.util.Map attrs)
public RMFormat getFormat()
public int getScripting()
public float getCharSpacing()
public RMXStringRun getNext()
public int getRunCount()
public RMXStringRun getRun(int anIndex)
public RMXStringRun getRunLast()
public RMXStringRun getRunAt(int anIndex, boolean isInclusive)
public void addLength(int aLength, int anIndex)
public void removeLength(int aLength, int anIndex)
public void shift(int anAmount)
public void setAttributes(int aStart, int anEnd, java.util.Map theAttrs)
public RMXStringRun split(int anIndex)
public boolean equals(java.lang.Object anObj)
equals
in class java.lang.Object
public RMXStringRun clone()
clone
in class java.lang.Object
public RMXStringRun cloneDeep(RMXString anXString)
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object