Package it.unimi.dsi.webgraph.labelling
Class AbstractIntListLabel
java.lang.Object
it.unimi.dsi.webgraph.labelling.AbstractLabel
it.unimi.dsi.webgraph.labelling.AbstractIntListLabel
- All Implemented Interfaces:
FlyweightPrototype<Label>
,Label
- Direct Known Subclasses:
FixedWidthIntListLabel
public abstract class AbstractIntListLabel extends AbstractLabel implements Label
An abstract (single-attribute) list-of-integers label.
This class provides basic methods for a label holding a list of integers. Concrete implementations may impose further requirements on the integer.
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 Summary
-
Constructor Summary
Constructors Constructor Description AbstractIntListLabel(java.lang.String key, int[] value)
Creates an int label with given key and value. -
Method Summary
Modifier and Type Method Description java.lang.String[]
attributeKeys()
All attribute keys (in arbitrary order).java.lang.Class<?>[]
attributeTypes()
The types of all attributes in the same order as they are returned byLabel.attributeKeys()
.boolean
equals(java.lang.Object x)
java.lang.Object
get()
The value associated to the well-known attribute.java.lang.Object
get(java.lang.String key)
The value associated to the attribute with given key.int
hashCode()
java.lang.String
toString()
java.lang.String
wellKnownAttributeKey()
Returns the well-known attribute key.Methods inherited from class it.unimi.dsi.webgraph.labelling.AbstractLabel
getBoolean, getBoolean, getByte, getByte, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface it.unimi.dsi.webgraph.labelling.Label
copy, fixedWidth, fromBitStream, getBoolean, getBoolean, getByte, getByte, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, toBitStream, toSpec
-
Field Details
-
Constructor Details
-
AbstractIntListLabel
public AbstractIntListLabel(java.lang.String key, int[] value)Creates an int label with given key and value.- Parameters:
key
- the (only) key of this label.value
- the value of this label.
-
-
Method Details
-
wellKnownAttributeKey
public java.lang.String wellKnownAttributeKey()Description copied from interface:Label
Returns the well-known attribute key.- Specified by:
wellKnownAttributeKey
in interfaceLabel
- 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 interfaceLabel
- 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 byLabel.attributeKeys()
.- Specified by:
attributeTypes
in interfaceLabel
- 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. -
get
public java.lang.Object get()Description copied from interface:Label
The value associated to the well-known attribute. -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-