Package com.ribs

Class RUStrings


  • public class RUStrings
    extends java.lang.Object
    This class offers a number of useful String utilities used by ribs classes.

    Copyright (c) 2004 ReportMill Software, Inc. All Rights Reserved. Contact ReportMill .

    • Constructor Summary

      Constructors 
      Constructor Description
      RUStrings()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String delete​(java.lang.String aString, java.lang.String aSearch)
      Deletes from the given string any occurrance of the search string.
      static boolean endsWithIC​(java.lang.String aString, java.lang.String endString)
      Returns whether given string ends with given search string, ignoring case.
      static float floatValue​(java.lang.String aString)
      Returns the float result of parsing the given string as if it were a number.
      static byte[] getBytes​(java.lang.String aString)
      Returns the given string as an array of ISO Latin bytes.
      static byte[] getBytes​(java.lang.String aString, java.lang.String enc)
      Returns the given string as an array of bytes in the given encoding.
      static java.awt.Image getImageForString​(java.lang.String aString, java.awt.Font aFont)
      Returns an image for the given string and font.
      static int intValue​(java.lang.String aString)
      Returns the int result of parsing the given string as if it were a number.
      static boolean isEmpty​(java.lang.String s)
      Returns whether string is null or empty.
      static java.lang.Number numberValue​(java.lang.String aString)
      Uses the NumberFormatter to return the number, whatever the type.
      static java.lang.String replace​(java.lang.String aString, java.lang.String search, java.lang.String replace)
      Replaces in the given string any occurrance of the search string with the replace string.
      static java.util.List separate​(java.lang.String aString, java.lang.String aSeparator)
      Returns from the given string a list of applicable substrings separated by the separated by the separator string.
      static java.util.List separate​(java.lang.String aString, java.lang.String aSeparator, boolean stripLeadingSpaces)
      Returns from the given string a list of applicable substrings separated by the separated by the separator string.
      static boolean startsWithIC​(java.lang.String aString, java.lang.String startString)
      Returns whether given string starts with given search string, ignoring case.
      static java.lang.String stringWrap​(java.lang.String aString, int approximateWidth)
      Wraps aString to an approximate width (quick and dirty line wrapping for use in things like option panes)
      static java.lang.String toString​(float aValue)
      Returns the given float value as a string truncated to 3 significant digits.
      static java.lang.String toString​(float aValue, int significantDigits)
      Returns the given float value as a string truncated to the given number of significant digits.
      • Methods inherited from class java.lang.Object

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

      • RUStrings

        public RUStrings()
    • Method Detail

      • isEmpty

        public static boolean isEmpty​(java.lang.String s)
        Returns whether string is null or empty.
      • startsWithIC

        public static boolean startsWithIC​(java.lang.String aString,
                                           java.lang.String startString)
        Returns whether given string starts with given search string, ignoring case.
      • endsWithIC

        public static boolean endsWithIC​(java.lang.String aString,
                                         java.lang.String endString)
        Returns whether given string ends with given search string, ignoring case.
      • delete

        public static java.lang.String delete​(java.lang.String aString,
                                              java.lang.String aSearch)
        Deletes from the given string any occurrance of the search string.
      • replace

        public static java.lang.String replace​(java.lang.String aString,
                                               java.lang.String search,
                                               java.lang.String replace)
        Replaces in the given string any occurrance of the search string with the replace string.
      • separate

        public static java.util.List separate​(java.lang.String aString,
                                              java.lang.String aSeparator)
        Returns from the given string a list of applicable substrings separated by the separated by the separator string.
      • separate

        public static java.util.List separate​(java.lang.String aString,
                                              java.lang.String aSeparator,
                                              boolean stripLeadingSpaces)
        Returns from the given string a list of applicable substrings separated by the separated by the separator string.
      • intValue

        public static int intValue​(java.lang.String aString)
        Returns the int result of parsing the given string as if it were a number.
      • floatValue

        public static float floatValue​(java.lang.String aString)
        Returns the float result of parsing the given string as if it were a number.
      • numberValue

        public static java.lang.Number numberValue​(java.lang.String aString)
        Uses the NumberFormatter to return the number, whatever the type.
      • stringWrap

        public static java.lang.String stringWrap​(java.lang.String aString,
                                                  int approximateWidth)
        Wraps aString to an approximate width (quick and dirty line wrapping for use in things like option panes)
      • toString

        public static java.lang.String toString​(float aValue)
        Returns the given float value as a string truncated to 3 significant digits.
      • toString

        public static java.lang.String toString​(float aValue,
                                                int significantDigits)
        Returns the given float value as a string truncated to the given number of significant digits.
      • getBytes

        public static byte[] getBytes​(java.lang.String aString)
        Returns the given string as an array of ISO Latin bytes.
      • getBytes

        public static byte[] getBytes​(java.lang.String aString,
                                      java.lang.String enc)
        Returns the given string as an array of bytes in the given encoding.
      • getImageForString

        public static java.awt.Image getImageForString​(java.lang.String aString,
                                                       java.awt.Font aFont)
        Returns an image for the given string and font.