import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Writable;

public class PercentSpaceWritable implements Writable{
	private DoubleWritable percent;
	private LongWritable space;
	
	public PercentSpaceWritable(){ 
		this(new DoubleWritable(), new LongWritable());
	}
	
	public PercentSpaceWritable(DoubleWritable percent, LongWritable space){
		this.percent = percent;
		this.space = space;
	}

	public DoubleWritable getPercent() {
		return percent;
	}

	public LongWritable getSpace() {
		return space;
	}

	public String toString(){
		return(percent + " " + space);
	}
	
	public void readFields(DataInput in) throws IOException{
		percent.readFields(in);
		space.readFields(in);
	}
	
	public void write(DataOutput out) throws IOException{
		percent.write(out);
		space.write(out);
	}
}