|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.coderazzi.filters.parser.FilterTextParser
public class FilterTextParser
Basic implementation of a IFilterTextParser, supporting only
simple operators referring to the content of a single column.
The supporter operators include:
Format or
Comparator is defined for the given type.
For example, specifying the text ">= 4" implies, for a
column with integer types, that a direct comparison between integers
will be performed. These operators are:
Format is
defined for the given type. The comparison is performed using the
equals method. These operators are:
Format instance).
Only two wildcard characters are defined: * and ?
| Constructor Summary | |
|---|---|
FilterTextParser()
|
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. |
Comparator<?> |
getComparator(Class<?> c)
Returns the Comparator provided for the given class |
String |
getDefaultOperator()
Returns the default operand |
Format |
getFormat(Class<?> c)
Returns the Format for a given class |
boolean |
isIgnoreCase()
Returns true if it ignores case |
RowFilter |
parseText(String expression,
int modelPosition)
Parses the text, corresponding to a column in the table model It returns a filter that can be applied to the table sorter. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes an existing PropertyChangeListener |
void |
setComparator(Class<?> c,
Comparator<?> cmp)
Sets a specific comparator for a given class, that should override the default compare algorithm for the given class. |
void |
setDefaultOperator(String s)
Defines the default operator when the user specifies none |
void |
setFormat(Class<?> c,
Format format)
Sets the Format for the given Class. |
void |
setIgnoreCase(boolean ignore)
Ignores case -if the operator is string based- |
void |
setTableModel(TableModel model)
Associates a TableModel to the parser.The parser can use it to extract the type associated to a given column, or to define variables-the name of the column-. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilterTextParser()
| Method Detail |
|---|
public void addPropertyChangeListener(PropertyChangeListener listener)
IFilterTextParserPropertyChangeListener.
addPropertyChangeListener in interface IFilterTextParserpublic void removePropertyChangeListener(PropertyChangeListener listener)
IFilterTextParserPropertyChangeListener
removePropertyChangeListener in interface IFilterTextParserpublic void setTableModel(TableModel model)
IFilterTextParserTableModel to the parser.
setTableModel in interface IFilterTextParserpublic String getDefaultOperator()
IFilterTextParser
getDefaultOperator in interface IFilterTextParserpublic void setDefaultOperator(String s)
IFilterTextParser
setDefaultOperator in interface IFilterTextParserpublic Format getFormat(Class<?> c)
IFilterTextParserFormat for a given class
getFormat in interface IFilterTextParser
public void setFormat(Class<?> c,
Format format)
Format for the given Class. If the class belongs to
the Date hierarchy, it creates automatically a Comparator
for it, based on the DateComparator class, unless one
comparator has been already set.
setFormat in interface IFilterTextParser
public void setComparator(Class<?> c,
Comparator<?> cmp)
IFilterTextParserSets a specific comparator for a given class, that should override the default compare algorithm for the given class.
If the class is not Comparable, this method should
be invoked to support any comparison operator, or any operation will
be invoked on the string representation of the instance.
setComparator in interface IFilterTextParserpublic Comparator<?> getComparator(Class<?> c)
IFilterTextParserComparator provided for the given class
getComparator in interface IFilterTextParserpublic void setIgnoreCase(boolean ignore)
IFilterTextParser
setIgnoreCase in interface IFilterTextParserpublic boolean isIgnoreCase()
IFilterTextParser
isIgnoreCase in interface IFilterTextParser
public RowFilter parseText(String expression,
int modelPosition)
throws ParseException
IFilterTextParser
parseText in interface IFilterTextParserexpression - the text to parsemodelPosition - the position on the table model.
ParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||