| java.lang.Object org.xbill.DNS.Mnemonic
Mnemonic | class Mnemonic (Code) | | A utility class for converting between numeric codes and mnemonics
for those codes. Mnemonics are case insensitive.
author: Brian Wellington |
Constructor Summary | |
public | Mnemonic(String description, int wordcase) Creates a new Mnemonic table. |
Method Summary | |
public void | add(int val, String str) Defines the text representation of a numeric value. | public void | addAlias(int val, String str) Defines an additional text representation of a numeric value. | public void | addAll(Mnemonic source) Copies all mnemonics from one table into another. | public void | check(int val) | public String | getText(int val) Gets the text mnemonic corresponding to a numeric value. | public int | getValue(String str) Gets the numeric value corresponding to a text mnemonic. | public void | setMaximum(int max) | public void | setNumericAllowed(boolean numeric) Sets whether numeric values stored in strings are acceptable. | public void | setPrefix(String prefix) Sets the prefix to use when converting to and from values that don't
have mnemonics. | public static Integer | toInteger(int val) Converts an int into a possibly cached Integer. |
CASE_LOWER | final static int CASE_LOWER(Code) | | |
CASE_SENSITIVE | final static int CASE_SENSITIVE(Code) | | |
CASE_UPPER | final static int CASE_UPPER(Code) | | |
Mnemonic | public Mnemonic(String description, int wordcase)(Code) | | Creates a new Mnemonic table.
Parameters: description - A short description of the mnemonic to use when Parameters: wordcase - Whether to convert strings into uppercase, lowercase,or leave them unchanged.throwing exceptions. |
add | public void add(int val, String str)(Code) | | Defines the text representation of a numeric value.
Parameters: val - The numeric value Parameters: string - The text string |
addAlias | public void addAlias(int val, String str)(Code) | | Defines an additional text representation of a numeric value. This will
be used by getValue(), but not getText().
Parameters: val - The numeric value Parameters: string - The text string |
addAll | public void addAll(Mnemonic source)(Code) | | Copies all mnemonics from one table into another.
Parameters: val - The numeric value Parameters: string - The text string throws: IllegalArgumentException - The wordcases of the Mnemonics do notmatch. |
check | public void check(int val)(Code) | | Checks that a numeric value is within the range [0..max]
|
getText | public String getText(int val)(Code) | | Gets the text mnemonic corresponding to a numeric value.
Parameters: val - The numeric value The corresponding text mnemonic. |
getValue | public int getValue(String str)(Code) | | Gets the numeric value corresponding to a text mnemonic.
Parameters: str - The text mnemonic The corresponding numeric value, or -1 if there is none |
setMaximum | public void setMaximum(int max)(Code) | | Sets the maximum numeric value
|
setNumericAllowed | public void setNumericAllowed(boolean numeric)(Code) | | Sets whether numeric values stored in strings are acceptable.
|
setPrefix | public void setPrefix(String prefix)(Code) | | Sets the prefix to use when converting to and from values that don't
have mnemonics.
|
toInteger | public static Integer toInteger(int val)(Code) | | Converts an int into a possibly cached Integer.
|
|
|