Class AlphabetCounter

java.lang.Object
org.refcodes.generator.AlphabetCounterMetrics
org.refcodes.generator.AlphabetCounter
All Implemented Interfaces:
Iterator<String>, Counter<String>, Generator<String>, IdCounter, IdGenerator, org.refcodes.mixin.Resetable

public class AlphabetCounter extends AlphabetCounterMetrics implements IdCounter
The AlphabetCounter generates values by counting with an an alphabet of "digits", a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9", a hexadecimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F".
  • Constructor Details

    • AlphabetCounter

      public AlphabetCounter(File... aWordsFiles) throws IOException
      Constructs an AlphabetCounter using the given words File elements to provide one by one (one word per line) contained in each file subsequently till all words have been processed, therewith representing the alphabet counter through which to iterate.
      Parameters:
      aWordsFiles - the words files
      Throws:
      IOException - if an I/O error occurs while retrieving the FileDescriptor.
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, File... aWordsFiles) throws IOException
      Constructs an AlphabetCounter using the given words File elements to provide one by one (one word per line) contained in each file subsequently till all words have been processed, therewith representing the alphabet counter through which to iterate.
      Parameters:
      aStartValue - The value from which to start (to be contained in one of the provided word File lists).
      aWordsFiles - the words files
      Throws:
      IOException - if an I/O error occurs when accessing the word File lists.
    • AlphabetCounter

      public AlphabetCounter(InputStream... aWordsStreams) throws IOException
      Constructs an AlphabetCounter using the given words InputStream elements to provide one by one (one word per line) contained in each file subsequently till all words have been processed, therewith representing the alphabet counter through which to iterate.
      Parameters:
      aWordsStreams - The words InputStream lists representing the alphabet counter through which to iterate.
      Throws:
      IOException - if an I/O error occurs while retrieving the FileDescriptor.
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, InputStream... aWordsStreams) throws IOException
      Constructs an AlphabetCounter using the given words InputStream elements to provide one by one (one word per line) contained in each file subsequently till all words have been processed, therewith representing the alphabet counter through which to iterate.
      Parameters:
      aStartValue - The value from which to start (to be contained in one of the provided word File lists).
      aWordsStreams - The words InputStream lists representing the alphabet counter through which to iterate.
      Throws:
      IOException - if an I/O error occurs while retrieving the FileDescriptor.
    • AlphabetCounter

      public AlphabetCounter(String aExpression) throws ParseException
      Constructs an AlphabetCounter by parsing the given expression to construct the alphabet from the according expression's attributes.
      Parameters:
      aExpression - The expression to be parsed (duplicate definitions of characters are ignored).
      Throws:
      ParseException - thrown in case parsing the expression failed.
    • AlphabetCounter

      public AlphabetCounter(String... aWords)
      Constructs an AlphabetCounter using the given words which to provide one by one after all words have been processed..
      Parameters:
      aWords - The words through which to iterate.
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, String... aWords)
      Constructs an AlphabetCounter using the given words which to provide one by one after all words have been processed..
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aWords - The words through which to iterate.
    • AlphabetCounter

      public AlphabetCounter(char... aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(Collection<Character> aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(org.refcodes.data.CharSet aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, Collection<Character> aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, org.refcodes.data.CharSet aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, char... aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(int aMinLength, char... aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(int aMinLength, Collection<Character> aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(int aMinLength, org.refcodes.data.CharSet aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, Collection<Character> aAlphabet, int aMinLength)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, org.refcodes.data.CharSet aAlphabet, int aMinLength)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, int aMinLength, char... aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(int aMinLength, int aMaxLength, char... aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aMaxLength - The maximum length of the counter value to be produced, the hasNext() method will return true till the maximum length is exceed.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(int aMinLength, int aMaxLength, Collection<Character> aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aMaxLength - The maximum length of the counter value to be produced, the hasNext() method will return true till the maximum length is exceed.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(int aMinLength, int aMaxLength, org.refcodes.data.CharSet aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aMaxLength - The maximum length of the counter value to be produced, the hasNext() method will return true till the maximum length is exceed.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, int aMinLength, int aMaxLength, Collection<Character> aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aMaxLength - The maximum length of the counter value to be produced, the hasNext() method will return true till the maximum length is exceed.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, int aMinLength, int aMaxLength, org.refcodes.data.CharSet aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aMaxLength - The maximum length of the counter value to be produced, the hasNext() method will return true till the maximum length is exceed.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
    • AlphabetCounter

      public AlphabetCounter(AlphabetCounterMetrics aAlphabetCounterMetrics)
      Constructs an AlphabetCounter using the given AlphabetCounterMetrics.
      Parameters:
      aAlphabetCounterMetrics - The AlphabetCounterMetrics to use (alphabet, min length, max length).
    • AlphabetCounter

      public AlphabetCounter(String aStartValue, int aMinLength, int aMaxLength, char... aAlphabet)
      Constructs an AlphabetCounter using the given attributes.
      Parameters:
      aStartValue - The value from which to start (must only consist of characters found in the alphabet).
      aMinLength - The minimum length of the counter value to be produced, the counter value will be filled up with the first character of the alphabet from left to right if it is shorter than the minimum length.
      aMaxLength - The maximum length of the counter value to be produced, the hasNext() method will return true till the maximum length is exceed.
      aAlphabet - The alphabet to use for counting, a decimal alphabet would contain the characters "0", "1", "2", "3", "4", "5", "6", "7", "8" and "9".
  • Method Details