|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.shlublu.javax.lang.StringSubstitutor
String convenience tool for substitutions.
| Constructor Summary | |
StringSubstitutor()
Empty constructor |
|
StringSubstitutor(java.lang.String strDataGiven)
Convenience constructor |
|
| Method Summary | |
int |
count(java.lang.String strToken)
Return the number of occurences of the token in the contained string |
int |
count(java.lang.String strToken,
int iStartIndex)
Return the number of occurences of the token in the contained string, starting the search from iStartIndex. |
int |
delete(java.lang.String strToken)
Parse the contained string to remove the strToken occurences. |
int |
delete(java.lang.String strToken,
int iStart)
Parse the contained string starting from the given index, removing the strToken occurences. |
java.util.Vector |
getOccurences(java.lang.String strToken)
Return the occurences of strToken in the contained string. |
java.util.Vector |
getOccurences(java.lang.String strToken,
int iStart)
Return the occurences of strToken located after iStart in the contained string. |
int |
replace(java.lang.String strToken,
java.lang.String strBy)
Parse the contained string to replace strToken by strBy. |
int |
replace(java.lang.String strToken,
java.lang.String strBy,
int iStart)
Parse the contained string starting from the given index, replacing strToken by strBy. |
void |
setData(java.lang.String strData)
Set the string to parse. |
java.lang.String |
toString()
Return the parsed string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public StringSubstitutor(java.lang.String strDataGiven)
String - strData The string to parsepublic StringSubstitutor()
| Method Detail |
public final void setData(java.lang.String strData)
strData - The string to parse. Shouldn't be null if you plan to call replacepublic final java.lang.String toString()
toString in class java.lang.Object
public final int replace(java.lang.String strToken,
java.lang.String strBy)
replace(strToken, strBy, 0)strToken - The token to replace. Musn't be null.strBy - The replace by sequence. Musn't be null.replace(java.lang.String,java.lang.String,int)
public final int replace(java.lang.String strToken,
java.lang.String strBy,
int iStart)
strToken - The token to replace. Musn't be null.strBy - The replace by sequence. Musn't be null.iStart - The starting index (included)NullPointerException - when one of the argument or the source string is nulljava.lang.IllegalArgumentException - when iStart is < 0public final int delete(java.lang.String strToken)
strToken - The token to replace. Musn't be null.NullPointerException - when one of the argument or the source string is nulljava.lang.IllegalArgumentException - when iStart is < 0
public final int delete(java.lang.String strToken,
int iStart)
strToken - The token to replace. Musn't be null.iStart - The starting index (included)NullPointerException - when one of the argument or the source string is nulljava.lang.IllegalArgumentException - when iStart is < 0public final int count(java.lang.String strToken)
strToken - The token
public final int count(java.lang.String strToken,
int iStartIndex)
strToken - The tokeniStartIndex - The beginning indexpublic final java.util.Vector getOccurences(java.lang.String strToken)
strToken - The token string
public final java.util.Vector getOccurences(java.lang.String strToken,
int iStart)
strToken - The token stringiStart - The starting index in the contained string
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||