org.palo.api.subsets.filter.settings
Class AttributeConstraint

java.lang.Object
  extended by org.palo.api.subsets.filter.settings.AttributeConstraint

public class AttributeConstraint
extends java.lang.Object

AttributeFilterColumnEntry

This class defines a constraint for an Attribute. A constraint consists of an operator and an attribute value.

Version:
$Id: AttributeConstraint.html,v 1.4 2009/07/09 11:01:46 ArndHouben Exp $

Field Summary
static java.lang.String[] ALL_OPERATORS
           
static java.lang.String EQUAL
           
static java.lang.String GREATER
           
static java.lang.String GREATER_EQUAL
           
static java.lang.String LESS
           
static java.lang.String LESS_EQUAL
           
static java.lang.String NONE
           
static java.lang.String NOT_EQUAL
           
 
Constructor Summary
AttributeConstraint(java.lang.String attrId)
          Creates a new AttributeConstraint instance for the attribute which is specified by the given name.
 
Method Summary
 boolean accept(java.lang.String attrValue, int attrType)
          Checks if the given attribute value is accepted, i.e. fulfills the attribute constraint defined by this instance.
 void bind(Subset2 subset)
          Binds this instance to the given Subset2 NOTE: PLEASE DON'T USE!
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAttributeId()
          Returns the name of the attribute this constrain belongs to
 java.lang.String getOperator()
          Returns the currently used constrain operator
 int getOperatorIndex()
          Returns the index in the ALL_OPERATORS array of the currently used operator.
 java.lang.String getValue()
          Returns the currently used constrain value
 int hashCode()
           
 boolean isOperator(java.lang.String operator)
          Checks if the given operator string is valid
 void setOperator(java.lang.String operator)
          Sets the constrain operator to use.
 void setValue(java.lang.String value)
          Sets the constrain value to use
 void unbind()
          Releases this instance from a previously binded Subset2 NOTE: PLEASE DON'T USE!
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final java.lang.String NONE
See Also:
Constant Field Values

LESS

public static final java.lang.String LESS
See Also:
Constant Field Values

LESS_EQUAL

public static final java.lang.String LESS_EQUAL
See Also:
Constant Field Values

GREATER

public static final java.lang.String GREATER
See Also:
Constant Field Values

GREATER_EQUAL

public static final java.lang.String GREATER_EQUAL
See Also:
Constant Field Values

NOT_EQUAL

public static final java.lang.String NOT_EQUAL
See Also:
Constant Field Values

EQUAL

public static final java.lang.String EQUAL
See Also:
Constant Field Values

ALL_OPERATORS

public static final java.lang.String[] ALL_OPERATORS
Constructor Detail

AttributeConstraint

public AttributeConstraint(java.lang.String attrId)
Creates a new AttributeConstraint instance for the attribute which is specified by the given name.

Parameters:
attrName - the attribute to which this constrain belongs
Method Detail

getAttributeId

public final java.lang.String getAttributeId()
Returns the name of the attribute this constrain belongs to

Returns:
the attribute name

getOperator

public final java.lang.String getOperator()
Returns the currently used constrain operator

Returns:
currently used constrain operator

setOperator

public final void setOperator(java.lang.String operator)
Sets the constrain operator to use. Note that the operator must be valid, i.e. it should be in the ALL_OPERATORS array, otherwise this method has no effect.


getValue

public final java.lang.String getValue()
Returns the currently used constrain value

Returns:
currently used constrain value

setValue

public final void setValue(java.lang.String value)
Sets the constrain value to use

Parameters:
value - the new constraint value

accept

public final boolean accept(java.lang.String attrValue,
                            int attrType)
Checks if the given attribute value is accepted, i.e. fulfills the attribute constraint defined by this instance.

Parameters:
attrValue - the attribute value to check
Returns:
true if the attribute value fulfills this constrain, false otherwise

getOperatorIndex

public final int getOperatorIndex()
Returns the index in the ALL_OPERATORS array of the currently used operator.

Returns:
the operator index in ALL_OPERATORS

isOperator

public final boolean isOperator(java.lang.String operator)
Checks if the given operator string is valid

Parameters:
operator - an operator string to check
Returns:
true if the given string represents an operator, false otherwise

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

bind

public final void bind(Subset2 subset)

Binds this instance to the given Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD

Parameters:
subset -

unbind

public final void unbind()

Releases this instance from a previously binded Subset2

NOTE: PLEASE DON'T USE! INTERNAL METHOD