Class ListOfSkills

java.lang.Object
  |
  +--ListOfSkills
All Implemented Interfaces:
java.lang.Cloneable

public class ListOfSkills
extends java.lang.Object
implements java.lang.Cloneable

Represents a list of employee skills.


Field Summary
private  java.util.Vector data
          A vector of skills
 
Constructor Summary
ListOfSkills()
          Constructs an empty list of skills
ListOfSkills(java.util.Vector skills)
          Construct a list of skills from a vector of skills
 
Method Summary
 void AddSkill(Skills toAdd)
          Add a skill to the list.
 java.lang.Object clone()
          Creates a copy of the current object
 Skills GetSkill(java.lang.String skillName)
          Get a particular skill from a list.
 java.lang.String[] GetSkillNames()
          Gets the names of all the skills in the list
 boolean IsIn(Skills toCheck)
          Checks to see if a skill is in the list
 void RemoveSkills(ListOfSkills toRemove)
          Removes skills from the list
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

data

private java.util.Vector data
A vector of skills
Constructor Detail

ListOfSkills

public ListOfSkills()
Constructs an empty list of skills

Pre-conditions: none
Post-conditions: The vector of data for this class is initialized.


ListOfSkills

public ListOfSkills(java.util.Vector skills)
Construct a list of skills from a vector of skills

Pre-conditions: none
Post-conditions: The private vector of date for this class is set to the passed vector.

Parameters:
skills - a vector of skills to be added to the new list
Method Detail

AddSkill

public void AddSkill(Skills toAdd)
Add a skill to the list.

Pre-conditions: A valid variable of type Skills is passed.
Post-conditions: The private variable is set to the passed variable.

Parameters:
toAdd - skill to add to the list

RemoveSkills

public void RemoveSkills(ListOfSkills toRemove)
Removes skills from the list

Pre-conditions: A valid variable of type ListOfSkills is passed.
Post-conditions: If the passed skills exist in the private vector, they are removed.

Parameters:
toRemove - a list of skills to remove

GetSkillNames

public java.lang.String[] GetSkillNames()
Gets the names of all the skills in the list

Pre-conditions: none
Post-conditions: The list of skills is returned as an array of skills.

Returns:
an array of strings representing all the names of skills in the list

GetSkill

public Skills GetSkill(java.lang.String skillName)
Get a particular skill from a list.

Pre-conditions: A valid variable of type String is passed containing a valid skill name.
Post-conditions: If the passed skill's name is found in the private vector of skills, a variable of type Skills is returned.

Parameters:
skillName - the name of the skill to get
Returns:
a copy of the skill that matches the given name; if none is found, then return is null

IsIn

public boolean IsIn(Skills toCheck)
Checks to see if a skill is in the list

Pre-conditions: A valid variable of type Skills is passed.
Post-conditions: If the passed variable is found in the vector of skills, then True is returned. Otherwise False is returned.

Parameters:
toCheck - skill to look for in the list (Searches by name)
Returns:
true if the skill is in the list, false otherwise

clone

public java.lang.Object clone()
Creates a copy of the current object

Pre-conditions: none
Post-conditions: A copy of the current ListOfEmployees object is returned.

Overrides:
clone in class java.lang.Object
Returns:
the copy