gov.usda.gdpc
Interface Filter

All Known Implementing Classes:
AbstractFilter

public interface Filter

Filter used to define search criteria when requesting data from a DBGateway.

Author:
terryc

Method Summary
 void addValue(FilterValue value)
          Adds a value for a particular property for this filter.
 Property[] getDefinedProperties()
          Gets all the properties that have defined criteria.
 Property[] getDefinedProperties(FilterValueType type)
          Gets all the properties that have defined criteria for the given filter value type.
 FilterValueType[] getDefinedTypes()
          Gets all the filter value types that have defined critera.
 java.lang.String getType()
          Get type of this filter.
 FilterValue[] getValues(FilterValueType type)
          Gets all the values set for the given filter value type.
 FilterValue[] getValues(Property property)
          Gets all the values set for the given property.
 FilterValue[] getValues(Property property, FilterValueType type)
          Gets all the values set for the given property and filter value type.
 boolean matches(java.util.Map properties)
          Returns whether the given properties match this filter.
 void resetProperty(Property property)
          Reset the specified property to have no values for this filter.
 

Method Detail

resetProperty

public void resetProperty(Property property)
Reset the specified property to have no values for this filter.

Parameters:
property - property

addValue

public void addValue(FilterValue value)
Adds a value for a particular property for this filter.

Parameters:
value - value

getDefinedProperties

public Property[] getDefinedProperties(FilterValueType type)
Gets all the properties that have defined criteria for the given filter value type.

Parameters:
type - type of value (i.e. SINGLE_VALUE, RANGE, etc.)
Returns:
list of properties

getDefinedProperties

public Property[] getDefinedProperties()
Gets all the properties that have defined criteria.

Returns:
list of properties

getValues

public FilterValue[] getValues(Property property,
                               FilterValueType type)
Gets all the values set for the given property and filter value type.

Parameters:
property - property
type - type of value (i.e. SINGLE_VALUE, RANGE, etc.)
Returns:
list of filter values

getValues

public FilterValue[] getValues(FilterValueType type)
Gets all the values set for the given filter value type.

Parameters:
type - type of value (i.e. SINGLE_VALUE, RANGE, etc.)
Returns:
list of filter values

getValues

public FilterValue[] getValues(Property property)
Gets all the values set for the given property.

Parameters:
property - property
Returns:
list of filter values

getDefinedTypes

public FilterValueType[] getDefinedTypes()
Gets all the filter value types that have defined critera.

Returns:
list of filter value types

matches

public boolean matches(java.util.Map properties)
Returns whether the given properties match this filter.

Parameters:
properties - properties to check
Returns:
true if all properties matches

getType

public java.lang.String getType()
Get type of this filter.

Returns:
type