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

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

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

A filter used to limit that scope of captures, packet reads from a file or from an IO stream.

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.OR(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 bigger 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.OR

public Filter.OR(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 bigger of the evaluated expressions. That is if left returns 100 and right returns 0 then 100 will be returned.

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