Class Tokens


  • public final class Tokens
    extends java.lang.Object
    Utility methods for dealing with tokens.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  Tokens.TokenIterator
      Iterator that lazily splits a string into tokens.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Tokens()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Iterable<java.lang.String> splitByComma​(java.lang.String text)
      Lazily splits the given string into whitespace-trimmed tokens, using comma as the token separator.
      static java.lang.Iterable<java.lang.String> splitByStar​(java.lang.String text)
      Lazily splits the given string into non-trimmed tokens, using star as the token separator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Tokens

        private Tokens()
    • Method Detail

      • splitByComma

        public static java.lang.Iterable<java.lang.String> splitByComma​(java.lang.String text)
        Lazily splits the given string into whitespace-trimmed tokens, using comma as the token separator.
        Parameters:
        text - The text to split into tokens
        Returns:
        Sequence of comma-separated tokens
      • splitByStar

        public static java.lang.Iterable<java.lang.String> splitByStar​(java.lang.String text)
        Lazily splits the given string into non-trimmed tokens, using star as the token separator.
        Parameters:
        text - The text to split into tokens
        Returns:
        Sequence of star-separated tokens