public abstract class SimpleParamSigSearchTerm extends Object
For matching a simple-parameter-name signatures with wildcards ('*'), indicating one or more of any parameter type.
aliteralmind __DASH__ github __AT__ yahoo __DOT__ com), dual-licensed under the LGPL (version 3.0 or later) or the ASL (version 2.0). See source code for details. http://codelet.aliteralmind.com, https://github.com/aliteralmind/codelet| Constructor and Description |
|---|
SimpleParamSigSearchTerm(String search_termSig,
Appendable debugBasics_ifNonNull,
Appendable dbgDoesMatch_ifNonNull)
Create a search term.
|
| Modifier and Type | Method and Description |
|---|---|
StringBuilder |
appendToString(StringBuilder to_appendTo)
The original shortcut as provided to the constructor, with a single space following each comma.
|
boolean |
doesMatch(SimpleParamNameSignature actual_cnstrMthd)
Does a constructor/method match?.
|
protected boolean |
doesMatchAnyProt(List<? extends SimpleParamNameSignature> to_searchList)
Does any constructor/method match?.
|
protected boolean |
doesMatchOnlyOneProt(List<? extends SimpleParamNameSignature> to_searchList)
Does exactly one constructor/method match?.
|
protected List<? extends SimpleParamNameSignature> |
getAllMatchesProt(List<? extends SimpleParamNameSignature> to_searchList,
CrashIfZero crashIf_zero)
Get a new list of all matching constructors/methods.
|
TextAppenter |
getDebugAptrBasics() |
TextAppenter |
getDebugAptrDoesMatch() |
protected SimpleParamNameSignature |
getFirstMatchProt(List<? extends SimpleParamNameSignature> to_searchList,
CrashIfZero crashIf_zero,
CrashIfMoreThanOne crashIf_moreThanOne)
Get the first matching constructor/method.
|
String |
getMethodName()
The function name, or the empty string if a constructor.
|
String |
getNoParams()
The original search-term parameter list, excluding the parentheses.
|
protected SimpleParamNameSignature |
getOnlyMatchProt(List<? extends SimpleParamNameSignature> to_searchList)
Get the first and only match.
|
List<String> |
getTermList()
Immutable list of parameter types (their simple names), where asterisks are replaced with
null. |
String |
getWithParams()
The original search-term parameter list.
|
boolean |
hasAStar()
Is there an asterisk anywhere in the parameter list?.
|
int |
indexOfStar() |
int |
lastIndexOfStar() |
void |
setDebug(Appendable debugBasics_ifNonNull,
Appendable dbgDoesMatch_ifNonNull) |
String |
toString() |
public SimpleParamSigSearchTerm(String search_termSig, Appendable debugBasics_ifNonNull, Appendable dbgDoesMatch_ifNonNull)
Create a search term.
search_termSig - May not be null, must contain parentheses with zero or more parameters, and may contain a function name before the open paren ('('). When provided, the function name must be a valid Java identifier. Multiple parameters are separated by commas, and each is either"[]") or, in the last parameter only, ellipses ("...") (examples: "int", "String", "AClass"), "boolean[]", "String..."), or'*'), indicating one or more of any type. Two asterisks in a row are not permissible.')'). Get with appendToString.public void setDebug(Appendable debugBasics_ifNonNull, Appendable dbgDoesMatch_ifNonNull)
public TextAppenter getDebugAptrBasics()
public TextAppenter getDebugAptrDoesMatch()
public String getMethodName()
The function name, or the empty string if a constructor.
public List<String> getTermList()
Immutable list of parameter types (their simple names), where asterisks are replaced with null.
public String getWithParams()
The original search-term parameter list.
getNoParams()public String getNoParams()
The original search-term parameter list, excluding the parentheses.
getWithParams()public boolean hasAStar()
Is there an asterisk anywhere in the parameter list?.
protected boolean doesMatchAnyProt(List<? extends SimpleParamNameSignature> to_searchList)
Does any constructor/method match?.
(getFirstMatchProt(to_searchList, crashIf_zero, crashIf_moreThanOne) != null)getAllMatchesProt(List, CrashIfZero)protected boolean doesMatchOnlyOneProt(List<? extends SimpleParamNameSignature> to_searchList)
Does exactly one constructor/method match?.
(matchList != null && matchList.size() == 1)
matchList is
getAllMatchesProt(to_searchList, CrashIfZero.NO)getOnlyMatchProt(List)protected List<? extends SimpleParamNameSignature> getAllMatchesProt(List<? extends SimpleParamNameSignature> to_searchList, CrashIfZero crashIf_zero)
Get a new list of all matching constructors/methods.
to_searchList - The actually-existing constructors/methods to search. May not be null.crashIf_zero - If com.github.xbn.lang.reflect.CrashIfZero#YES YES, then zero matches is unacceptable. May not be null.null if no messages match.RTNoSuchMethodException - If zero matches and crashIf_zero is YES.getFirstMatchProt(List, CrashIfZero, CrashIfMoreThanOne)protected SimpleParamNameSignature getOnlyMatchProt(List<? extends SimpleParamNameSignature> to_searchList)
Get the first and only match.
getFirstMatchProt(to_searchList, CrashIfZero.YES, CrashIfMoreThanOne.YES)getAllMatchesProtprotected SimpleParamNameSignature getFirstMatchProt(List<? extends SimpleParamNameSignature> to_searchList, CrashIfZero crashIf_zero, CrashIfMoreThanOne crashIf_moreThanOne)
Get the first matching constructor/method.
to_searchList - The actually-existing constructor/methods to search. May not be null.crashIf_zero - If com.github.xbn.lang.reflect.CrashIfZero#YES YES, then zero matches is unacceptable. May not be null.crashIf_moreThanOne - If com.github.xbn.lang.reflect.CrashIfMoreThanOne#YES YES, then more than one match is unacceptable. May not be null.null if none match.RTNoSuchMethodException - If zero matches and crashIf_zero is YES, or more than one constructor/method matches and crashIf_moreThanOne is YESdoesMatchAnyProtpublic int indexOfStar()
public int lastIndexOfStar()
public boolean doesMatch(SimpleParamNameSignature actual_cnstrMthd)
Does a constructor/method match?.
This function was a beast.
actual_cnstrMthd - May not be null.public String toString()
toString in class ObjectappendToString(new StringBuilder()).toString()public StringBuilder appendToString(StringBuilder to_appendTo)
The original shortcut as provided to the constructor, with a single space following each comma.
This appends .getMethodName() + getWithParams()
Copyright 2014, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
https://github.com/aliteralmind/codelet