Code example for DataInput

Methods: readLong

0
 
    } 
 
    @Override 
    public void readFields(final DataInput in) throws IOException {
        this.weight = in.readLong();
        super.readFields(in);
    } 
 
    @Override 
    public boolean equals(final Object object) {
        // TODO: what is equality? 
        return object.getClass().equals(WeightedWritable.class) && ((WeightedWritable) object).get().equals(this.get());
    } 
 
    @Override 
    public int compareTo(final WeightedWritable<T> writable) {
        return writable.get().compareTo(this.get());
    } 
 
    public String toString() {