com.bigdata.relation.rule.eval
Class SolutionFilter<E>

java.lang.Object
  extended by com.bigdata.relation.rule.eval.SolutionFilter<E>
All Implemented Interfaces:
IElementFilter<ISolution<E>>, IFilterTest, Serializable

public class SolutionFilter<E>
extends Object
implements IElementFilter<ISolution<E>>

Resolves an ISolution to its element and delegates the filter test to an IElementFilter suitable for the expected element type.

Version:
$Id: SolutionFilter.java 3695 2010-09-30 14:56:57Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Constructor Summary
SolutionFilter(IElementFilter<E> delegate)
           
 
Method Summary
 boolean canAccept(Object o)
          Return true iff this this filter can be used on the specified object (filter on the object class).
 boolean isValid(Object o)
          True iff the argument is matched by the filter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SolutionFilter

public SolutionFilter(IElementFilter<E> delegate)
Method Detail

isValid

public boolean isValid(Object o)
Description copied from interface: IFilterTest
True iff the argument is matched by the filter.

Specified by:
isValid in interface IFilterTest
Returns:
true iff that object is accepted by the filter.

canAccept

public boolean canAccept(Object o)
Description copied from interface: IElementFilter
Return true iff this this filter can be used on the specified object (filter on the object class).

Note: This was added to make it possible filter out cases where the runtime type system was throwing a ClassCastException in the IFilterTest.isValid(Object) implementation.

Specified by:
canAccept in interface IElementFilter<ISolution<E>>
Parameters:
o - An object of some type.
Returns:
true if the element can be inspected by this filter.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.