net.sf.mmm.util.filter.api
Interface CharFilter

All Known Implementing Classes:
ConjunctionCharFilter, ListCharFilter

public interface CharFilter

This is the interface for a filter that decides if a given character is acceptable or should be filtered.
It is used by CharSequenceScanner and avoids conversion of char to Character for performance reasons. In other cases please prefer to use Filter.

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
static CharFilter ASCII_LETTER_FILTER
          A filter that only accepts the Latin ASCII letters 'a'-'z' and 'A'-'Z'.
static CharFilter ASCII_LOWER_CASE_LETTER_FILTER
          A filter that only accepts the lower case Latin ASCII letters 'a'-'z'.
static CharFilter ASCII_UPPER_CASE_LETTER_FILTER
          A filter that only accepts the upper case Latin ASCII letters 'A'-'Z'.
static CharFilter IDENTIFIER_FILTER
          A filter that only accepts characters valid for a technical identifier-string (e.g. literal oder variable-name).
static CharFilter LATIN_DIGIT_FILTER
          A filter that only accepts the Latin digits '0'-'9'.
static CharFilter LATIN_DIGIT_OR_LETTER_FILTER
          A filter that only accepts the Latin digits '0'-'9' or ASCII letters 'a'-'z' and 'A'-'Z'.
static CharFilter WHITESPACE_FILTER
          A filter that accepts only whitespaces.
 
Method Summary
 boolean accept(char c)
          This method determines if the given character c should be accepted.
 

Field Detail

IDENTIFIER_FILTER

static final CharFilter IDENTIFIER_FILTER
A filter that only accepts characters valid for a technical identifier-string (e.g. literal oder variable-name). This means accepted characters are Latin digits, ASCII letters or one of '.', '_' or '-'.

Since:
1.1.1

LATIN_DIGIT_OR_LETTER_FILTER

static final CharFilter LATIN_DIGIT_OR_LETTER_FILTER
A filter that only accepts the Latin digits '0'-'9' or ASCII letters 'a'-'z' and 'A'-'Z'.

Since:
1.1.0

LATIN_DIGIT_FILTER

static final CharFilter LATIN_DIGIT_FILTER
A filter that only accepts the Latin digits '0'-'9'.


ASCII_LETTER_FILTER

static final CharFilter ASCII_LETTER_FILTER
A filter that only accepts the Latin ASCII letters 'a'-'z' and 'A'-'Z'.


ASCII_LOWER_CASE_LETTER_FILTER

static final CharFilter ASCII_LOWER_CASE_LETTER_FILTER
A filter that only accepts the lower case Latin ASCII letters 'a'-'z'.

Since:
2.0.0

ASCII_UPPER_CASE_LETTER_FILTER

static final CharFilter ASCII_UPPER_CASE_LETTER_FILTER
A filter that only accepts the upper case Latin ASCII letters 'A'-'Z'.

Since:
2.0.0

WHITESPACE_FILTER

static final CharFilter WHITESPACE_FILTER
A filter that accepts only whitespaces.

Method Detail

accept

boolean accept(char c)
This method determines if the given character c should be accepted.

Parameters:
c - is the character to check.
Returns:
true if the given character c is acceptable, false if it should be filtered.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.