public class WildcardStringParser extends Object
This task is performed based on regular expression techniques. The possibilities of string generation with the well-known wildcard characters stated above, represent a subset of the possibilities of string generation with regular expressions.
Examples of usage:
WildcardStringParser parser = new WildcardStringParser("*_28????.jp*"); if (parser.parseString("gupu_280915.jpg")) { System.out.println("Accepted!"); } else { System.out.println("Not accepted!"); }
Theories and concepts are based on the book Elements of the Theory of Computation, by Harry l. Lewis and Christos H. Papadimitriou, (c) 1981 by Prentice Hall.
Modifier and Type | Field | Description |
---|---|---|
static char[] |
ALPHABET |
Deprecated.
Field ALPHABET
|
static char |
FREE_PASS_CHARACTER |
Deprecated.
Field FREE_PASS_CHARACTER
|
static char |
FREE_RANGE_CHARACTER |
Deprecated.
Field FREE_RANGE_CHARACTER
|
Constructor | Description |
---|---|
WildcardStringParser(String pStringMask) |
Deprecated.
Creates a wildcard string parser.
|
WildcardStringParser(String pStringMask,
boolean pDebugging) |
Deprecated.
Creates a wildcard string parser.
|
WildcardStringParser(String pStringMask,
boolean pDebugging,
PrintStream pDebuggingPrintStream) |
Deprecated.
Creates a wildcard string parser.
|
Modifier and Type | Method | Description |
---|---|---|
protected Object |
clone() |
Deprecated.
|
boolean |
equals(Object pObject) |
Deprecated.
Method equals
|
protected void |
finalize() |
Deprecated.
|
String |
getStringMask() |
Deprecated.
Gets the string mask that was used when building the parser atomaton.
|
int |
hashCode() |
Deprecated.
Method hashCode
|
static boolean |
isFreePassCharacter(char pCharToCheck) |
Deprecated.
Tests if a certain character is the designated "free-pass" character ('?').
|
static boolean |
isFreeRangeCharacter(char pCharToCheck) |
Deprecated.
Tests if a certain character is the designated "free-range" character ('*').
|
static boolean |
isInAlphabet(char pCharToCheck) |
Deprecated.
Tests if a certain character is a valid character in the alphabet that is applying for this automaton.
|
static boolean |
isWildcardCharacter(char pCharToCheck) |
Deprecated.
Tests if a certain character is a wildcard character ('*' or '?').
|
boolean |
parseString(String pStringToParse) |
Deprecated.
Parses a string according to the rules stated above.
|
String |
toString() |
Deprecated.
Method toString
|
public static final char[] ALPHABET
public static final char FREE_RANGE_CHARACTER
public static final char FREE_PASS_CHARACTER
public WildcardStringParser(String pStringMask)
pStringMask
- the wildcard string mask.public WildcardStringParser(String pStringMask, boolean pDebugging)
pStringMask
- the wildcard string mask.pDebugging
- true
will cause debug messages to be emitted to System.out
.public WildcardStringParser(String pStringMask, boolean pDebugging, PrintStream pDebuggingPrintStream)
pStringMask
- the wildcard string mask.pDebugging
- true
will cause debug messages to be emitted.pDebuggingPrintStream
- the java.io.PrintStream
to which the debug messages will be emitted.public static boolean isInAlphabet(char pCharToCheck)
public static boolean isFreeRangeCharacter(char pCharToCheck)
public static boolean isFreePassCharacter(char pCharToCheck)
public static boolean isWildcardCharacter(char pCharToCheck)
public String getStringMask()
public boolean parseString(String pStringToParse)
pStringToParse
- the string to parse.true
if and only if the string are accepted by the automaton.public String toString()
public boolean equals(Object pObject)
public int hashCode()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2018. All rights reserved.