Package org.thymeleaf.util
Class CharArrayWrapperSequence
Object
org.thymeleaf.util.CharArrayWrapperSequence
- All Implemented Interfaces:
CharSequence
,Cloneable
Wrapper class that allows the use of char[] objects as CharSequence
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 Summary
ConstructorsConstructorDescriptionCharArrayWrapperSequence
(char[] array) CharArrayWrapperSequence
(char[] buffer, int offset, int len) -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) protected CharArrayWrapperSequence
clone()
boolean
int
hashCode()
int
length()
subSequence
(int start, int end) toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
Constructor Details
-
CharArrayWrapperSequence
public CharArrayWrapperSequence(char[] array) -
CharArrayWrapperSequence
public CharArrayWrapperSequence(char[] buffer, int offset, int len)
-
-
Method Details
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
hashCode
public int hashCode() -
equals
-
toString
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-