Package elki.data
Class LabelList
- java.lang.Object
-
- elki.data.LabelList
-
public class LabelList extends java.lang.Object
A list of string labels.- Since:
- 0.4.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LabelList.Serializer
Serialization class.
-
Field Summary
Fields Modifier and Type Field Description static LabelList
EMPTY_LABELS
Empty label list.private java.lang.String[]
labels
Labels.static ByteBufferSerializer<LabelList>
SERIALIZER
Serializer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
get(int i)
Get the label at position i.static LabelList
make(java.util.Collection<java.lang.String> labels)
Constructor replacement.int
size()
Size of label list.java.lang.String
toString()
-
-
-
Field Detail
-
SERIALIZER
public static final ByteBufferSerializer<LabelList> SERIALIZER
Serializer.
-
labels
private java.lang.String[] labels
Labels.
-
EMPTY_LABELS
public static final LabelList EMPTY_LABELS
Empty label list.
-
-
Constructor Detail
-
LabelList
private LabelList(int initialCapacity)
Constructor.- Parameters:
initialCapacity
- initial size
-
LabelList
protected LabelList(java.lang.String[] array)
Private constructor. Usemake(java.util.Collection<java.lang.String>)
.- Parameters:
array
- Label list
-
-
Method Detail
-
make
public static LabelList make(java.util.Collection<java.lang.String> labels)
Constructor replacement. When the label list is empty, it will produce the same instance!- Parameters:
labels
- Existing labels- Returns:
- Label list instance.
-
size
public int size()
Size of label list.- Returns:
- Size
-
get
public java.lang.String get(int i)
Get the label at position i.- Parameters:
i
- Position- Returns:
- Label
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-