Package com.ribs

Class RUStrings

java.lang.Object
com.ribs.RUStrings

public class RUStrings extends 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 <info@reportmill.com>.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    delete(String aString, String aSearch)
    Deletes from the given string any occurrance of the search string.
    static boolean
    endsWithIC(String aString, String endString)
    Returns whether given string ends with given search string, ignoring case.
    static float
    floatValue(String aString)
    Returns the float result of parsing the given string as if it were a number.
    static byte[]
    getBytes(String aString)
    Returns the given string as an array of ISO Latin bytes.
    static byte[]
    getBytes(String aString, String enc)
    Returns the given string as an array of bytes in the given encoding.
    static Image
    getImageForString(String aString, Font aFont)
    Returns an image for the given string and font.
    static int
    intValue(String aString)
    Returns the int result of parsing the given string as if it were a number.
    static boolean
    Returns whether string is null or empty.
    static Number
    Uses the NumberFormatter to return the number, whatever the type.
    static String
    replace(String aString, String search, String replace)
    Replaces in the given string any occurrance of the search string with the replace string.
    static List
    separate(String aString, String aSeparator)
    Returns from the given string a list of applicable substrings separated by the separated by the separator string.
    static List
    separate(String aString, 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(String aString, String startString)
    Returns whether given string starts with given search string, ignoring case.
    static String
    stringWrap(String aString, int approximateWidth)
    Wraps aString to an approximate width (quick and dirty line wrapping for use in things like option panes)
    static String
    toString(float aValue)
    Returns the given float value as a string truncated to 3 significant digits.
    static 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 Details

    • RUStrings

      public RUStrings()
  • Method Details

    • isEmpty

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

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

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

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

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

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

      public static List separate(String aString, 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(String aString)
      Returns the int result of parsing the given string as if it were a number.
    • floatValue

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

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

      public static String stringWrap(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 String toString(float aValue)
      Returns the given float value as a string truncated to 3 significant digits.
    • toString

      public static 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(String aString)
      Returns the given string as an array of ISO Latin bytes.
    • getBytes

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

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