/* CS 352 helper class * Author: Fan Zhang * class to represent 5 members in the routing table: target.java */ public class target extends Object { private String sMachine; //source machine name private int sPort; //source machine port private String tMachine; //target machine name private int tPort; //target machine port private int metric; //metric public target() //default constructor { set_sMachine ("localhost"); set_sPort(12000); set_tMachine ("localhost"); set_tPort(12000); set_Metric(1); } public target(target t) //overloaded constructor, //using existing target object { set_sMachine(t.get_sMachine()); set_sPort(t.get_sPort()); set_tMachine(t.get_tMachine()); set_tPort(t.get_tPort()); set_Metric(t.get_Metric()); } public void set_sMachine(String m) //set source machine name { sMachine = new String(m); } public void set_tMachine(String m) //set target machine name { tMachine = new String(m); } public void set_sPort(int p) //set source machine port { sPort = p; } public void set_tPort(int p) //set target machine port { tPort = p; } public void set_Metric(int c) //set metric { metric = c; } public String get_sMachine() //get source machine name { return sMachine; } public String get_tMachine() //get target machine name { return tMachine; } public int get_sPort() //get source machine port { return sPort; } public int get_tPort() //get target machine port { return tPort; } public int get_Metric() //get metric { return metric; } }