Class AlphaNumeric


  • public abstract class AlphaNumeric
    extends java.lang.Object
    Convenience classes for parsing and manipulating Strings.
    Author:
    Mike Davidson
    • Constructor Summary

      Constructors 
      Constructor Description
      AlphaNumeric()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String parseAndReplace​(java.lang.String str, char replacement)
      Any character in the passed string which does not match one of the following values is replaced by the specified replacement character.
      static java.lang.String parseAndReplaceExcept​(java.lang.String str, char replacement, java.lang.String except)
      Any character in the passed string which does not match one of the following values is replaced by the specified replacement character, unless it is contained in the exception string.
      static java.lang.String parseAndTrim​(java.lang.String str)
      Any character in the passed string which does not match one of the following values is replaced by an Ascii space and then trimmed from the resulting string.
      • Methods inherited from class java.lang.Object

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

      • AlphaNumeric

        public AlphaNumeric()
    • Method Detail

      • parseAndReplace

        public static java.lang.String parseAndReplace​(java.lang.String str,
                                                       char replacement)
        Any character in the passed string which does not match one of the following values is replaced by the specified replacement character. Ascii chars: 0 - 9 (Decimal 48 - 57) A - Z (Decimal 65 - 90) a - z (Decimal 97 - 122) For example: 'Ethernet 10/100' is converted to 'Ethernet_10_100'
        Parameters:
        str - string to be converted
        replacement - replacement character
        Returns:
        Converted value which can be used in a file name.
      • parseAndReplaceExcept

        public static java.lang.String parseAndReplaceExcept​(java.lang.String str,
                                                             char replacement,
                                                             java.lang.String except)
        Any character in the passed string which does not match one of the following values is replaced by the specified replacement character, unless it is contained in the exception string. Ascii chars: 0 - 9 (Decimal 48 - 57) A - Z (Decimal 65 - 90) a - z (Decimal 97 - 122) For example: 'Ethernet 10/100' is converted to 'Ethernet_10_100'
        Parameters:
        str - string to be converted
        replacement - replacement character
        except - string containing exception characters
        Returns:
        Converted value which can be used in a file name.
      • parseAndTrim

        public static java.lang.String parseAndTrim​(java.lang.String str)
        Any character in the passed string which does not match one of the following values is replaced by an Ascii space and then trimmed from the resulting string. Ascii chars: 0 - 9 (Decimal 48 - 57) A - Z (Decimal 65 - 90) a - z (Decimal 97 - 122)
        Parameters:
        str - string to be converted
        Returns:
        Converted value.