com.ibm.icu.text

Class UnicodeFilter

Implemented Interfaces:
UnicodeMatcher
Known Direct Subclasses:
UnicodeSet

public abstract class UnicodeFilter
extends Object
implements UnicodeMatcher

UnicodeFilter defines a protocol for selecting a subset of the full range (U+0000 to U+FFFF) of Unicode characters. Currently, filters are used in conjunction with classes like Transliterator to only process selected characters through a transformation.

Fields inherited from interface com.ibm.icu.text.UnicodeMatcher

ETHER, U_MATCH, U_MISMATCH, U_PARTIAL_MATCH

Constructor Summary

UnicodeFilter()
(This should not be here; it is declared to make CheckTags happy.

Method Summary

abstract boolean
contains(int c)
Returns true for characters that are in the selected subset.
int
matches(Replaceable text, int[] offset, int limit, boolean incremental)
Default implementation of UnicodeMatcher::matches() for Unicode filters.

Constructor Details

UnicodeFilter

protected UnicodeFilter()
(This should not be here; it is declared to make CheckTags happy. Java inserts a synthetic constructor and CheckTags can't tell that it's synthetic.) TODO Remove this when the JDK property implements MemberDoc.isSynthetic

Method Details

contains

public abstract boolean contains(int c)
Returns true for characters that are in the selected subset. In other words, if a character is to be filtered, then contains() returns false.

matches

public int matches(Replaceable text,
                   int[] offset,
                   int limit,
                   boolean incremental)
Default implementation of UnicodeMatcher::matches() for Unicode filters. Matches a single 16-bit code unit at offset.
Specified by:
matches in interface UnicodeMatcher

Copyright (c) 2006 IBM Corporation and others.