public class IntWritable extends Object implements WritableComparable
Writable 和 WritableComparable 的实现| Modifier and Type | Class and Description |
|---|---|
static class |
IntWritable.Comparator
IntWritable 对象的
WritableComparator 自然顺序实现(升序). |
| Constructor and Description |
|---|
IntWritable()
默认构造int 值为0的 IntWritable.
|
IntWritable(int value)
构造int 值为给定 value 的 IntWritable.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object o)
比较两个 IntWritable 的值.
|
boolean |
equals(Object o)
判断两个 IntWritable 是否相等.
|
int |
get()
返回此 IntWritable 的值
|
int |
hashCode()
计算哈希值,直接返回此 IntWritable 的值.
|
void |
readFields(DataInput in)
从指定的
DataInput in 反序列化. |
void |
set(int value)
设置 IntWritable 的值
|
String |
toString() |
void |
write(DataOutput out)
序列化到指定的
DataOutput out. |
public IntWritable()
public IntWritable(int value)
value - public void set(int value)
value - public int get()
public void readFields(DataInput in) throws IOException
WritableDataInput in 反序列化.readFields in interface WritableIOExceptionpublic void write(DataOutput out) throws IOException
WritableDataOutput out.write in interface WritableIOExceptionpublic boolean equals(Object o)
如果两个都是 IntWritable 且值相等,返回true,否则返回false
public int compareTo(Object o)
compareTo in interface Comparableo - 比较对象Copyright © 2021 Alibaba Cloud Computing. All rights reserved.