Interface Name
- All Superinterfaces:
CharSequence
An immutable sequence of characters. When created by the same
implementation, objects implementing this interface must obey the
general equals contract when compared
with each other. Therefore,
Name objects from the same
implementation are usable in collections while Names from
different implementations may not work properly in collections.
An empty
Name has a length of
zero.
In the context of annotation processing, the guarantees for "the same" implementation must include contexts where the API mediated side effects of processors could be visible to each other, including successive annotation processing rounds.
- Since:
- 1.6
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this name to the specifiedCharSequence.booleanReturnstrueif the argument represents the same name asthis, andfalseotherwise.inthashCode()Obeys the general contract ofObject.hashCode.Methods declared in interface CharSequence
charAt, chars, codePoints, getChars, isEmpty, length, subSequence, toStringModifier and TypeMethodDescriptioncharcharAt(int index) Returns thecharvalue at the specified index.default IntStreamchars()Returns a stream ofintzero-extending thecharvalues from this sequence.default IntStreamReturns a stream of code point values from this sequence.default voidgetChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) Copies characters from this sequence into the given destination array.default booleanisEmpty()Returnstrueif this character sequence is empty.intlength()Returns the length of this character sequence.subSequence(int start, int end) Returns aCharSequencethat is a subsequence of this sequence.toString()Returns a string containing the characters in this sequence in the same order as this sequence.
-
Method Details
-
equals
Returnstrueif the argument represents the same name asthis, andfalseotherwise.Note that the identity of a
Nameis a function both of its content in terms of a sequence of characters as well as the implementation which created it. -
hashCode
int hashCode()Obeys the general contract ofObject.hashCode. -
contentEquals
Compares this name to the specifiedCharSequence. The result istrueif and only if this name represents the same sequence ofcharvalues as the specified sequence.- Parameters:
cs- The sequence to compare this name against- Returns:
trueif this name represents the same sequence ofcharvalues as the specified sequence,falseotherwise- See Also:
-