com.google.visualization.datasource.query
Class NegationFilter

java.lang.Object
  extended by com.google.visualization.datasource.query.QueryFilter
      extended by com.google.visualization.datasource.query.NegationFilter

public class NegationFilter
extends QueryFilter

A negation filter. Holds a sub-filter and negates its result, acting like the NOT operator.

Author:
Yonatan B.Y.

Constructor Summary
NegationFilter(QueryFilter subFilter)
          Constructs a negation filter, with the given sub-filter.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
protected  java.util.List<AggregationColumn> getAggregationColumns()
          
 java.util.Set<java.lang.String> getAllColumnIds()
          Returns all the columnIds this filter uses, in this case exactly all the columnIds that the sub-filter uses.
 java.util.List<ScalarFunctionColumn> getScalarFunctionColumns()
          Returns a list of all scalarFunctionColumns this filter uses, in this case the scalarFunctionColumns its sub-filter uses.
 QueryFilter getSubFilter()
          Returns the sub-filter associated with this NegationFilter.
 int hashCode()
           
 boolean isMatch(DataTable table, TableRow row)
          Implements isMatch (from the QueryFilter interface) by recursively calling isMatch on the sub-filter and negating the result.
 java.lang.String toQueryString()
          Returns a string that, when parsed by the query parser, should return an identical filter.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NegationFilter

public NegationFilter(QueryFilter subFilter)
Constructs a negation filter, with the given sub-filter.

Parameters:
subFilter - The sub-filter of this negation filter.
Method Detail

isMatch

public boolean isMatch(DataTable table,
                       TableRow row)
Implements isMatch (from the QueryFilter interface) by recursively calling isMatch on the sub-filter and negating the result.

Specified by:
isMatch in class QueryFilter
Parameters:
table - The table containing this row.
row - The row to check.
Returns:
true if this row should be part of the result set, false otherwise.

getAllColumnIds

public java.util.Set<java.lang.String> getAllColumnIds()
Returns all the columnIds this filter uses, in this case exactly all the columnIds that the sub-filter uses.

Specified by:
getAllColumnIds in class QueryFilter
Returns:
All the columnIds this filter uses.

getScalarFunctionColumns

public java.util.List<ScalarFunctionColumn> getScalarFunctionColumns()
Returns a list of all scalarFunctionColumns this filter uses, in this case the scalarFunctionColumns its sub-filter uses.

Specified by:
getScalarFunctionColumns in class QueryFilter
Returns:
A list of all scalarFunctionColumns this filter uses.

getAggregationColumns

protected java.util.List<AggregationColumn> getAggregationColumns()

Specified by:
getAggregationColumns in class QueryFilter
Returns:
A list of all aggregation columns this filter uses.

getSubFilter

public QueryFilter getSubFilter()
Returns the sub-filter associated with this NegationFilter.

Returns:
The sub-filter associated with this NegationFilter.

toQueryString

public java.lang.String toQueryString()
Returns a string that, when parsed by the query parser, should return an identical filter. The string returned does not contain the WHERE keyword.

Specified by:
toQueryString in class QueryFilter
Returns:
A string form of this filter.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2009 Google. All Rights Reserved.