Class STRINGImpl<C extends IComponent<C>>

java.lang.Object
io.ciera.runtime.summit.util.Utility<C>
io.ciera.runtime.summit.util.impl.STRINGImpl<C>
All Implemented Interfaces:
IActionHome<C>, STRING

public class STRINGImpl<C extends IComponent<C>> extends Utility<C> implements STRING
  • Constructor Details

    • STRINGImpl

      public STRINGImpl(C context)
  • Method Details

    • itoa

      public String itoa(int i)
      Description copied from interface: STRING
      Convert an integer to a string.
      Specified by:
      itoa in interface STRING
      Parameters:
      i - the integer to convert
      Returns:
      the string representation of the input integer
    • atoi

      public int atoi(String s) throws XtumlException
      Description copied from interface: STRING
      Convert a string to an integer.
      Specified by:
      atoi in interface STRING
      Parameters:
      s - the string to parse
      Returns:
      the integer representation of the input string
      Throws:
      XtumlException - if the string cannot be parsed to an integer.
    • substr

      public String substr(String s, int begin, int end)
      Description copied from interface: STRING
      Get a substring of an input string from begin (inclusive) to end (exclusive). If begin < 0, the result is a substring starting at the beginning of s. If begin > the length of s - 1, the result is an empty string. If end < 0 or > the length of s, the result is a substring starting at begin to the end of s. If end <= begin, the result is an empty string.
      Specified by:
      substr in interface STRING
      Parameters:
      s - the input string
      begin - the start index of the substring (inclusive)
      end - the end index of the substring (exclusive)
      Returns:
      the substring of s from begin (inclusive) to end (exclusive)
    • strlen

      public int strlen(String s)
      Description copied from interface: STRING
      Get the length of a string
      Specified by:
      strlen in interface STRING
      Parameters:
      s - the input string
      Returns:
      the length of the input string
    • indexof

      public int indexof(String haystack, String needle)
      Description copied from interface: STRING
      Gets the index of the first occurance of needle in haystack. Returns -1 if needle is not contained in haystack.
      Specified by:
      indexof in interface STRING
      Parameters:
      haystack - the string to search
      needle - the string pattern to search for
      Returns:
      the index of the first occurance of needle in haystack
    • trim

      public String trim(String s)
      Description copied from interface: STRING
      Trim whitespace from the start and end of a string.
      Specified by:
      trim in interface STRING
      Parameters:
      s - the input string
      Returns:
      the input string with all leading and trailing whitespace removed.
    • quote

      public String quote()
      Description copied from interface: STRING
      Return a literal double quote.
      Specified by:
      quote in interface STRING
      Returns:
      a literal double quote
    • escapetics

      public String escapetics(String s)
      Description copied from interface: STRING
      Replace all single quotes with two single quotes for escaping SQL insert statements.
      Specified by:
      escapetics in interface STRING
      Parameters:
      s - the input string
      Returns:
      the input string with all single quotes replaced with two single quotes
    • unescapetics

      public String unescapetics(String s)
      Description copied from interface: STRING
      Replace all occurances of two adjacent single quotes with one single quote for unescaping SQL insert statements.
      Specified by:
      unescapetics in interface STRING
      Parameters:
      s - the input string
      Returns:
      the input string with all occurances of two adjacent single quotes replaced with one single quote
    • replaceall

      public String replaceall(String s, String pattern, String replacement)
      Description copied from interface: STRING
      Replace all occurances of pattern with one replacement quote for unescaping SQL insert statements.
      Specified by:
      replaceall in interface STRING
      Parameters:
      s - the input string
      replacement - the string to insert
      Returns:
      the input string with all occurances of two adjacent single quotes replaced with one single quote