Package org.dmfs.jems2.charsequence
Class Grouped
java.lang.Object
org.dmfs.jems2.charsequence.Grouped
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int i) intlength()subSequence(int i, int i1) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Constructor Details
-
Grouped
-
-
Method Details
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int i) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-