public class Asn1CharRange extends Asn1CharSet
This class is used to represent a permitted alphabet that is specified as a large, continuous range of characters. An example of this can be found in the following extract from T.124:
simpleTextFirstCharacter UniversalString ::= {0, 0, 0, 0}
simpleTextLastCharacter UniversalString ::= {0, 0, 0, 255}
SimpleTextString ::= BMPString (SIZE (0..255)) (FROM (simpleTextFirstCharacter..simpleTextLastCharacter))
This class is mainly for internal use by the compiler when generating methods that encode/decode PER charater string components containing permitted alphabet constraints.
Modifier and Type | Field and Description |
---|---|
protected int |
mLower
This variable represents the lower value of the range.
|
protected int |
mUpper
This variable represents the upper value of the range.
|
mABitsPerChar, mUBitsPerChar
Constructor and Description |
---|
Asn1CharRange(int lower,
int upper)
This constructor sets the range values.
|
Modifier and Type | Method and Description |
---|---|
int |
getCharAtIndex(int index)
This method will fetch the character from the permitted alphabet
at the given index.
|
int |
getCharIndex(int charValue)
This method will determine the index of the given character within
the permitted alphabet character set.
|
int |
getMaxValue()
This method will determine the maximum value of the given character within
the permitted alphabet character set.
|
boolean |
validate(java.lang.String s)
This method will validate a character string by comparing its contents
to the character range.
|
getNumBitsPerChar
protected int mLower
protected int mUpper
public Asn1CharRange(int lower, int upper)
lower
- Range lower valueupper
- Range upper valuepublic int getCharAtIndex(int index) throws Asn1ConsVioException
getCharAtIndex
in class Asn1CharSet
index
- Index of character within the character setAsn1ConsVioException
- Index not within define rangepublic int getCharIndex(int charValue) throws Asn1ConsVioException
getCharIndex
in class Asn1CharSet
charValue
- Character value to search forAsn1ConsVioException
- Character not found in setpublic int getMaxValue()
getMaxValue
in class Asn1CharSet
public boolean validate(java.lang.String s)
validate
in class Asn1CharSet
s
- The string to be validated.