Class RepeatedSequence

  • All Implemented Interfaces:
    java.lang.CharSequence

    public class RepeatedSequence
    extends java.lang.Object
    implements java.lang.CharSequence
    CharSequence that repeats in a wraparound the given sequence.

    Partial repeat occurs when start % length() >0 and/or end % length() >0

    The hashCode is purposefully matched to the string equivalent or this.toString().hashCode()

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      char charAt​(int index)  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      int length()  
      static java.lang.CharSequence of​(char c, int count)
      Deprecated.
      static java.lang.CharSequence of​(java.lang.CharSequence chars, int count)
      Deprecated.
      static java.lang.CharSequence of​(java.lang.CharSequence chars, int startIndex, int endIndex)
      Deprecated.
      static java.lang.CharSequence ofSpaces​(int count)  
      RepeatedSequence repeat​(int count)  
      static java.lang.CharSequence repeatOf​(char c, int count)  
      static java.lang.CharSequence repeatOf​(java.lang.CharSequence chars, int count)  
      static java.lang.CharSequence repeatOf​(java.lang.CharSequence chars, int startIndex, int endIndex)  
      java.lang.CharSequence subSequence​(int startIndex, int endIndex)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

        chars, codePoints
    • Method Detail

      • length

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

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

        public java.lang.CharSequence subSequence​(int startIndex,
                                                  int endIndex)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

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

        @NotNull
        public static java.lang.CharSequence ofSpaces​(int count)
      • repeatOf

        @NotNull
        public static java.lang.CharSequence repeatOf​(char c,
                                                      int count)
      • repeatOf

        @NotNull
        public static java.lang.CharSequence repeatOf​(@NotNull
                                                      java.lang.CharSequence chars,
                                                      int count)
      • repeatOf

        @NotNull
        public static java.lang.CharSequence repeatOf​(@NotNull
                                                      java.lang.CharSequence chars,
                                                      int startIndex,
                                                      int endIndex)
      • of

        @NotNull
        @Deprecated
        public static java.lang.CharSequence of​(char c,
                                                int count)
        Deprecated.
      • of

        @NotNull
        @Deprecated
        public static java.lang.CharSequence of​(@NotNull
                                                java.lang.CharSequence chars,
                                                int count)
        Deprecated.
      • of

        @NotNull
        @Deprecated
        public static java.lang.CharSequence of​(@NotNull
                                                java.lang.CharSequence chars,
                                                int startIndex,
                                                int endIndex)
        Deprecated.