Package de.xima.fc.common.graphdot
Class LabelString
- java.lang.Object
-
- de.xima.fc.common.graphdot.LabelString
-
- All Implemented Interfaces:
Serializable
,CharSequence
public final class LabelString extends Object
Represents a label string, either plain text or HTML."hello-world" <<strong>hello world</strong>>
- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LabelString(CharSequence label)
Creates a new label string with the given content.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Default Methods Modifier and Type Method Description default char
charAt(int index)
default IntStream
chars()
default IntStream
codePoints()
boolean
equals(Object obj)
CharSequence
getLabel()
int
hashCode()
static LabelString
html(String html)
Uses an HTML text for the label.default int
length()
static LabelString
plain(String text)
Uses a plain text for the label.default CharSequence
subSequence(int start, int end)
String
toString()
-
-
-
Constructor Detail
-
LabelString
public LabelString(CharSequence label)
Creates a new label string with the given content.- Parameters:
label
- Content of the label string.
-
-
Method Detail
-
getLabel
public CharSequence getLabel()
- Returns:
- The label text or HTML.
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
-
html
public static LabelString html(String html)
Uses an HTML text for the label.- Parameters:
html
- Label text.- Returns:
- A label string with an HTML text label.
-
plain
public static LabelString plain(String text)
Uses a plain text for the label.- Parameters:
text
- Label text.- Returns:
- A label string with a plain text label.
-
charAt
public default char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
chars
public default IntStream chars()
- Specified by:
chars
in interfaceCharSequence
-
codePoints
public default IntStream codePoints()
- Specified by:
codePoints
in interfaceCharSequence
-
length
public default int length()
- Specified by:
length
in interfaceCharSequence
-
subSequence
public default CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
-