public class
Employee
{
private int id;
private
Name name;
private
Address address;
private Job
job;
public Employee(int i, Name n,
Address a, Job j)
{
id = i;
name = n;
address = a;
job = j;
}
//This constructor is probably
too difficult to use effectively.
public Employee(int i, String fir,
String mid, String las, int snu, String sna, String st, String an,
String ci, String pr,
String co, String pc,
String jt,
String ti,
String de, double sa, int vac)
{
id = i;
name = new Name(fir, mid, las);
address = new Address(snu, sna, st, an, ci, pr, co, pc);
job = new Job(ti, de, sa, vac);
}
public int getId()
{
return id;
}
public
Name getName()
{
return name;
}
public
Address getAddress()
{
return address;
}
public Job
getJob()
{
return job;
}
public
String getMailingAddress()
{
return "" + name + "\n" + address;
}
public
String toString()
{
String s = "";
s = s + "Name:
" + name + "\n";
s = s + "Id:
" + id + "\n";
s = s + "Job:
" + job.getTitle() +
"\n";
return s;
}
}
|