gov.usda.gdpc
Class AbstractFilter

java.lang.Object
  extended bygov.usda.gdpc.AbstractFilter
All Implemented Interfaces:
Filter
Direct Known Subclasses:
EnvironmentExperimentFilter, GenotypeExperimentFilter, GenotypeFilter, LocalityFilter, LocusFilter, PhenotypeFilter, PhenotypeOntologyFilter, TaxonFilter

public abstract class AbstractFilter
extends java.lang.Object
implements Filter

This class provides a skeletal implementation of the Filter interface to minimize the effort required to implement this interface.

Author:
terryc

Constructor Summary
protected AbstractFilter()
          AbstractFilter constructor.
 
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 element.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFilter

protected AbstractFilter()
AbstractFilter constructor.

Method Detail

resetProperty

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

Specified by:
resetProperty in interface Filter
Parameters:
property - property

addValue

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

Specified by:
addValue in interface Filter
Parameters:
value - value

getDefinedProperties

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

Specified by:
getDefinedProperties in interface Filter
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.

Specified by:
getDefinedProperties in interface Filter
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.

Specified by:
getValues in interface Filter
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.

Specified by:
getValues in interface Filter
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.

Specified by:
getValues in interface Filter
Parameters:
property - property
Returns:
list of filter values

getDefinedTypes

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

Specified by:
getDefinedTypes in interface Filter
Returns:
list of filter value types

matches

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

Specified by:
matches in interface Filter
Parameters:
properties - properties to check
Returns:
true if all properties matches

getType

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

Specified by:
getType in interface Filter
Returns:
type