Nurse - return knownDocs; } public void setKnownDocs(Doctor...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.lang.*; public class Nurse implements Employable, Comparable, Cloneable { private double salary; private String name; private int SSN; Doctor[] knownDocs; D public Nurse(){ this(0, "",0, new Doctor[0]); } public Nurse(String name, int SSN) { this(0, name, SSN, new Doctor[0]); } public Nurse(double salary, String name, int SSN, Doctor[] knownDocs){ setSalary(salary); setName(name); setSSN(SSN); setKnownDocs(knownDocs); } public double getSalary(){ return salary; } public void setSalary(double salary){ this.salary = salary; } public String getName(){ return name; } public void setName(String name){ this.name = name; } public int getSSN(){ return SSN; } public void setSSN(int SSN){ this.SSN = SSN; } public Doctor[] getKnownDocs(){
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return knownDocs; } public void setKnownDocs(Doctor knownDocs){ this.knownDocs = knownDocs; } public double getBiWeeklyPay(){ return (salary/26.0)*0.8; } public Object clone() { try { Nurse n = (Nurse)super.clone(); Doctor kDocs = new Doctor[knownDocs.length]; for( int i=0; i<kDocs.length; i++ ) f if (knownDocs[i] != null) kDocs[i] = (Doctor)knownDocs[i].clone(); k else kDocs[i]= null; n.knownDocs = kDocs; return n; r } catch(CloneNotSupportedException ex){ return null; } } public int compareTo(Object o) { int v = name.compareTo(((Nurse)o).getName()); return v!=0?v:(int)Math.signum((SSN-((Nurse)o).getSSN())); } }...
View Full Document

Page1 / 2

Nurse - return knownDocs; } public void setKnownDocs(Doctor...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online