Class AbstractPropertyQuery<T>

java.lang.Object
repast.simphony.query.AbstractPropertyQuery<T>
All Implemented Interfaces:
Query<T>
Direct Known Subclasses:
PropertyEquals, PropertyGreaterThan, PropertyGreaterThanEquals, PropertyLessThan, PropertyLessThanEquals, PropertyNotEquals

public abstract class AbstractPropertyQuery<T> extends Object implements Query<T>
Deprecated.
Use Context.getObjectsAsStream(Class) and the Java 8+ streaming API Stream instead.
Abstact implementation of a query that queries based on an object's property. A property is defined in the standard java bean way as a getter or setter, such that the presence of a getFoo or setFoo method defines a "foo" property.
Version:
$Revision$ $Date$
Author:
Nick Collier
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final Object[]
    Deprecated.
     
    protected static final simphony.util.messages.MessageCenter
    Deprecated.
     
    protected static Set<Class>
    Deprecated.
     
    protected Object
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractPropertyQuery(Context<T> context, String propertyName, Object propertyValue)
    Deprecated.
    Creates an AbstractProperty query to query the specified contexts using the specified property name and value.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract org.apache.commons.collections15.Predicate<T>
    createPredicate(Context<T> context, String propertyName)
    Deprecated.
    Implemented by subclasses to return the appropriate Predicate.
    org.apache.commons.collections15.Predicate<T>
    Deprecated.
    Gets the Predicate that will be used in this Predicate's next call to query().
    protected void
    propertyNotFound(String propertyName)
    Deprecated.
     
    Deprecated.
    Returns the result of the query.
    query(Iterable<T> iter)
    Deprecated.
    Returns an iterable over the objects that are the result of the query and are in the passed in iterable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • msgCenter

      protected static final simphony.util.messages.MessageCenter msgCenter
      Deprecated.
    • EMPTY

      protected static final Object[] EMPTY
      Deprecated.
    • primNums

      protected static Set<Class> primNums
      Deprecated.
    • propertyValue

      protected Object propertyValue
      Deprecated.
  • Constructor Details

    • AbstractPropertyQuery

      public AbstractPropertyQuery(Context<T> context, String propertyName, Object propertyValue)
      Deprecated.
      Creates an AbstractProperty query to query the specified contexts using the specified property name and value.
      Parameters:
      context -
      propertyName -
      propertyValue -
  • Method Details

    • getQueryPredicate

      public org.apache.commons.collections15.Predicate<T> getQueryPredicate()
      Deprecated.
      Gets the Predicate that will be used in this Predicate's next call to query().
      Returns:
      the Predicate that will be used in this Predicate's next call to query().
    • createPredicate

      protected abstract org.apache.commons.collections15.Predicate<T> createPredicate(Context<T> context, String propertyName)
      Deprecated.
      Implemented by subclasses to return the appropriate Predicate. For example, a property equals query predicate will return true if an object has that property and its value is equal to the value specified in the constructor.
      Parameters:
      context -
      propertyName -
      Returns:
      the Predicate appropriate to the implementing sub class.
    • query

      public Iterable<T> query()
      Deprecated.
      Returns the result of the query.
      Specified by:
      query in interface Query<T>
      Returns:
      an iterable over the objects that are the result of the query.
    • propertyNotFound

      protected void propertyNotFound(String propertyName)
      Deprecated.
    • query

      public Iterable<T> query(Iterable<T> iter)
      Deprecated.
      Returns an iterable over the objects that are the result of the query and are in the passed in iterable. This allows queries to be chained together where the result of one query is passed into another.
      Specified by:
      query in interface Query<T>
      Parameters:
      iter -
      Returns:
      an iterable over the objects that are the result of the query and are in the passed in iterable.