|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.types.NamedCharacterSet
@PublicAPI(stability=VOLATILE,
mayInstantiate=true,
mayExtend=false,
mayInvoke=true)
public final class NamedCharacterSetThis class provides a data structure that makes it possible to associate a name with a given set of characters. The name must consist only of ASCII alphabetic characters.
| Constructor Summary | |
|---|---|
NamedCharacterSet(java.lang.String name,
char[] characters)
Creates a new named character set with the provided information. |
|
NamedCharacterSet(java.lang.String name,
char[] characters,
java.util.Random random)
Creates a new named character set with the provided information. |
|
| Method Summary | |
|---|---|
static NamedCharacterSet[] |
decodeCharacterSets(java.util.SortedSet<java.lang.String> values)
Decodes the values of the provided configuration attribute as a set of character set definitions. |
java.lang.String |
encode()
Encodes this character set to a form suitable for use in the value of a configuration attribute. |
char[] |
getCharacters()
Retrieves the characters included in this character set. |
java.lang.String |
getName()
Retrieves the name for this character set. |
char |
getRandomCharacter()
Retrieves a character at random from this named character set. |
void |
getRandomCharacters(java.lang.StringBuilder buffer,
int count)
Appends the specified number of characters chosen at random from this character set to the provided buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NamedCharacterSet(java.lang.String name,
char[] characters)
throws ConfigException
name - The name for this character set.characters - The characters to include in this character
set.
ConfigException - If the provided name contains one or
more illegal characters.
public NamedCharacterSet(java.lang.String name,
char[] characters,
java.util.Random random)
throws ConfigException
name - The name for this character set.characters - The characters to include in this character
set.random - The random number generator to use with this
character set.
ConfigException - If the provided name contains one or
more illegal characters.| Method Detail |
|---|
public java.lang.String getName()
public char[] getCharacters()
public char getRandomCharacter()
public void getRandomCharacters(java.lang.StringBuilder buffer,
int count)
buffer - The buffer to which the characters should be
appended.count - The number of characters to append to the
provided buffer.public java.lang.String encode()
public static NamedCharacterSet[] decodeCharacterSets(java.util.SortedSet<java.lang.String> values)
throws ConfigException
values - The set of encoded character set values to
decode.
ConfigException - If a problem occurs while attempting to
decode the character set definitions.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||