diff options
| author | mokha <mokha@cisco.com> | 2019-05-08 18:40:01 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-05-08 18:40:01 -0600 |
| commit | 342fcc58ae1ca301cc6c25938dbb3814ff6d6e00 (patch) | |
| tree | c705b3f1b3f5e6ac8961228b808cf51213abd100 /src | |
| parent | 0132122de0a259c9b8e1a3e18e067027106f8956 (diff) | |
add documentation
Diffstat (limited to 'src')
| -rw-r--r-- | src/Q8/Candidate.java | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/src/Q8/Candidate.java b/src/Q8/Candidate.java index fbe4b7b..2d1241f 100644 --- a/src/Q8/Candidate.java +++ b/src/Q8/Candidate.java @@ -1,3 +1,11 @@ +/** + * Assignment 1, COMP268 Class: Candidate.java + * + * @description Represents a candidate + * @author: mo khan Student ID: 3431709 + * @date May 8, 2019 + * @version 1.0 + */ package Q8; import Q1.*; @@ -9,6 +17,16 @@ public class Candidate extends AddressBook { private boolean isInnovative; private double regulatoryCapability; + /** + * Constructs a Candidate object. + * + * @param firstName the first name of the runner + * @param lastName the last name of the runner + * @param grade the grade for the candidate + * @param communication the level of communication + * @param isInnovative specifies if the candidate is innovative. + * @param regulatoryCapability specifies the candidates level of regulatory capability + */ public Candidate( String firstName, String lastName, @@ -23,38 +41,63 @@ public class Candidate extends AddressBook { this.regulatoryCapability = regulatoryCapability; } + /** @return the candidates innovativeness. */ public boolean isInnovative() { return this.isInnovative; } + /** @return the candidates grade. */ public double getGrade() { return this.grade; } + /** @return the candidates regulatory capability */ public double getRegulation() { return this.regulatoryCapability; } + /** @return the candidates communication ability */ public String getCommunication() { return this.communication.toString(); } + /** + * Sets the candidate communication level. + * + * @param communication the candidates communication ability + */ public void setCommunication(String communication) { this.communication = Communication.findBy(communication); } + /** + * Sets the candidate grade level. + * + * @param grade the candidates grade + */ public void setGrade(double grade) { this.grade = grade; } + /** + * Sets the candidate innovation level. + * + * @param innovation the candidates innovation ability + */ public void setInnovation(boolean innovation) { this.isInnovative = innovation; } + /** + * Sets the candidate regulatory capability level. + * + * @param regulatoryCapability the candidates regulatory capability + */ public void setRegulation(double regulatoryCapability) { this.regulatoryCapability = regulatoryCapability; } + /** @return true if the candidate is eligible for a position at the company. */ public boolean isEligible() { if (this.grade >= 85.0) { return this.communication.isAtLeast(Communication.Average) || this.isInnovative(); @@ -64,12 +107,14 @@ public class Candidate extends AddressBook { } } + /** + * @param candidates the list of candidates to check for qualifications + * @return a list of candidates that are eligible for employment at the company. + */ public static ArrayList<Candidate> getEligibleCandidates(Candidate[] candidates) { ArrayList<Candidate> eligible = new ArrayList<Candidate>(); - for (Candidate candidate : candidates) { - if (candidate.isEligible()) eligible.add(candidate); - } + for (Candidate candidate : candidates) if (candidate.isEligible()) eligible.add(candidate); return eligible; } |
