public final class Labels extends Object
Modifier and Type | Method and Description |
---|---|
void |
add(String... values)
Adds a multi-line label
|
void |
add(String value)
Adds a single line label
|
static Labels |
build()
Builds new label object
|
String |
getString(int index)
Returns a label at a specific index.
If at index there is multi-line label, returns labels with Constants.LINE_SEPARATOR as separator.If the index is out of bounds, throws an exception. |
List<String> |
getStrings(int index)
Returns a multi line label at a specific index.
|
ObjectType |
getType(int index)
Returns the type of a label at specific index.
|
int |
indexOf(String... values)
Returns the index of the first occurrence of the specified element in the labels, or -1 if this labels instance does not contain the element.
|
boolean |
isEmpty()
Returns
tree if no label is loaded. |
void |
load(List<String> values)
Loads single line labels.
|
void |
load(String... values)
Loads single line labels.
|
void |
remove(int index)
Removes an item of labels by index
|
int |
size()
Returns the amount of loaded labels.
|
public static Labels build()
public void load(String... values)
values
- array of labelspublic void load(List<String> values)
values
- array of labelspublic void add(String value)
value
- a single labelpublic void add(String... values)
values
- array of string which represents a multi line labelpublic void remove(int index)
index
- index of labelpublic int size()
public boolean isEmpty()
tree
if no label is loaded.tree
if no label is loadedpublic int indexOf(String... values)
values
- element to search for, if an array, the elements will be joined with Constants.LINE_SEPARATOR
public String getString(int index)
Constants.LINE_SEPARATOR
as separator.index
- index of labelpublic List<String> getStrings(int index)
index
- index of labelpublic ObjectType getType(int index)
index
- index of label