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 Summary
Constructors Constructor Description STRINGImpl(C context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intatoi(String s)Convert a string to an integer.Stringescapetics(String s)Replace all single quotes with two single quotes for escaping SQL insert statements.intindexof(String haystack, String needle)Gets the index of the first occurance ofneedleinhaystack.Stringitoa(int i)Convert an integer to a string.Stringquote()Return a literal double quote.intstrlen(String s)Get the length of a stringStringsubstr(String s, int begin, int end)Get a substring of an input string frombegin(inclusive) toend(exclusive).Stringtrim(String s)Trim whitespace from the start and end of a string.Stringunescapetics(String s)Replace all occurances of two adjacent single quotes with one single quote for unescaping SQL insert statements.-
Methods inherited from class io.ciera.runtime.summit.util.Utility
context, getRunContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ciera.runtime.summit.application.IActionHome
warn
-
-
-
-
Constructor Detail
-
STRINGImpl
public STRINGImpl(C context)
-
-
Method Detail
-
itoa
public String itoa(int i)
Description copied from interface:STRINGConvert an integer to a string.
-
atoi
public int atoi(String s) throws XtumlException
Description copied from interface:STRINGConvert a string to an integer.- Specified by:
atoiin interfaceSTRING- 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:STRINGGet a substring of an input string frombegin(inclusive) toend(exclusive). Ifbegin < 0, the result is a substring starting at the beginning ofs. Ifbegin >the length ofs - 1, the result is an empty string. Ifend < 0or>the length ofs, the result is a substring starting atbeginto the end ofs. Ifend <= begin, the result is an empty string.
-
strlen
public int strlen(String s)
Description copied from interface:STRINGGet the length of a string
-
indexof
public int indexof(String haystack, String needle)
Description copied from interface:STRINGGets the index of the first occurance ofneedleinhaystack. Returns -1 ifneedleis not contained inhaystack.
-
trim
public String trim(String s)
Description copied from interface:STRINGTrim whitespace from the start and end of a string.
-
quote
public String quote()
Description copied from interface:STRINGReturn a literal double quote.
-
escapetics
public String escapetics(String s)
Description copied from interface:STRINGReplace all single quotes with two single quotes for escaping SQL insert statements.- Specified by:
escapeticsin interfaceSTRING- 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:STRINGReplace all occurances of two adjacent single quotes with one single quote for unescaping SQL insert statements.- Specified by:
unescapeticsin interfaceSTRING- Parameters:
s- the input string- Returns:
- the input string with all occurances of two adjacent single quotes replaced with one single quote
-
-