Package parser

Class CustomScanner

java.lang.Object
parser.CustomScanner

public class CustomScanner extends Object
Since:
2011 Objects of this class scans a string into tokens based on a list of tokenizer values.
  • Field Details

    • input

      private String input
      The input to be scanned into tokens.
    • tokens

      private String[] tokens
      The tokens to be employed in splitting the input.
    • includeTokensInOutput

      private boolean includeTokensInOutput
      If true the tokens will be included in the output.
  • Constructor Details

    • CustomScanner

      public CustomScanner(String input, boolean includeTokensInOutput, String... splitterTokens)
      Parameters:
      input - The input to scan.
      includeTokensInOutput - Will allow the splitting tokens to be added to the final scan if this attribute is set to true.
      splitterTokens - An array of tokens..input as a variable argument list... on which the input is to be split.
    • CustomScanner

      public CustomScanner(String input, boolean includeTokensInOutput, String[] moreTokens, String... tokens)
    • CustomScanner

      public CustomScanner(String input, boolean includeTokensInOutput, String[] splitterTokens, String[] splitterTokens1, String... splitterTokens2)
      A convenience constructor used when there exists more than one array containing the tokenizer data.
      Parameters:
      input - The input to scan.
      includeTokensInOutput - Will allow the splitting tokens to be added to the final scan if this attribute is set to true.
      splitterTokens - An array of tokens on which the input is to be split.
      splitterTokens1 - A second array of tokens on which the input is to be split.
      splitterTokens2 - A second array of tokens..input as a variable argument list... on which the input is to be split.
  • Method Details

    • scan

      public List<String> scan()
    • main

      public static void main(String[] args)
    • main1

      public static void main1(String[] args)