|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.billpringle.utils.wrputils.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 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 str)
Apply the default pattern to the specified string. |
static java.lang.String |
applyPattern(java.lang.String fld,
java.lang.String patt)
Apply the previously specified pattern against the specified field string. |
java.lang.String |
getPattern()
Get the default pattern. |
java.lang.String |
getString()
Get the default input string. |
private void |
init()
Initialization routine. |
static void |
main(java.lang.String[] args)
Test driver. |
java.lang.String |
patternString(java.lang.String patt)
Apply the default pattern to the specified string. |
void |
setPattern(java.lang.String pattern)
Define the default pattern. |
void |
setString(java.lang.String str)
Set the default string. |
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
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)
str
- the string for which a pattern is to be built
public java.lang.String patternString(java.lang.String patt)
patt
- the pattern to be applied
public static java.lang.String applyPattern(java.lang.String fld, java.lang.String patt)
fld
- the input stringpatt
- the pattern code to be used in builing the resulting pattern
public void setString(java.lang.String str)
str
- the default input stringpublic java.lang.String getString()
public java.lang.String getPattern()
public static void main(java.lang.String[] args)
args
- not used
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |