Class AbstractLongListLabel

  • All Implemented Interfaces:
    Label, it.unimi.dsi.lang.FlyweightPrototype<Label>
    Direct Known Subclasses:
    FixedWidthLongListLabel

    public abstract class AbstractLongListLabel
    extends AbstractLabel
    implements Label
    An abstract (single-attribute) list-of-longs label.

    This class provides basic methods for a label holding a list of longs. Concrete implementations may impose further requirements on the long.

    Implementing subclasses must provide constructors, Label.copy(), Label#fromBitStream(it.unimi.dsi.io.InputBitStream, int), Label#toBitStream(it.unimi.dsi.io.OutputBitStream, int) and possibly override toString().

    • Field Detail

      • key

        protected final java.lang.String key
        The key of the attribute represented by this label.
      • value

        public long[] value
        The values of the attribute represented by this label.
    • Constructor Detail

      • AbstractLongListLabel

        public AbstractLongListLabel​(java.lang.String key,
                                     long[] value)
        Creates an long label with given key and value.
        Parameters:
        key - the (only) key of this label.
        value - the value of this label.
    • Method Detail

      • wellKnownAttributeKey

        public java.lang.String wellKnownAttributeKey()
        Description copied from interface: Label
        Returns the well-known attribute key.
        Specified by:
        wellKnownAttributeKey in interface Label
        Returns:
        the well-known attribute key.
      • attributeKeys

        public java.lang.String[] attributeKeys()
        Description copied from interface: Label
        All attribute keys (in arbitrary order).
        Specified by:
        attributeKeys in interface Label
        Returns:
        the keys of all attributes.
      • attributeTypes

        public java.lang.Class<?>[] attributeTypes()
        Description copied from interface: Label
        The types of all attributes in the same order as they are returned by Label.attributeKeys().
        Specified by:
        attributeTypes in interface Label
        Returns:
        the type of all attributes.
      • get

        public java.lang.Object get​(java.lang.String key)
        Description copied from interface: Label
        The value associated to the attribute with given key.
        Specified by:
        get in interface Label
        Parameters:
        key - the attribute key.
        Returns:
        the attribute value; if the attribute type is primitive, it is wrapped suitably.
      • get

        public java.lang.Object get()
        Description copied from interface: Label
        The value associated to the well-known attribute.
        Specified by:
        get in interface Label
        Returns:
        the attribute value; if the attribute type is primitive, it is wrapped suitably.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object