Code example for TreeSet

Methods: clear

0
	public void addValue(long value) {
		values.add(value);
	} 
 
	public void reset() { 
		values.clear();
	} 
 
	@Override 
	public void readFrom(DataInput input) throws IOException {
		values.clear();
		int nelements = input.readInt();
		for (int i = 0; i < nelements; ++i) {
			values.add(input.readLong());
		} 
	} 
 
	@Override 
	public void writeTo(DataOutput output) throws IOException {
		output.writeInt(values.size());
		for(long el : values) {