Class Grouped

  • All Implemented Interfaces:
    java.lang.CharSequence

    public final class Grouped
    extends java.lang.Object
    implements java.lang.CharSequence
    A CharSequence decorator which divides the delegate into groups of a specific size and inserts a separator char between them.

    Example:

    
     assertThat(new Grouped(2, ':', "abcdef"), is(validCharSequence("ab:cd:ef")));
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Grouped​(int groupSize, char separator, java.lang.CharSequence delegate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      char charAt​(int i)  
      int length()  
      java.lang.CharSequence subSequence​(int i, int i1)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.CharSequence

        chars, codePoints
    • Constructor Detail

      • Grouped

        public Grouped​(int groupSize,
                       char separator,
                       java.lang.CharSequence delegate)
    • Method Detail

      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • charAt

        public char charAt​(int i)
        Specified by:
        charAt in interface java.lang.CharSequence
      • subSequence

        public java.lang.CharSequence subSequence​(int i,
                                                  int i1)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object