public abstract class CompareFilter extends AbstractFilter
Constructor and Description |
---|
CompareFilter(java.lang.String attribute,
int value)
Convenience constructor for
int values. |
CompareFilter(java.lang.String attribute,
java.lang.String value) |
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuffer |
encode(java.lang.StringBuffer buff)
Encodes the filter to a StringBuffer.
|
protected java.lang.String |
encodeValue(java.lang.String value)
Override to perform special encoding in subclass.
|
boolean |
equals(java.lang.Object o)
Compares key and value before encoding.
|
protected abstract java.lang.String |
getCompareString()
Implement this method in subclass to return a String representing the
operator.
|
int |
hashCode()
Calculate the hash code for the attribute and the value.
|
encode, toString
public CompareFilter(java.lang.String attribute, java.lang.String value)
public CompareFilter(java.lang.String attribute, int value)
int
values.attribute
- Name of attribute in filter.value
- The value of the attribute in the filter.protected java.lang.String encodeValue(java.lang.String value)
value
- the value to encode.public java.lang.StringBuffer encode(java.lang.StringBuffer buff)
Filter
encode
in interface Filter
encode
in class AbstractFilter
buff
- The StringBuffer to encode the filter topublic boolean equals(java.lang.Object o)
equals
in interface Filter
equals
in class java.lang.Object
true
if the objects are equal.Filter.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Filter
hashCode
in class java.lang.Object
Object.hashCode()
Filter.hashCode()
protected abstract java.lang.String getCompareString()
EqualsFilter.getCompareString()
would for example
return an equals sign, "=".