public class CString extends Object implements CharSequence, Cloneable, Comparable<CharSequence>, io.netty.util.ReferenceCounted
| Modifier and Type | Method and Description |
|---|---|
CString |
append(char c) |
CString |
append(char[] array) |
CString |
append(CharSequence other) |
CString |
append(CharSequence other,
int length) |
char |
charAt(int index) |
int |
clen() |
Object |
clone() |
int |
compareTo(CharSequence other)
Compares this
CString with a CharSequence lexicographically. |
boolean |
endsWith(CharSequence suffix) |
boolean |
equals(Object obj) |
boolean |
equalsIgnoreCase(CharSequence cs)
Compares this
CString to a CharSequence, ignoring case
considerations. |
io.netty.buffer.ByteBuf |
getByteBuf() |
io.netty.buffer.ByteBuf |
getByteBuf(int maxCapacity) |
int |
hashCode() |
int |
indexOf(CharSequence target) |
int |
indexOf(CharSequence target,
int fromIndex) |
int |
indexOf(int ch) |
int |
indexOf(int ch,
int fromIndex) |
boolean |
isBuffered() |
boolean |
isEmpty() |
int |
lastIndexOf(CharSequence target) |
int |
lastIndexOf(CharSequence target,
int fromIndex) |
int |
lastIndexOf(int ch) |
int |
lastIndexOf(int ch,
int fromIndex) |
int |
length() |
int |
refCnt() |
boolean |
regionMatches(boolean ignoreCase,
int toffset,
CharSequence other,
int ooffset,
int len)
Tests if this
CString region and a CharSequence region are equal. |
boolean |
release() |
boolean |
release(int decrement) |
CString |
replace(char oldChar,
char newChar) |
CString |
replace(CharSequence target,
CharSequence replacement) |
CString |
reset() |
io.netty.util.ReferenceCounted |
retain() |
io.netty.util.ReferenceCounted |
retain(int increment) |
boolean |
startsWith(CharSequence prefix) |
boolean |
startsWith(CharSequence prefix,
int toffset) |
CString |
subSequence(int start,
int end) |
CString |
substring(int beginIndex) |
CString |
substring(int beginIndex,
int endIndex) |
String |
toString() |
io.netty.util.ReferenceCounted |
touch() |
io.netty.util.ReferenceCounted |
touch(Object hint) |
static CString |
valueOf(io.netty.buffer.ByteBuf buffer) |
static CString |
valueOf(io.netty.buffer.ByteBuf buffer,
int strLen) |
static CString |
valueOf(CharSequence cs) |
finalize, getClass, notify, notifyAll, wait, wait, waitchars, codePointspublic static CString valueOf(io.netty.buffer.ByteBuf buffer)
public static CString valueOf(io.netty.buffer.ByteBuf buffer, int strLen)
public static CString valueOf(CharSequence cs)
public int refCnt()
refCnt in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted retain()
retain in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted retain(int increment)
retain in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted touch()
touch in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted touch(Object hint)
touch in interface io.netty.util.ReferenceCountedpublic boolean release()
release in interface io.netty.util.ReferenceCountedpublic boolean release(int decrement)
release in interface io.netty.util.ReferenceCountedpublic boolean isBuffered()
public io.netty.buffer.ByteBuf getByteBuf(int maxCapacity)
public io.netty.buffer.ByteBuf getByteBuf()
public int length()
length in interface CharSequencepublic int clen()
public boolean isEmpty()
public char charAt(int index)
charAt in interface CharSequencepublic CString substring(int beginIndex)
public CString substring(int beginIndex, int endIndex)
public CString subSequence(int start, int end)
subSequence in interface CharSequencepublic int indexOf(int ch)
public int indexOf(int ch,
int fromIndex)
public int indexOf(CharSequence target)
public int indexOf(CharSequence target, int fromIndex)
public int lastIndexOf(int ch)
public int lastIndexOf(int ch,
int fromIndex)
public int lastIndexOf(CharSequence target)
public int lastIndexOf(CharSequence target, int fromIndex)
public boolean startsWith(CharSequence prefix, int toffset)
public boolean startsWith(CharSequence prefix)
public boolean endsWith(CharSequence suffix)
public CString replace(char oldChar, char newChar)
public CString replace(CharSequence target, CharSequence replacement)
public CString append(char c)
public CString append(char[] array)
public CString append(CharSequence other)
public CString append(CharSequence other, int length)
public CString reset()
public String toString()
toString in interface CharSequencetoString in class Objectpublic boolean equalsIgnoreCase(CharSequence cs)
CString to a CharSequence, ignoring case
considerations. Two are considered equal ignoring case if they
are of the same length and corresponding characters in the two
are equal ignoring case.
Two characters c1 and c2 are considered the same
ignoring case if at least one of the following is true:
== operator)
Character.toUpperCase(char) to each character
produces the same result
Character.toLowerCase(char) to each character
produces the same result
cs - The CharSequence to compare this CString againsttrue if the argument is not null and it
represents an equivalent CharSequence ignoring case; false otherwiseequals(Object)public boolean regionMatches(boolean ignoreCase,
int toffset,
CharSequence other,
int ooffset,
int len)
CString region and a CharSequence region are equal.
A subsequence of this CString object is compared to a subsequence
of the argument other. The result is true if these
subsequences represent character sequences that are the same, ignoring
case if and only if ignoreCase is true. The subsequence of
this CString object to be compared begins at index
toffset and has length len. The subsequence of
other to be compared begins at index ooffset and
has length len. The result is false if and only if
at least one of the following is true:
toffset is negative.
ooffset is negative.
toffset+len is greater than the length of this
CString object.
ooffset+len is greater than the length of the other
argument.
ignoreCase is false and there is some nonnegative
integer k less than len such that:
this.charAt(toffset+k) != other.charAt(ooffset+k)
ignoreCase is true and there is some nonnegative
integer k less than len such that:
Character.toLowerCase(this.charAt(toffset+k)) !=
Character.toLowerCase(other.charAt(ooffset+k))
and:
Character.toUpperCase(this.charAt(toffset+k)) !=
Character.toUpperCase(other.charAt(ooffset+k))
ignoreCase - if true, ignore case when comparing
characters.toffset - the starting offset of the subregion in this
CString.other - the CharSequence argument.ooffset - the starting offset of the subregion in the CharSequence
argument.len - the number of characters to compare.true if the specified subregion of this CString
matches the specified subregion of the CharSequence argument;
false otherwise. Whether the matching is exact
or case insensitive depends on the ignoreCase
argument.public int compareTo(CharSequence other)
CString with a CharSequence lexicographically.
The comparison is based on the Unicode value of each character in
the strings. The character sequence represented by this
CString object is compared lexicographically to the argument
character sequence. The result is
a negative integer if this CString object
lexicographically precedes the argument character sequence. The result is a
positive integer if this CString object lexicographically
follows the argument character sequence. The result is zero if the strings
are equal; compareTo returns 0 exactly when
the equals(Object) method would return true.
This is the definition of lexicographic ordering. If two strings are
different, then either they have different characters at some index
that is a valid index for both strings, or their lengths are different,
or both. If they have different characters at one or more index
positions, let k be the smallest such index; then the string
whose character at position k has the smaller value, as
determined by using the < operator, lexicographically precedes the
other string. In this case, compareTo returns the
difference of the two character values at position k in
the two string -- that is, the value:
If there is no index position at which they differ, then the shorter string lexicographically precedes the longer string. In this case,this.charAt(k)-other.charAt(k)
compareTo returns the difference of the lengths of the
strings -- that is, the value:
this.length()-other.length()
compareTo in interface Comparable<CharSequence>other - the CharSequence to be compared.0 if the argument string is equal to
this string; a value less than 0 if this string
is lexicographically less than the string argument; and a
value greater than 0 if this string is
lexicographically greater than the char sequence argument.Copyright © 2017 The CLARUS Consortium. All rights reserved.