com.programix.gui.text
Class FilterChainDocument.WinnowFilter
java.lang.Object
com.programix.gui.text.FilterChainDocument.BasicFilter
com.programix.gui.text.FilterChainDocument.WinnowFilter
- All Implemented Interfaces:
- FilterChainDocument.Filter
- Enclosing class:
- FilterChainDocument
public static class FilterChainDocument.WinnowFilter
- extends FilterChainDocument.BasicFilter
- implements FilterChainDocument.Filter
Winnows out invalid characters from the source String
keeping only the characters specified as valid during
construction. For more on "winnowing", see
StringTools.winnow(String, char[]).
- Author:
- Paul Hyde
|
Method Summary |
protected String |
filter(String src)
Implement in subclasses for filters that don't need access
to the Document or the offset into the document
for the current String insertion. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilterChainDocument.WinnowFilter
public FilterChainDocument.WinnowFilter(char[] validChar)
- Constructor used to specify the characters to keep as a
char[].
- Parameters:
validChar - characters to keep; does not have to be
sorted at all.
FilterChainDocument.WinnowFilter
public FilterChainDocument.WinnowFilter(String validChar)
- Constructor used to specify the characters to keep as a
String.
- Parameters:
validChar - a String containing all the characters
to keep; does not have to be sorted at all.
filter
protected String filter(String src)
- Description copied from class:
FilterChainDocument.BasicFilter
- Implement in subclasses for filters that don't need access
to the
Document or the offset into the document
for the current String insertion.
- Specified by:
filter in class FilterChainDocument.BasicFilter
- Parameters:
src - proposed characters to insert
- Returns:
- the subset of the proposed characters to insert. If no
alterations are needed, the src may be returned.
Copyright © 2001-2009
Programix Incorporated.
All rights reserved.
ProgramixGenericLib is free
and is
OSI Certified
Open Source Software under the BSD
license.