es.yrbcn.graph.weighted
Class AbstractFloatLabel

java.lang.Object
  extended by it.unimi.dsi.webgraph.labelling.AbstractLabel
      extended by 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.
 
Constructor Summary
AbstractFloatLabel(String key, float value)
          Creates an int label with given key and value.
 
Method Summary
 String[] attributeKeys()
           
 Class[] attributeTypes()
           
 boolean equals(Object x)
           
 Object get()
           
 Object get(String theKey)
           
 double getDouble()
           
 double getDouble(String theKey)
           
 float getFloat()
           
 float getFloat(String theKey)
           
 int getInt()
           
 int getInt(String theKey)
           
 long getLong()
           
 long getLong(String theKey)
           
 int hashCode()
           
 String toString()
           
 String wellKnownAttributeKey()
           
 
Methods inherited from class it.unimi.dsi.webgraph.labelling.AbstractLabel
getBoolean, getBoolean, getByte, getByte, getChar, getChar, 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, getShort, getShort, toBitStream, toSpec
 

Field Detail

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.

Constructor Detail

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.
Method Detail

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