Class CharArrayWrapperSequence

  • All Implemented Interfaces:
    ,

    public final class CharArrayWrapperSequence
    extends 
    implements , 

    Wrapper class that allows the use of char[] objects as s, without the need to duplicate the char[] contents in memory (as would happen if a String was created from the char[]).

    Note that a reference to the original char[] is kept, so modifying this char[] outside this object will result in this object's contents being modified too.

    Objects of this class are thread-safe.

    Since:
    2.0.15
    Author:
    Daniel Fernández
    • Constructor Detail

      • CharArrayWrapperSequence

        public CharArrayWrapperSequence​(char[] array)
      • CharArrayWrapperSequence

        public CharArrayWrapperSequence​(char[] buffer,
                                        int offset,
                                        int len)
    • Method Detail

      • charAt

        public char charAt​(int index)
        Specified by:
         in interface 
      • length

        public int length()
        Specified by:
         in interface 
      • subSequence

        public  subSequence​(int start,
                                        int end)
        Specified by:
         in interface 
      • hashCode

        public int hashCode()
        Overrides:
         in class 
      • equals

        public boolean equals​( obj)
        Overrides:
         in class 
      • toString

        public  toString()
        Specified by:
         in interface 
        Overrides:
         in class