Click or drag to resize
Alphabet Class
A data type for alphabets, for use with string-processing code that must convert between an alphabet of size R and the integers 0 through R-1.
Inheritance Hierarchy
SystemObject
  Algs4NetAlphabet

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Alphabet

The Alphabet type exposes the following members.

Constructors
  NameDescription
Public methodAlphabet
Initializes a new alphabet using characters 0 through 255.
Public methodAlphabet(String)
Initializes a new alphabet from the given set of characters.
Top
Properties
  NameDescription
Public propertyLgR
Returns the binary logarithm of the number of characters in this alphabet.
Public propertyRadix
Returns the number of characters in this alphabet (the radix).
Top
Methods
  NameDescription
Public methodContains
Returns true if the argument is a character in this alphabet.
Public methodStatic memberMainTest
Demo test the Alphabet data type.
Public methodToChar
Returns the character corresponding to the argument index.
Public methodToChars
Returns the characters corresponding to the argument indices.
Public methodToIndex
Returns the index corresponding to the argument character.
Public methodToIndices
Returns the indices corresponding to the argument characters.
Top
Fields
  NameDescription
Public fieldStatic memberAscii
The ASCII alphabet (0-127).
Public fieldStatic memberBase64
The base-64 alphabet (64 characters).
Public fieldStatic memberBinary
The binary alphabet { 0, 1 }.
Public fieldStatic memberDecimal
The decimal alphabet { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }.
Public fieldStatic memberDna
The DNA alphabet { A, C, T, G }.
Public fieldStatic memberExtendedAscii
The extended ASCII alphabet (0-255).
Public fieldStatic memberHexadecimal
The hexadecimal alphabet { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }.
Public fieldStatic memberLowerCase
The lowercase alphabet { a, b, c, ..., z }.
Public fieldStatic memberOctal
The octal alphabet { 0, 1, 2, 3, 4, 5, 6, 7 }.
Public fieldStatic memberProtein
The protein alphabet { A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, V, W, Y }.
Public fieldStatic memberUnicode16
The Unicode 16 alphabet (0-65,535).
Public fieldStatic memberUpperCase
The uppercase alphabet { A, B, C, ..., Z }.
Top
Remarks

The members of Alphabet follows the .NET convention to use lower case to name constants.

This class is a C# port from the original Java class Alphabet implementation by the respective authors.

See Also