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()

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RepeatedSequence​(java.lang.CharSequence chars, int startIndex, int endIndex)  
    • 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 @NotNull java.lang.CharSequence of​(char c, int count)
      Deprecated.
      static @NotNull java.lang.CharSequence of​(@NotNull java.lang.CharSequence chars, int count)
      Deprecated.
      static @NotNull java.lang.CharSequence of​(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)
      Deprecated.
      static @NotNull java.lang.CharSequence ofSpaces​(int count)  
      RepeatedSequence repeat​(int count)  
      static @NotNull java.lang.CharSequence repeatOf​(char c, int count)  
      static @NotNull java.lang.CharSequence repeatOf​(@NotNull java.lang.CharSequence chars, int count)  
      static @NotNull java.lang.CharSequence repeatOf​(@NotNull java.lang.CharSequence chars, int startIndex, int endIndex)  
      java.lang.CharSequence subSequence​(int startIndex, int endIndex)  
      @NotNull 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
    • Field Detail

      • chars

        private final java.lang.CharSequence chars
      • startIndex

        private final int startIndex
      • endIndex

        private final int endIndex
      • hashCode

        private int hashCode
    • Constructor Detail

      • RepeatedSequence

        private RepeatedSequence​(java.lang.CharSequence chars,
                                 int startIndex,
                                 int endIndex)
    • 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 @NotNull java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object
      • ofSpaces

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

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

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

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

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

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

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