Class TextUtils

  • All Implemented Interfaces:
    RMTypes, TextTypes

    public class TextUtils
    extends java.lang.Object
    implements TextTypes
    Text Utilities.
    • Constructor Summary

      Constructors 
      Constructor Description
      TextUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getAttributeKey​(java.lang.Object anAttr)
      Returns the most likely key for a given attribute.
      static java.util.Map getAttributes​(java.lang.Object... theAttrs)
      Returns an attribute map for given attributes.
      static int getUnderlineStyle​(java.util.Map attrs)
      Returns the underline style of this run.
      static int indexAfterNewline​(java.lang.CharSequence aSequence, int aStart)
      Returns the index just beyond next newline (or carriage-return/newline) in given char sequence starting at given char index.
      static int indexOfNewline​(java.lang.CharSequence aSequence, int aStart)
      Returns the index of the next newline (or carriage-return/newline) in given char sequence starting at given char index.
      static boolean isAfterLineEnd​(java.lang.CharSequence aSequence, int anIndex)
      Returns whether the index in the given char sequence is at just after a line end.
      static boolean isLineEnd​(java.lang.CharSequence aSequence, int anIndex)
      Returns whether the index in the given char sequence is at a line end.
      static boolean isNewlineChar​(java.lang.CharSequence aSequence, int anIndex)
      Returns whether a char is a newline char.
      static boolean isUnderlined​(java.util.Map attrs)
      Returns whether this run is underlined.
      static int lastIndexAfterNewline​(java.lang.CharSequence aSequence, int aStart)
      Returns the index just beyond previous newline (or carriage-return/newline) in given char sequence starting at given char index.
      static int lastIndexOfNewline​(java.lang.CharSequence aSequence, int aStart)
      Returns the index of the previous newline (or carriage-return/newline) in given char sequence starting at given char index.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextUtils

        public TextUtils()
    • Method Detail

      • indexOfNewline

        public static int indexOfNewline​(java.lang.CharSequence aSequence,
                                         int aStart)
        Returns the index of the next newline (or carriage-return/newline) in given char sequence starting at given char index.
      • indexAfterNewline

        public static int indexAfterNewline​(java.lang.CharSequence aSequence,
                                            int aStart)
        Returns the index just beyond next newline (or carriage-return/newline) in given char sequence starting at given char index.
      • lastIndexOfNewline

        public static int lastIndexOfNewline​(java.lang.CharSequence aSequence,
                                             int aStart)
        Returns the index of the previous newline (or carriage-return/newline) in given char sequence starting at given char index.
      • lastIndexAfterNewline

        public static int lastIndexAfterNewline​(java.lang.CharSequence aSequence,
                                                int aStart)
        Returns the index just beyond previous newline (or carriage-return/newline) in given char sequence starting at given char index.
      • isLineEnd

        public static boolean isLineEnd​(java.lang.CharSequence aSequence,
                                        int anIndex)
        Returns whether the index in the given char sequence is at a line end.
      • isAfterLineEnd

        public static boolean isAfterLineEnd​(java.lang.CharSequence aSequence,
                                             int anIndex)
        Returns whether the index in the given char sequence is at just after a line end.
      • isNewlineChar

        public static boolean isNewlineChar​(java.lang.CharSequence aSequence,
                                            int anIndex)
        Returns whether a char is a newline char.
      • isUnderlined

        public static boolean isUnderlined​(java.util.Map attrs)
        Returns whether this run is underlined.
      • getUnderlineStyle

        public static int getUnderlineStyle​(java.util.Map attrs)
        Returns the underline style of this run.
      • getAttributes

        public static java.util.Map getAttributes​(java.lang.Object... theAttrs)
        Returns an attribute map for given attributes.
      • getAttributeKey

        public static java.lang.String getAttributeKey​(java.lang.Object anAttr)
        Returns the most likely key for a given attribute.