|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.webgraph.labelling.AbstractLabel
it.unimi.dsi.webgraph.labelling.AbstractIntLabel
public abstract class AbstractIntLabel
An abstract (single-attribute) integer label.
This class provides basic methods for a label holding an integer. 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 | |
---|---|
protected String |
key
The key of the attribute represented by this label. |
int |
value
The value of the attribute represented by this label. |
Constructor Summary | |
---|---|
AbstractIntLabel(String key,
int value)
Creates an int label with given key and value. |
Method Summary | |
---|---|
String[] |
attributeKeys()
All attribute keys (in arbitrary order). |
Class<?>[] |
attributeTypes()
The types of all attributes in the same order as they are returned by Label.attributeKeys() . |
boolean |
equals(Object x)
|
Object |
get()
The value associated to the well-known attribute. |
Object |
get(String key)
The value associated to the attribute with given key. |
double |
getDouble()
The value associated to the well-known attribute, provided that the latter has a type that fits a double. |
double |
getDouble(String key)
The value associated to the attribute with given key, provided that the latter has a type that fits a double. |
float |
getFloat()
The value associated to the well-known attribute, provided that the latter has a type that fits a float. |
float |
getFloat(String key)
The value associated to the attribute with given key, provided that the latter has a type that fits a float. |
int |
getInt()
The value associated to the well-known attribute, provided that the latter has a type that fits a int. |
int |
getInt(String key)
The value associated to the attribute with given key, provided that the latter has a type that fits a int. |
long |
getLong()
The value associated to the well-known attribute, provided that the latter has a type that fits a long. |
long |
getLong(String key)
The value associated to the attribute with given key, provided that the latter has a type that fits a long. |
int |
hashCode()
|
String |
toString()
|
String |
wellKnownAttributeKey()
Returns the well-known attribute key. |
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 |
---|
protected final String key
public int value
Constructor Detail |
---|
public AbstractIntLabel(String key, int value)
key
- the (only) key of this label.value
- the value of this label.Method Detail |
---|
public String wellKnownAttributeKey()
Label
wellKnownAttributeKey
in interface Label
public String[] attributeKeys()
Label
attributeKeys
in interface Label
public Class<?>[] attributeTypes()
Label
Label.attributeKeys()
.
attributeTypes
in interface Label
public Object get(String key)
Label
get
in interface Label
key
- the attribute key.
public int getInt(String key)
Label
IllegalArgumentException
is thrown.
getInt
in interface Label
getInt
in class AbstractLabel
key
- the attribute key.
public long getLong(String key)
Label
IllegalArgumentException
is thrown.
getLong
in interface Label
getLong
in class AbstractLabel
key
- the attribute key.
public float getFloat(String key)
Label
IllegalArgumentException
is thrown.
getFloat
in interface Label
getFloat
in class AbstractLabel
key
- the attribute key.
public double getDouble(String key)
Label
IllegalArgumentException
is thrown.
getDouble
in interface Label
getDouble
in class AbstractLabel
key
- the attribute key.
public Object get()
Label
get
in interface Label
public int getInt()
Label
IllegalArgumentException
is thrown.
getInt
in interface Label
getInt
in class AbstractLabel
public long getLong()
Label
IllegalArgumentException
is thrown.
getLong
in interface Label
getLong
in class AbstractLabel
public float getFloat()
Label
getFloat
in interface Label
getFloat
in class AbstractLabel
public double getDouble()
Label
IllegalArgumentException
is thrown.
getDouble
in interface Label
getDouble
in class AbstractLabel
public String toString()
toString
in class Object
public boolean equals(Object x)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |