Top Description Inners Fields Constructors Methods
com.ibm.icu.impl.text

public Class RbnfScannerProviderImpl

extends Object
implements RbnfLenientScannerProvider
Class Inheritance
All Implemented Interfaces
com.ibm.icu.text.RbnfLenientScannerProvider
Annotations
@Deprecated
Imports
java.util.HashMap, .Map, com.ibm.icu.impl.ICUDebug, com.ibm.icu.text.CollationElementIterator, .Collator, .RbnfLenientScanner, .RbnfLenientScannerProvider, .RuleBasedCollator, com.ibm.icu.util.ULocale

Deprecated

This API is ICU internal only.

Returns RbnfLenientScanners that use the old RuleBasedNumberFormat implementation behind setLenientParseMode, which is based on Collator.
ICU Status
Internal ICU component.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
RbnfScannerProviderImpl.RbnfLenientScannerImpl

Deprecated as a consequence of RbnfLenientScanner being deprecated.

Field Summary

Modifier and TypeField and Description
private Map<String, RbnfLenientScanner>
private static final boolean

Constructor Summary

AccessConstructor and Description
public
RbnfScannerProviderImpl()

Deprecated This API is ICU internal only.

Method Summary

Modifier and TypeMethod and Description
protected RbnfLenientScanner
createScanner(ULocale locale, String extras)

Deprecated This API is ICU internal only.
public RbnfLenientScanner
get(ULocale
the locale to provide the default lenient rules.
locale
,
String
extra collation rules
extras
)

Implements com.ibm.icu.text.RbnfLenientScannerProvider.get.

Deprecated This API is ICU internal only.
Returns a collation-based scanner.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
private Map<String, RbnfLenientScanner> cache
DEBUGback to summary
private static final boolean DEBUG

Constructor Detail

RbnfScannerProviderImplback to summary
public RbnfScannerProviderImpl()

Deprecated

This API is ICU internal only.

Annotations
@Deprecated
ICU Status
Internal ICU component.

Method Detail

createScannerback to summary
protected RbnfLenientScanner createScanner(ULocale locale, String extras)

Deprecated

This API is ICU internal only.

Annotations
@Deprecated
ICU Status
Internal ICU component.
getback to summary
public RbnfLenientScanner get(ULocale locale, String extras)

Implements com.ibm.icu.text.RbnfLenientScannerProvider.get.

Deprecated

This API is ICU internal only.

Returns a collation-based scanner. Only primary differences are treated as significant. This means that case differences, accent differences, alternate spellings of the same letter (e.g., ae and a-umlaut in German), ignorable characters, etc. are ignored in matching the text. In many cases, numerals will be accepted in place of words or phrases as well. For example, all of the following will correctly parse as 255 in English in lenient-parse mode:
"two hundred fifty-five"
"two hundred fifty five"
"TWO HUNDRED FIFTY-FIVE"
"twohundredfiftyfive"
"2 hundred fifty-5" The Collator used is determined by the locale that was passed to this object on construction. The description passed to this object on construction may supply additional collation rules that are appended to the end of the default collator for the locale, enabling additional equivalences (such as adding more ignorable characters or permitting spelled-out version of symbols; see the demo program for examples). It's important to emphasize that even strict parsing is relatively lenient: it will accept some text that it won't produce as output. In English, for example, it will correctly parse "two hundred zero" and "fifteen hundred".

Parameters
locale:ULocale

Doc from com.ibm.icu.text.RbnfLenientScannerProvider.get.

the locale to provide the default lenient rules.

extras:String

Doc from com.ibm.icu.text.RbnfLenientScannerProvider.get.

extra collation rules

Returns:RbnfLenientScanner

Doc from com.ibm.icu.text.RbnfLenientScannerProvider.get.

the lenient scanner, or null

Annotations
@Deprecated
ICU Status
Internal ICU component.
com.ibm.icu.impl.text back to summary

private Class RbnfScannerProviderImpl.RbnfLenientScannerImpl

extends Object
implements RbnfLenientScanner
Class Inheritance
  • java.lang.Object
  • com.ibm.icu.impl.text.RbnfScannerProviderImpl.RbnfLenientScannerImpl
All Implemented Interfaces
com.ibm.icu.text.RbnfLenientScanner

Deprecated

as a consequence of RbnfLenientScanner being deprecated. See corresponding docs for further information.

Field Summary

Modifier and TypeField and Description
private final RuleBasedCollator

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
allIgnorable(String
The string to test
s
)

Implements com.ibm.icu.text.RbnfLenientScanner.allIgnorable.

Returns true if a string consists entirely of ignorable characters.
public int[]
findText(String
The string to search
str
,
String
The string to search "str" for
key
,
int
The index into "str" where the search is to begin
startingAt
)

Implements com.ibm.icu.text.RbnfLenientScanner.findText.

Searches a string for another string.
public int[]
findText2(String str, String key, int startingAt)

public int
prefixLength(String
The string being tested
str
,
String
The text we're hoping to see at the beginning of "str"
prefix
)

Implements com.ibm.icu.text.RbnfLenientScanner.prefixLength.

Matches characters in a string against a prefix and return the number of chars that matched, or 0 if no match.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

collatorback to summary
private final RuleBasedCollator collator

Constructor Detail

RbnfLenientScannerImplback to summary
private RbnfLenientScannerImpl(RuleBasedCollator rbc)

Method Detail

allIgnorableback to summary
public boolean allIgnorable(String s)

Implements com.ibm.icu.text.RbnfLenientScanner.allIgnorable.

Doc from com.ibm.icu.text.RbnfLenientScanner.allIgnorable.

Returns true if a string consists entirely of ignorable characters.

Parameters
s:String

The string to test

Returns:boolean

true if the string is empty or consists entirely of characters that are ignorable.

findTextback to summary
public int[] findText(String str, String key, int startingAt)

Implements com.ibm.icu.text.RbnfLenientScanner.findText.

Doc from com.ibm.icu.text.RbnfLenientScanner.findText.

Searches a string for another string. This might use a Collator to compare strings, or just do a simple match.

Parameters
str:String

The string to search

key:String

The string to search "str" for

startingAt:int

The index into "str" where the search is to begin

Returns:int[]

A two-element array of ints. Element 0 is the position of the match, or -1 if there was no match. Element 1 is the number of characters in "str" that matched (which isn't necessarily the same as the length of "key")

findText2back to summary
public int[] findText2(String str, String key, int startingAt)
Annotations
@SuppressWarnings:unused
prefixLengthback to summary
public int prefixLength(String str, String prefix)

Implements com.ibm.icu.text.RbnfLenientScanner.prefixLength.

Doc from com.ibm.icu.text.RbnfLenientScanner.prefixLength.

Matches characters in a string against a prefix and return the number of chars that matched, or 0 if no match. Only primary-order differences are significant in determining whether there's a match. This means that the returned value need not be the same as the length of the prefix.

Parameters
str:String

The string being tested

prefix:String

The text we're hoping to see at the beginning of "str"

Returns:int

the number of characters in "str" that were matched