Package elki.data

Class 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.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private LabelList​(int initialCapacity)
      Constructor.
      protected LabelList​(java.lang.String[] array)
      Private constructor.
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • 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
    • 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 class java.lang.Object