Class RMXStringRun

java.lang.Object
com.reportmill.base.RMObject
com.reportmill.text.RMXStringRun
All Implemented Interfaces:
RMArchiver.Archiving, Cloneable

public class RMXStringRun extends RMObject
The Run class represents a range of characters in an xstring that share common attributes.

This class makes a point to treat its attributes map as read-only so they can be shared among multiple runs.

  • Constructor Details

    • RMXStringRun

      public RMXStringRun()
      Creates a new run.
    • RMXStringRun

      public RMXStringRun(Map attrs, int start, int length)
      Creates a new run for the given attributes map and character start index and character length.
  • Method Details

    • start

      public int start()
      Returns the start character index for this run.
    • end

      public int end()
      Returns the end character index for this run.
    • length

      public int length()
      Returns the length in characters for this run.
    • getAttributes

      public Map getAttributes()
      Returns the attributes map.
    • get

      public Object get(String aKey)
      Returns a specific attribute for the given key.
    • remove

      public void remove(String aKey)
      Removes a specific attribute for the given key.
    • put

      public void put(String aKey, Object aVal)
      Adds a specific attribute for the given key (will remove if attribute is null).
    • putAll

      public void putAll(Map aMap)
      Adds a map of attributes to this run's attributes.
    • getFont

      public RMFont getFont()
      Returns the font for this run.
    • getColor

      public RMColor getColor()
      Returns the color for this run.
    • getParagraph

      public RMParagraph getParagraph()
      Returns the paragraph for this run.
    • isUnderlined

      public boolean isUnderlined()
      Returns whether this run is underlined.
    • getOutline

      public RMXString.Outline getOutline()
      Returns the outline info for this run (null for none).
    • getFormat

      public RMFormat getFormat()
      Returns the format for this run.
    • getScripting

      public int getScripting()
      Returns the scripting for this run (1=SuperScripting, -1=Subscripting, 0=none).
    • equals

      public boolean equals(Object anObj)
      Returns whether this run is equal to the given object.
      Overrides:
      equals in class Object
    • toString

      public String toString(RMXString anXString)
      Returns a string representation of this run.