public class CharacteristicWritable extends Object implements org.apache.hadoop.io.WritableComparable<CharacteristicWritable>
Note that characteristics are compared based upon only the nodes and not their counts
Constructor and Description |
---|
CharacteristicWritable()
Creates an empty characteristic writable
|
CharacteristicWritable(Node n)
Creates a characteristic writable with the given node and the default
count of 1
|
CharacteristicWritable(Node n,
long count)
Creates a characteristic writable with the given node and count
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CharacteristicWritable o) |
boolean |
equals(Object other) |
org.apache.hadoop.io.LongWritable |
getCount()
Gets the count
|
NodeWritable |
getNode()
Gets the node
|
int |
hashCode() |
void |
increment()
Increments the count by 1
|
void |
increment(long l)
Increments the count by the given value
|
static CharacteristicWritable |
read(DataInput input)
Creates a new instance and reads in its data from the given input
|
void |
readFields(DataInput input) |
String |
toString() |
void |
write(DataOutput output) |
public CharacteristicWritable()
public CharacteristicWritable(Node n)
n
- Nodepublic CharacteristicWritable(Node n, long count)
n
- Nodecount
- Countpublic static CharacteristicWritable read(DataInput input) throws IOException
input
- InputIOException
public NodeWritable getNode()
public org.apache.hadoop.io.LongWritable getCount()
public void increment()
public void increment(long l)
l
- Value to increment bypublic void write(DataOutput output) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput input) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(CharacteristicWritable o)
compareTo
in interface Comparable<CharacteristicWritable>
Licenced under the Apache License, Version 2.0