org.jnetstream.filter
Class Filter.AND<T extends FilterTarget>

java.lang.Object
  extended by org.jnetstream.filter.Filter.AND<T>
All Implemented Interfaces:
Filter<T>
Enclosing interface:
Filter<T extends FilterTarget>

public static final class Filter.AND<T extends FilterTarget>
extends java.lang.Object
implements Filter<T>

Takes two filters (left and right) and does an AND logical operation after evaluating each of the filters.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jnetstream.filter.Filter
Filter.AND<T extends FilterTarget>, Filter.MAXIMUM<T extends FilterTarget>, Filter.MINIMUM<T extends FilterTarget>, Filter.NOT<T extends FilterTarget>, Filter.OR<T extends FilterTarget>
 
Field Summary
 
Fields inherited from interface org.jnetstream.filter.Filter
TRUE
 
Constructor Summary
Filter.AND(Filter<T> left, Filter<T> right)
           
 
Method Summary
 boolean accept(java.nio.ByteBuffer buffer, T target)
           
 long execute(java.nio.ByteBuffer buffer, T target)
          Will return the smaller of the evaluated expressions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter.AND

public Filter.AND(Filter<T> left,
                  Filter<T> right)
Method Detail

accept

public boolean accept(java.nio.ByteBuffer buffer,
                      T target)
               throws FilterException
Specified by:
accept in interface Filter<T extends FilterTarget>
Throws:
FilterException

execute

public long execute(java.nio.ByteBuffer buffer,
                    T target)
             throws FilterException
Will return the smaller of the evaluated expressions. That is if left returns 100 and right returns 0 then 0 will be returned.

Specified by:
execute in interface Filter<T extends FilterTarget>
Parameters:
buffer - buffer to execute on
target - the target specific filter
Returns:
smallest value of the two evaluated filters
Throws:
FilterException - TODO
See Also:
com.slytechs.capture.filter.Filter#execute(java.nio.ByteBuffer)