| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.util.bloom.Key
public class Key
The general behavior of a key that must be stored in a filter.
The general behavior of a filter| Constructor Summary | |
|---|---|
| Key()default constructor - use with readFields | |
| Key(byte[] value)Constructor. | |
| Key(byte[] value,
    double weight)Constructor. | |
| Method Summary | |
|---|---|
|  int | compareTo(Key other) | 
|  boolean | equals(Object o) | 
|  byte[] | getBytes() | 
|  double | getWeight() | 
|  int | hashCode() | 
|  void | incrementWeight()Increments the weight of this key by one. | 
|  void | incrementWeight(double weight)Increments the weight of this key with a specified value. | 
|  void | readFields(DataInput in)Deserialize the fields of this object from in. | 
|  void | set(byte[] value,
    double weight) | 
|  void | write(DataOutput out)Serialize the fields of this object to out. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public Key()
public Key(byte[] value)
Builds a key with a default weight.
value - The byte value of this key.
public Key(byte[] value,
           double weight)
Builds a key with a specified weight.
value - The value of this key.weight - The weight associated to this key.| Method Detail | 
|---|
public void set(byte[] value,
                double weight)
value - weight - public byte[] getBytes()
public double getWeight()
public void incrementWeight(double weight)
weight - The increment.public void incrementWeight()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
public void write(DataOutput out)
           throws IOException
Writableout.
write in interface Writableout - DataOuput to serialize this object into.
IOException
public void readFields(DataInput in)
                throws IOException
Writablein.  
 
 For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields in interface Writablein - DataInput to deseriablize this object from.
IOExceptionpublic int compareTo(Key other)
compareTo in interface Comparable<Key>| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||