infovis.column
Class FilterColumn

java.lang.Object
  extended by infovis.utils.ChangeManager
      extended by infovis.column.AbstractColumn
          extended by infovis.column.BasicColumn
              extended by infovis.column.BasicObjectColumn
                  extended by infovis.column.FilterColumn
All Implemented Interfaces:
IntComparator, Column, Metadata, Constants, RowComparator, RowFilter, Serializable

public class FilterColumn
extends BasicObjectColumn
implements RowFilter

Column managing BitSet s meant for filtering columns with dynamic queries.

Version:
$Revision: 1.32 $
Author:
Jean-Daniel Fekete
See Also:
Serialized Form

Field Summary
 
Fields inherited from class infovis.column.AbstractColumn
MODIFIED_ALL, MODIFIED_NONE
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
FilterColumn(String name)
          Constructor for FilterColumn.
FilterColumn(String name, int reserve)
          Constructor for FilterColumn.
 
Method Summary
 int addDynamicQuery(DynamicQuery query)
          Adds a dynamic query to the list of registered queries.
 void applyDynamicQuery(DynamicQuery query, RowIterator iter)
          Applies a DynamicQuery to all the values of a specified RowIterator.
 void clearBit(int bitIndex)
          Clears a specified bit from all the BitSets.
 void clearBit(int index, int bitIndex)
          Clears a specified bit from BitSet at specified index.
 int compare(int row1, int row2)
          
 Object definedValue()
          Returns the instance of a value defined with the right type for this column.
static FilterColumn findColumn(Table t, String name)
          Returns a column as a FilterColumn from a table, creating it if needed.
 int findDynamicQueryIndex(DynamicQuery query)
          Returns the bitIndex for the specified dynamic query creating it and adding the dynamic query if is not registered.
 BitSet get(int index)
          Returns the element at the specified position in this column.
static FilterColumn getColumn(Table t, int index)
          Returns a column as a FilterColumn from an Table.
static FilterColumn getColumn(Table t, String name)
          Returns a column as a FilterColumn from a Table.
 DynamicQuery getDynamicQueryAt(int index)
          Returns the dynamic query at the specified index or null.
 int getDynamicQueryCount()
          Returns the number of dynamic queries managed by the filter column.
 int getDynamicQueryIndex(DynamicQuery query)
          Returns the bitIndex for the specified dynamic query or -1 if it is not registered.
 Class getValueClass()
          Returns the class of the elements.
 boolean isFiltered(int index)
          Returns true if the specified index is filtered.
 int removeDynamicQuery(DynamicQuery query)
          Removes a dynamic query from the list of registered queries, also clearing the associated bit from the BitSets.
 void setBit(int index, int bitIndex)
          Sets a specified bit from BitSet at a specified index, creating the BitSet if required.
 
Methods inherited from class infovis.column.BasicObjectColumn
add, capacity, clear, compare, compareValues, ensureCapacity, fill, format, getObjectAt, getOrder, getValueAt, getValueReference, hasUndefinedValue, indexOf, isValueUndefined, parse, remove, remove, setExtend, setObjectAt, setOrder, setSize, setValueAt, setValueUndefined, size
 
Methods inherited from class infovis.column.BasicColumn
addValue, addValueOrNull, firstValidRow, getClientProperty, getFormat, getMaxIndex, getMetadata, getMinIndex, getName, isEmpty, isInternal, iterator, lastValidRow, setFormat, setName, setValueOrNullAt, toString
 
Methods inherited from class infovis.column.AbstractColumn
addChangeListener, computeValueMap, computeValueMap, equalObj, equals, getLastModifiedRow
 
Methods inherited from class infovis.utils.ChangeManager
disableNotify, enableNotify, getModCount, removeChangeListener
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface infovis.Column
disableNotify, enableNotify, removeChangeListener
 

Constructor Detail

FilterColumn

public FilterColumn(String name)
Constructor for FilterColumn.

Parameters:
name - the name.

FilterColumn

public FilterColumn(String name,
                    int reserve)
Constructor for FilterColumn.

Parameters:
name - the name
reserve - the reserved size
Method Detail

getDynamicQueryIndex

public int getDynamicQueryIndex(DynamicQuery query)
Returns the bitIndex for the specified dynamic query or -1 if it is not registered.

Parameters:
query - the dynamic query
Returns:
the bitIndex for the specified dynamic query or -1 if it is not registered.

getDynamicQueryAt

public DynamicQuery getDynamicQueryAt(int index)
Returns the dynamic query at the specified index or null.

Parameters:
index - the index
Returns:
the dynamic query at the specified index or null.

getDynamicQueryCount

public int getDynamicQueryCount()
Returns the number of dynamic queries managed by the filter column.

Returns:
the number of dynamic queries managed by the filter column.

findDynamicQueryIndex

public int findDynamicQueryIndex(DynamicQuery query)
Returns the bitIndex for the specified dynamic query creating it and adding the dynamic query if is not registered.

Parameters:
query - the dynamic query
Returns:
the bitIndex for the specified dynamic query creating it and adding the dynamic query if is not registered.

addDynamicQuery

public int addDynamicQuery(DynamicQuery query)
Adds a dynamic query to the list of registered queries.

Parameters:
query - the dynamic query
Returns:
the bitIndex for the created query.

removeDynamicQuery

public int removeDynamicQuery(DynamicQuery query)
Removes a dynamic query from the list of registered queries, also clearing the associated bit from the BitSets.

Parameters:
query - the dynamic query
Returns:
the bitIndex for the specified dynamic query or -1 if it wasn't registered.

applyDynamicQuery

public void applyDynamicQuery(DynamicQuery query,
                              RowIterator iter)
Applies a DynamicQuery to all the values of a specified RowIterator.

Parameters:
query - the dynamic query
iter - the RowIterator

get

public BitSet get(int index)
Returns the element at the specified position in this column.

Parameters:
index - index of element to return.
Returns:
the element at the specified position in this column.

isFiltered

public boolean isFiltered(int index)
Returns true if the specified index is filtered.

Specified by:
isFiltered in interface RowFilter
Parameters:
index - the index.
Returns:
true if the specified index is filtered.

clearBit

public void clearBit(int index,
                     int bitIndex)
Clears a specified bit from BitSet at specified index.

Parameters:
index - the index.
bitIndex - the bit.

clearBit

public final void clearBit(int bitIndex)
Clears a specified bit from all the BitSets.

Parameters:
bitIndex - the bit.

setBit

public final void setBit(int index,
                         int bitIndex)
Sets a specified bit from BitSet at a specified index, creating the BitSet if required.

Parameters:
index - the row
bitIndex - the bit index

getColumn

public static FilterColumn getColumn(Table t,
                                     int index)
Returns a column as a FilterColumn from an Table.

Parameters:
t - the Table
index - index in the Table
Returns:
a FilterColumn or null if no such column exists or the column is not a FilterColumn.

getColumn

public static FilterColumn getColumn(Table t,
                                     String name)
Returns a column as a FilterColumn from a Table.

Parameters:
t - the Table
name - the column name.
Returns:
a FilterColumn or null if no such column exists or the column is not a FilterColumn.

findColumn

public static FilterColumn findColumn(Table t,
                                      String name)
Returns a column as a FilterColumn from a table, creating it if needed.

Parameters:
t - the Table
name - the column name.
Returns:
a column as a FilterColumn from a table,

getValueClass

public Class getValueClass()
Returns the class of the elements.

Specified by:
getValueClass in interface Column
Overrides:
getValueClass in class BasicObjectColumn
Returns:
the class of the elements.

compare

public int compare(int row1,
                   int row2)

Specified by:
compare in interface IntComparator
Overrides:
compare in class BasicObjectColumn

definedValue

public Object definedValue()
Returns the instance of a value defined with the right type for this column.

Specified by:
definedValue in class BasicObjectColumn
Returns:
the instance of a value defined with the right type for this column.


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.