net.rim.device.api.ui.text
Class HexadecimalTextFilter

java.lang.Object
  extended by net.rim.device.api.ui.text.TextFilter
      extended by net.rim.device.api.ui.text.HexadecimalTextFilter

public class HexadecimalTextFilter
extends TextFilter

Filters out characters not usable in hexadecimal text strings.

This filter translates all characters but those valid in hexadecimal text strings (upper case 'A' through 'F' and all digits).


Field Summary
 
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
HexadecimalTextFilter()
          Constructs a new HexadecimalTextFilter instance.
 
Method Summary
 char convert(char character, int status)
          Passes character through hexadecimal text filter.
 boolean validate(char character)
          Determines if character is a valid hexadecimal string character.
 
Methods inherited from class net.rim.device.api.ui.text.TextFilter
convert, get, validate, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

HexadecimalTextFilter

public HexadecimalTextFilter()
Constructs a new HexadecimalTextFilter instance.



Method Detail

convert

public char convert(char character,
                    int status)
Passes character through hexadecimal text filter.

Specified by:
convert in class TextFilter
Parameters:
character - Character to translate.
status - a value that indicates how the character was generated.
Returns:
If you provide a valid hexadecimal character, this method passes it through unaltered; otherwise, this method passes back the value retrieved from Keypad.getAltedChar(character). If the character provided is not a valid hexadecimal character and the value retrieved from Keypad.getAltedChar(character) is not a valid hexadecimal character, then the uppercase character is returned

Special Cases:
- If alt is held down then the unalted uppercase character is returned.
- If character is not entered from keypad then the uppercase character is returned.


validate

public boolean validate(char character)
Determines if character is a valid hexadecimal string character.

Specified by:
validate in class TextFilter
Parameters:
character - Character to test.
Returns:
True if the character is valid for hexadecimal strings; otherwise, false.





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal