|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.billpringle.utils.WrpPattern
public class WrpPattern
This class translates content strings into pattern strings, reflecting the type of characters in the original strings.
This class allows the user to determine the general pattern of a data string, such as all numeric, alphabetic, etc. Pattern indicators include the following:
This class can also be used to remove any characters that doesn't match a given pattern. The following types of patterns are supported. The following codes are case-insensitive.
![]() |
![]() |
Unless noted otherwise, all materials available for download from my site are copyrighted by Bill Pringle, and are licensed under a Creative Commons License. |
Field Summary | |
---|---|
private boolean |
caseFlg
case sensitive flag |
private java.lang.String |
inString
input string - output pattern based on this string |
private java.lang.String |
pattern
pattern key - what kind of pattern |
Constructor Summary | |
---|---|
WrpPattern()
Default constructor |
|
WrpPattern(java.lang.String str)
Constructor using default pattern and specified string |
Method Summary | |
---|---|
java.lang.String |
applyPattern(java.lang.String fld)
Apply the previously specified pattern against the specified field string. |
java.lang.String |
applyPattern(java.lang.String str,
java.lang.String patt)
Apply the specified pattern to the specified string. |
java.lang.String |
getPattern()
|
java.lang.String |
getString()
|
private void |
init()
Initialization routine. |
boolean |
isCaseFlg()
|
static void |
main(java.lang.String[] args)
|
void |
setCaseFlg(boolean caseFlg)
|
void |
setPattern(java.lang.String pattern)
Define a pattern This method stores the specified pattern for later use. |
void |
setString(java.lang.String str)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String inString
private java.lang.String pattern
private boolean caseFlg
Constructor Detail |
---|
public WrpPattern()
public WrpPattern(java.lang.String str)
str
- Method Detail |
---|
private void init()
public void setPattern(java.lang.String pattern)
public java.lang.String applyPattern(java.lang.String str, java.lang.String patt)
str
- the string for which a pattern is to be builtpatt
- the pattern code to be used in builing the resulting pattern
public java.lang.String applyPattern(java.lang.String fld)
fld
- the input string
public void setString(java.lang.String str)
public java.lang.String getString()
public java.lang.String getPattern()
public static void main(java.lang.String[] args)
args
- public boolean isCaseFlg()
public void setCaseFlg(boolean caseFlg)
caseFlg
- the caseFlg to set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |