| Modifier and Type | Class and Description |
|---|---|
| private static class | MethodRankHelper.NullObject
This is a small wrapper for nulls |
| private static class | |
| private static class | MethodRankHelper.RankableConstructor
This class wraps a method object and a score variable so methods Can easily be ranked by their likeness to a another method |
| private static class | MethodRankHelper.RankableField
This class wraps a method object and a score variable so methods Can easily be ranked by their likeness to a another method |
| private static class | MethodRankHelper.RankableMethod
This class wraps a method object and a score variable so methods Can easily be ranked by their likeness to a another method |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| private static final Object[] | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected static Class | |
| private static boolean | Returns: true if the characters are equalthe first character a, char the second character b)Compares two characters whilst ignoring case. |
| public static int | Returns: the edit distance between the two arraysan Object array s, Object[] this array is compared to s t)This is a implementation of DL distance between two Object arrays instead of character streams. |
| public static int | Returns: a value representing the edit distance between s and ta CharSequence s, CharSequence the CharSequence to be compared to s t)This is a slightly modified version of the Damerau Levenshtein distance algorithm. |
| private static Class | |
| private static List | |
| public static String | Returns: a string with probable solutions to the exceptionthe class on which the constructor is invoked type, Object[] the arguments passed to the constructor arguments)Returns a string detailing possible solutions to a missing constructor if no good solutions can be found a empty string is returned. |
| public static String | Returns: a string with probable solutions to the exceptionthe name of the method that doesn't exist methodName, Class<T> the class on which the method is invoked type, Object[] the arguments passed to the method arguments)Returns a string detailing possible solutions to a missing method if no good solutions can be found a empty string is returned. |
| public static String | Returns: a string with probable solutions to the exceptionthe missing field fieldName, Class<T> the class on which the field is sought type)Returns a string detailing possible solutions to a missing field or property if no good solutions can be found a empty string is returned. |
| private static String | Returns: the Class namesthe array of Classes cachedClasses)creates a comma separated list of each of the class names. |
| private static String | |
| private static Constructor | Returns: a sorted lists of MethodsReturns a sorted(ranked) list of a selection of the constructors among candidates which most closely resembles original. |
| private static List | Returns: a sorted lists of MethodsReturns a sorted(ranked) list of a selection of the methods among candidates which most closely resembles original. |
| DL_CASE | back to summary |
|---|---|
| public static final int DL_CASE | |
| DL_DELETE | back to summary |
|---|---|
| public static final int DL_DELETE | |
| DL_SUBSTITUTION | back to summary |
|---|---|
| public static final int DL_SUBSTITUTION | |
| DL_TRANSPOSITION | back to summary |
|---|---|
| public static final int DL_TRANSPOSITION | |
| EMPTY_OBJECT_ARRAY | back to summary |
|---|---|
| private static final Object[] EMPTY_OBJECT_ARRAY | |
| MAX_CONSTRUCTOR_SCORE | back to summary |
|---|---|
| public static final int MAX_CONSTRUCTOR_SCORE | |
| MAX_FIELD_SCORE | back to summary |
|---|---|
| public static final int MAX_FIELD_SCORE | |
| MAX_METHOD_SCORE | back to summary |
|---|---|
| public static final int MAX_METHOD_SCORE | |
| MAX_RECOMENDATIONS | back to summary |
|---|---|
| public static final int MAX_RECOMENDATIONS | |
| MethodRankHelper | back to summary |
|---|---|
| public MethodRankHelper() | |
| boxVar | back to summary |
|---|---|
| protected static Class If c is a primitive class this method returns a boxed version otherwise c is returned. In java 1.5 this can be simplified thanks to the Type class.
| |
| caselessCompare | back to summary |
|---|---|
| private static boolean caselessCompare(char a, char b) Compares two characters whilst ignoring case.
| |
| damerauLevenshteinDistance | back to summary |
|---|---|
| public static int damerauLevenshteinDistance(Object[] s, Object[] t) This is a implementation of DL distance between two Object arrays instead of character streams. The objects are compared using their equals method. No objects may be null. This implementation is based on Chas Emerick's implementation of Levenshtein Distance for jakarta commons. | |
| delDistance | back to summary |
|---|---|
| public static int delDistance(CharSequence s, CharSequence t) This is a slightly modified version of the Damerau Levenshtein distance algorithm. It has a additional test to see if a character has switched case, in the original algorithm this counts as a substitution. The "cost" for a substitution is given as 10 instead of 1 in this version, this enables transpositions and case modifications to have a lower cost than substitutions. Currently the lowercase versions of t_j and s_i isn't cached, its probable that some speed could be gained from this. This version is based on Chas Emerick's implementation of Levenshtein Distance for jakarta commons.
| |
| getArgumentClasses | back to summary |
|---|---|
| private static Class | |
| getConflictClasses | back to summary |
|---|---|
| private static List | |
| getConstructorSuggestionString | back to summary |
|---|---|
| public static String getConstructorSuggestionString(Class<T> type, Object[] arguments) Returns a string detailing possible solutions to a missing constructor if no good solutions can be found a empty string is returned. | |
| getMethodSuggestionString | back to summary |
|---|---|
| public static String getMethodSuggestionString(String methodName, Class<T> type, Object[] arguments) Returns a string detailing possible solutions to a missing method if no good solutions can be found a empty string is returned. | |
| getPropertySuggestionString | back to summary |
|---|---|
| public static String getPropertySuggestionString(String fieldName, Class<T> type) Returns a string detailing possible solutions to a missing field or property if no good solutions can be found a empty string is returned. | |
| listParameterNames | back to summary |
|---|---|
| private static String listParameterNames(Class<T>[] cachedClasses) creates a comma separated list of each of the class names. | |
| listParameterNames | back to summary |
|---|---|
| private static String listParameterNames(CachedClass[] cachedClasses) | |
| rankConstructors | back to summary |
|---|---|
| private static Constructor Returns a sorted(ranked) list of a selection of the constructors among candidates which most closely resembles original.
| |
| rankMethods | back to summary |
|---|---|
| private static List Returns a sorted(ranked) list of a selection of the methods among candidates which most closely resembles original.
| |
| Access | Constructor and Description |
|---|---|
| private |
| NullObject | back to summary |
|---|---|
| private NullObject() | |
| Access | Constructor and Description |
|---|---|
| public |
| Pair | back to summary |
|---|---|
| public Pair(U u, V v) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Constructor | |
| pack-priv final Integer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(Object
the object to be compared. o)Implements java. |
| c | back to summary |
|---|---|
| pack-priv final Constructor<T> c | |
| score | back to summary |
|---|---|
| pack-priv final Integer score | |
| RankableConstructor | back to summary |
|---|---|
| public RankableConstructor(Class<T>[] argumentTypes, Constructor<T> c) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final MetaProperty | |
| pack-priv final Integer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(Object
the object to be compared. o)Implements java. |
| f | back to summary |
|---|---|
| pack-priv final MetaProperty f | |
| score | back to summary |
|---|---|
| pack-priv final Integer score | |
| RankableField | back to summary |
|---|---|
| public RankableField(String name, MetaProperty mp) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final MetaMethod | |
| pack-priv final Integer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(Object
the object to be compared. o)Implements java. |
| m | back to summary |
|---|---|
| pack-priv final MetaMethod m | |
| score | back to summary |
|---|---|
| pack-priv final Integer score | |
| RankableMethod | back to summary |
|---|---|
| public RankableMethod(String name, Class<T>[] argumentTypes, MetaMethod m2) | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Object o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |