Class Alphabet
java.lang.Object
org.emau.icmvc.ganimed.ttp.psn.generator.Alphabet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract char[]
long
getMaxNumberOfPSN
(int numberOfChars, boolean useLastCharAsDelimiter) number of possible psn with this alphabetint
getPosForSymbol
(char symbol) long
getPosNumberForPSN
(String psn, boolean useLastCharAsDelimiter) char
getSymbol
(int pos) int
length()
toString()
-
Constructor Details
-
Alphabet
public Alphabet() -
Alphabet
- Throws:
InvalidAlphabetException
-
-
Method Details
-
getAlphabet
protected abstract char[] getAlphabet() -
length
public int length() -
getSymbol
- Parameters:
pos
- position of the requested symbol (0 - length-1)- Returns:
- symbol at the given position
- Throws:
IndexOutOfBoundsException
- if the given position is larger thenlength()
-
getPosForSymbol
- Parameters:
symbol
- symbol for which the position is requested- Returns:
- position of the requested symbol
- Throws:
CharNotInAlphabetException
- if the given symbol is not an element of this alphabet
-
getPosNumberForPSN
public long getPosNumberForPSN(String psn, boolean useLastCharAsDelimiter) throws ArithmeticException, CharNotInAlphabetException - Parameters:
psn
- psn without pre-, suffix and checkdigitsuseLastCharAsDelimiter
-- Returns:
- Throws:
ArithmeticException
- if this number exceeds intCharNotInAlphabetException
-
getMaxNumberOfPSN
public long getMaxNumberOfPSN(int numberOfChars, boolean useLastCharAsDelimiter) throws ArithmeticException number of possible psn with this alphabet- Parameters:
numberOfChars
-useLastCharAsDelimiter
-- Returns:
- Throws:
ArithmeticException
- if this number exceeds long
-
toString
-