|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.field.IntegerFieldValuePattern
Integer implementation of the FieldValuePattern interface. This object provides a mechanism to specify Integer specific patterns. This object contains the necessary logic to match Integer and String values to the specified pattern.
| Constructor Summary | |
IntegerFieldValuePattern(String pattern)
Create a new IntegerFieldValuePattern. |
|
| Method Summary | |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
String |
getPattern()
Get a String representation of the pattern. |
int |
hashCode()
Get the hashCode of the IntegerFieldValuePattern object. |
boolean |
matches(Object fieldValue)
Check for a pattern match. |
BigDecimal |
score()
Get the score of the FieldValuePattern. |
String |
toString()
Returns a string representation of the object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public IntegerFieldValuePattern(String pattern)
throws InvalidPatternException
This pattern value must be either "*" or a parsable integer value. Failure to follow these two constraints will result in a InvalidPatternException being thrown.
pattern - the String representation of the pattern.
InvalidPatternException - if the pattern is null, or
if the pattern does not equal * and is not a valid integer value.| Method Detail |
public boolean matches(Object fieldValue)
Matching is done using the following algorithm.
matches in interface FieldValuePatternpublic String getPattern()
getPattern in interface FieldValuePatternpublic BigDecimal score()
The FieldValuePattern's score is a value that determines how specific a particular a pattern is. It is a mechanism that allows the implementor to decided how specific a pattern is. For example, a concrete string value of "abcde" is much more specific than a string that contains a wildcard such as "abcd*". Therefore, this method allows for the calculation of that value.
The score of the IntegerFieldValuePattern is calculated using the following algorithm:
score in interface FieldValuePatternpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectobj - the reference object with which to compare.
public String toString()
toString in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||