|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.rim.device.api.ui.text.TextFilter
|
+--net.rim.device.api.ui.text.NumericTextFilter
Filters out characters not usable in strings showing numeric data.
This filter favours characters in numeric strings (that is numeric digits, and a minus sign if in the first position.
| Field Summary | ||
static int |
ALLOW_DECIMAL
Text style that allows numeric strings with decimal notation. |
|
static int |
ALLOW_NEGATIVE
Text style that allows negative numbers in numeric strings. |
|
| Fields inherited from class net.rim.device.api.ui.text.TextFilter |
ADN_SIM_PHONE, DEFAULT, DEFAULT_SMART_PHONE, EMAIL, FDN_SIM_PHONE, FILENAME, HEXADECIMAL, INTEGER, IP, LOWERCASE, NUMERIC, PHONE, PIN_ADDRESS, REAL_NUMERIC, SIM_PHONE, SMS_PHONE, STYLE_SHIFT, UPPERCASE, URL, VOICEMAIL_PHONE |
| Constructor Summary | ||
NumericTextFilter()
Constructs a new NumericTextFilter instance. |
||
NumericTextFilter(int style)
Constructs a new NumericTextFilter instance with provided style. |
||
| Method Summary | ||
char |
convert(char character,
AbstractString text,
int position,
int status)
Passes character through numeric text filter. |
|
char |
convert(char character,
int status)
Passes character through numeric text filter. |
|
boolean |
validate(AbstractString text)
Determines if provided string contains valid numeric characters. |
|
boolean |
validate(char character)
Determines if character is valid numeric string character. |
|
boolean |
validate(char character,
AbstractString text,
int position)
Determines if character is valid numeric string character. |
|
| Methods inherited from class net.rim.device.api.ui.text.TextFilter |
get |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ALLOW_DECIMAL
public static final int ALLOW_NEGATIVE
| Constructor Detail |
public NumericTextFilter()
This method builds a new numeric text filter that allows neither negative integers, nor decimals.
public NumericTextFilter(int style)
Use this method to build a new numeric text filter that can allow negative numbers and/or decimals.
style - Style for this field.| Method Detail |
public char convert(char character,
AbstractString text,
int position,
int status)
convert in class TextFiltercharacter - Character to test.text - Text in the current edit field.position - Current position of cursor in text.status - Ignored.
public char convert(char character,
int status)
convert in class TextFiltercharacter - Character to test.status - Ignored.public boolean validate(AbstractString text)
This method checks each character in your provided string with
validate(char) for validity. It does no checking that your string
is well formed numeric text, with one exception: this method returns
true if the string contains only a single minus sign (if this filter
allows negative numbers).
validate in class TextFiltertext - String to check.public boolean validate(char character)
validate in class TextFiltercharacter - Character to test.
public boolean validate(char character,
AbstractString text,
int position)
validate in class TextFiltercharacter - Character to test.text - Text in the current edit field.position - Current position of cursor in text.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.