com.amazon.carbonado.filter
Class ClosedFilter<S extends Storable>

java.lang.Object
  extended by com.amazon.carbonado.filter.Filter<S>
      extended by com.amazon.carbonado.filter.ClosedFilter<S>
All Implemented Interfaces:
Appender, Serializable

public class ClosedFilter<S extends Storable>
extends Filter<S>

Filter which blocks any results from passing through.

Author:
Brian S O'Neill
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.amazon.carbonado.filter.Filter
Filter.NotJoined
 
Method Summary
<R,P> R
accept(Visitor<S,R,P> visitor, P param)
          Accept the given visitor subclass to traverse the filter tree.
 ClosedFilter<S> and(Filter<S> filter)
          Returns a combined filter instance that accepts records which are only accepted by this filter and the one given.
 void appendTo(Appendable app, FilterValues<S> values)
          Appends the string value of this filter into the given Appendable.
<T extends Storable>
ClosedFilter<T>
asJoinedFromAny(ChainedProperty<T> joinProperty)
          Allows join from any property type, including one-to-many joins.
 ClosedFilter<S> bind()
          Walks through each property filter, assigning a bind ID to it.
 List<Filter<S>> conjunctiveNormalFormSplit()
          Splits the filter from its conjunctive normal form.
 List<Filter<S>> disjunctiveNormalFormSplit()
          Splits the filter from its disjunctive normal form.
 boolean equals(Object obj)
           
 FilterValues<S> initialFilterValues()
          Returns a FilterValues instance for assigning values to a Filter.
 boolean isBound()
          Returns true if all property filters are known to be properly bound.
 boolean isClosed()
          Always returns true.
 OpenFilter<S> not()
          Returns the logical negation of this filter.
 Filter<S> or(Filter<S> filter)
          Returns a combined filter instance that accepts records which are accepted either by this filter or the one given.
 String toString()
          Returns the string value of this filter, which is also parsable.
 ClosedFilter<S> unbind()
          Undoes the effect of a bind operation.
 
Methods inherited from class com.amazon.carbonado.filter.Filter
and, and, and, andExists, andNotExists, appendTo, asJoinedFrom, asJoinedFrom, conjunctiveNormalForm, disjunctiveNormalForm, filterFor, getClosedFilter, getOpenFilter, getStorableType, hashCode, isOpen, notJoinedFrom, notJoinedFrom, or, or, or, orExists, orNotExists, reduce
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

isClosed

public final boolean isClosed()
Always returns true.

Overrides:
isClosed in class Filter<S extends Storable>
Since:
1.2

and

public ClosedFilter<S> and(Filter<S> filter)
Description copied from class: Filter
Returns a combined filter instance that accepts records which are only accepted by this filter and the one given.

Overrides:
and in class Filter<S extends Storable>
Returns:
canonical Filter instance

or

public Filter<S> or(Filter<S> filter)
Description copied from class: Filter
Returns a combined filter instance that accepts records which are accepted either by this filter or the one given.

Overrides:
or in class Filter<S extends Storable>
Returns:
canonical Filter instance

not

public OpenFilter<S> not()
Description copied from class: Filter
Returns the logical negation of this filter.

Specified by:
not in class Filter<S extends Storable>
Returns:
canonical Filter instance

disjunctiveNormalFormSplit

public List<Filter<S>> disjunctiveNormalFormSplit()
Description copied from class: Filter
Splits the filter from its disjunctive normal form. Or'ng the filters together produces the full disjunctive normal form.

Overrides:
disjunctiveNormalFormSplit in class Filter<S extends Storable>
Returns:
unmodifiable list of sub filters which don't perform any 'or' operations
Since:
1.1.1

conjunctiveNormalFormSplit

public List<Filter<S>> conjunctiveNormalFormSplit()
Description copied from class: Filter
Splits the filter from its conjunctive normal form. And'ng the filters together produces the full conjunctive normal form.

Overrides:
conjunctiveNormalFormSplit in class Filter<S extends Storable>
Returns:
unmodifiable list of sub filters which don't perform any 'and' operations
Since:
1.1.1

initialFilterValues

public FilterValues<S> initialFilterValues()
Description copied from class: Filter
Returns a FilterValues instance for assigning values to a Filter. Returns null if Filter has no parameters.

Note: The returned FilterValues instance may reference a different filter instance than this one. Call getFilter to retrieve it. The difference is caused by the filter property values being bound.

Overrides:
initialFilterValues in class Filter<S extends Storable>

accept

public <R,P> R accept(Visitor<S,R,P> visitor,
                      P param)
Description copied from class: Filter
Accept the given visitor subclass to traverse the filter tree.

Specified by:
accept in class Filter<S extends Storable>
Parameters:
visitor - visitor to traverse through the tree
param - generic input parameter passed to visit methods
Returns:
generic return value passed from visit methods

bind

public ClosedFilter<S> bind()
Description copied from class: Filter
Walks through each property filter, assigning a bind ID to it. This step is automatically performed for proper dnf/cnf conversion, and for building FilterValues.

Specified by:
bind in class Filter<S extends Storable>
Returns:
canonical Filter instance with bound property filters

unbind

public ClosedFilter<S> unbind()
Description copied from class: Filter
Undoes the effect of a bind operation. The returned filter might still report itself as bound if it doesn't make a distinction between these states.

Specified by:
unbind in class Filter<S extends Storable>
Returns:
canonical Filter instance with unbound property filters

isBound

public boolean isBound()
Description copied from class: Filter
Returns true if all property filters are known to be properly bound. This is a side effect of calling Filter.bind(), Filter.initialFilterValues(), Filter.disjunctiveNormalForm() or Filter.conjunctiveNormalForm().

Specified by:
isBound in class Filter<S extends Storable>

asJoinedFromAny

public <T extends Storable> ClosedFilter<T> asJoinedFromAny(ChainedProperty<T> joinProperty)
Description copied from class: Filter
Allows join from any property type, including one-to-many joins.

Specified by:
asJoinedFromAny in class Filter<S extends Storable>

equals

public boolean equals(Object obj)
Specified by:
equals in class Filter<S extends Storable>

toString

public String toString()
Description copied from class: Filter
Returns the string value of this filter, which is also parsable.

Overrides:
toString in class Filter<S extends Storable>

appendTo

public void appendTo(Appendable app,
                     FilterValues<S> values)
              throws IOException
Description copied from class: Filter
Appends the string value of this filter into the given Appendable.

Specified by:
appendTo in class Filter<S extends Storable>
values - optionally supply filter values
Throws:
IOException


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.