1 3 package org.jgroups.util; 4 5 6 import java.io.*; 7 8 9 10 public class Range implements Externalizable, Streamable { 11 public long low=-1; public long high=-1; 14 15 16 17 public Range() { 18 } 19 20 public Range(long low, long high) { 21 this.low=low; this.high=high; 22 } 23 24 25 26 public String toString() { 27 return "[" + low + " : " + high + ']'; 28 } 29 30 31 public void writeExternal(ObjectOutput out) throws IOException { 32 out.writeLong(low); 33 out.writeLong(high); 34 } 35 36 37 38 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { 39 low=in.readLong(); 40 high=in.readLong(); 41 } 42 43 44 public void writeTo(DataOutputStream out) throws IOException { 45 out.writeLong(low); 46 out.writeLong(high); 47 } 48 49 public void readFrom(DataInputStream in) throws IOException, IllegalAccessException , InstantiationException { 50 low=in.readLong(); 51 high=in.readLong(); 52 } 53 } 54 | Popular Tags |