Package rocks.xmpp.core
Class Text
- java.lang.Object
-
- rocks.xmpp.core.Text
-
- All Implemented Interfaces:
CharSequence
,Comparable<Text>
,LanguageElement
public final class Text extends Object implements LanguageElement, CharSequence, Comparable<Text>
A common text element which is used by multiple elements and namespaces in XMPP. This list of elements it is used by includes:- A message's body or subject
- A presence's status
- A stanza error's text
- A stream error's text
- A SASL failure's text
This class is immutable and has a natural ordering which orders its text using a
Collator
instance of the locale (if any) and is consistent withequals
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description char
charAt(int index)
int
compareTo(Text o)
boolean
equals(Object o)
Locale
getLanguage()
Gets the language.String
getText()
Gets the text.int
hashCode()
int
length()
CharSequence
subSequence(int start, int end)
String
toString()
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Method Detail
-
getLanguage
public final Locale getLanguage()
Gets the language.- Specified by:
getLanguage
in interfaceLanguageElement
- Returns:
- The language.
-
getText
public final String getText()
Gets the text.- Returns:
- The text.
-
length
public final int length()
- Specified by:
length
in interfaceCharSequence
-
charAt
public final char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
subSequence
public final CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
compareTo
public final int compareTo(Text o)
- Specified by:
compareTo
in interfaceComparable<Text>
-
toString
public final String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
-