es.yrbcn.graph.weighted
Class AbstractFloatLabel
java.lang.Object
it.unimi.dsi.webgraph.labelling.AbstractLabel
es.yrbcn.graph.weighted.AbstractFloatLabel
- All Implemented Interfaces:
- it.unimi.dsi.lang.FlyweightPrototype<Label>, Label
- Direct Known Subclasses:
- FixedWidthFloatLabel
public abstract class AbstractFloatLabel
- extends AbstractLabel
- implements Label
An abstract (single-attribute) float label.
This class provides basic methods for a label holding a floating-point number.
Concrete implementations may impose further requirements on the number.
Implementing subclasses must provide constructors, Label#copy()
,
Label#fromBitStream(it.unimi.dsi.io.InputBitStream, int)
, Label#toBitStream(it.unimi.dsi.mg4j.io.OutputBitStream, int)
and possibly ovveride toString()
.
Field Summary |
protected String |
key
The key of the attribute represented by this label. |
float |
value
The value of the attribute represented by this label. |
Methods inherited from interface it.unimi.dsi.webgraph.labelling.Label |
copy, fixedWidth, fromBitStream, getBoolean, getBoolean, getByte, getByte, getChar, getChar, getShort, getShort, toBitStream, toSpec |
key
protected final String key
- The key of the attribute represented by this label.
value
public float value
- The value of the attribute represented by this label.
AbstractFloatLabel
public AbstractFloatLabel(String key,
float value)
- Creates an int label with given key and value.
- Parameters:
key
- the (only) key of this label.value
- the value of this label.
wellKnownAttributeKey
public String wellKnownAttributeKey()
- Specified by:
wellKnownAttributeKey
in interface Label
attributeKeys
public String[] attributeKeys()
- Specified by:
attributeKeys
in interface Label
attributeTypes
public Class[] attributeTypes()
- Specified by:
attributeTypes
in interface Label
get
public Object get(String theKey)
- Specified by:
get
in interface Label
getInt
public int getInt(String theKey)
- Specified by:
getInt
in interface Label
- Overrides:
getInt
in class AbstractLabel
getLong
public long getLong(String theKey)
- Specified by:
getLong
in interface Label
- Overrides:
getLong
in class AbstractLabel
getFloat
public float getFloat(String theKey)
- Specified by:
getFloat
in interface Label
- Overrides:
getFloat
in class AbstractLabel
getDouble
public double getDouble(String theKey)
- Specified by:
getDouble
in interface Label
- Overrides:
getDouble
in class AbstractLabel
get
public Object get()
- Specified by:
get
in interface Label
getInt
public int getInt()
- Specified by:
getInt
in interface Label
- Overrides:
getInt
in class AbstractLabel
getLong
public long getLong()
- Specified by:
getLong
in interface Label
- Overrides:
getLong
in class AbstractLabel
getFloat
public float getFloat()
- Specified by:
getFloat
in interface Label
- Overrides:
getFloat
in class AbstractLabel
getDouble
public double getDouble()
- Specified by:
getDouble
in interface Label
- Overrides:
getDouble
in class AbstractLabel
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object x)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object