|
|||||||||
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
it.unimi.dsi.webgraph.labelling.GammaCodedIntLabel
public class GammaCodedIntLabel
A natural number represented in γ coding.
Field Summary |
---|
Fields inherited from class it.unimi.dsi.webgraph.labelling.AbstractIntLabel |
---|
key, value |
Constructor Summary | |
---|---|
GammaCodedIntLabel(String... key)
Creates a new γ-coded label using the given key and value 0. |
|
GammaCodedIntLabel(String key,
int value)
Creates a new label with given key and value. |
Method Summary | |
---|---|
GammaCodedIntLabel |
copy()
Returns a copy of this label. |
int |
fixedWidth()
Returns -1 (as this label has not a fixed width). |
int |
fromBitStream(InputBitStream inputBitStream,
int sourceUnused)
Fills this label reading a γ-coded natural number from the given input bit stream. |
int |
toBitStream(OutputBitStream outputBitStream,
int sourceUnused)
Writes this label as a γ-coded natural number to the given output bit stream. |
String |
toSpec()
Returns a string representing the specification of this label. |
String |
toString()
|
Methods inherited from class it.unimi.dsi.webgraph.labelling.AbstractIntLabel |
---|
attributeKeys, attributeTypes, equals, get, get, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, hashCode, 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 |
---|
getBoolean, getBoolean, getByte, getByte, getChar, getChar, getShort, getShort |
Constructor Detail |
---|
public GammaCodedIntLabel(String key, int value)
key
- the (only) key.value
- the value of this label.public GammaCodedIntLabel(String... key)
key
- one string containing the key of this label.Method Detail |
---|
public GammaCodedIntLabel copy()
Label
public int fromBitStream(InputBitStream inputBitStream, int sourceUnused) throws IOException
inputBitStream
- an input bit stream.sourceUnused
- the source node.
IOException
public int toBitStream(OutputBitStream outputBitStream, int sourceUnused) throws IOException
outputBitStream
- an output bit stream.sourceUnused
- the source node.
IOException
public int fixedWidth()
public String toString()
toString
in class AbstractIntLabel
public String toSpec()
Label
Each label class can be instantiated in several ways (e.g., FixedWidthIntLabel
requires a name for the well-known attribute and a number of bits). This method must return
a representation that can be used by ObjectParser
to instantiate the class, and
consequently there must exist a matching constructor whose arguments are strings.
There is an equation that must be always satisfied:
ObjectParser.fromSpec( x.toSpec() ).toSpec().equals( x.toSpec() )
ObjectParser.fromSpec(String, Class)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |