org.mars_sim.msp.core.science
Class ScienceUtil

java.lang.Object
  extended by org.mars_sim.msp.core.science.ScienceUtil

public class ScienceUtil
extends java.lang.Object

Utility class for science fields.


Method Summary
static java.util.List<Science> getAllSciences()
          Gets a list of all sciences.
static Job[] getAssociatedJobs(Science science)
          Gets all jobs related to a scientific field.
static Science getAssociatedScience(Job job)
          Gets a science associated with a given job if any.
static java.lang.String getAssociatedSkill(Science science)
          Gets the skill associated with the science.
static Science getScience(java.lang.String name)
          Gets a science based on its name.
static boolean isCollaborativeScience(Science primaryScience, Science science)
          Checks if a science is collaborative to a primary science.
static boolean isScienceJob(Job job)
          Checks if a job is associated with any science.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllSciences

public static java.util.List<Science> getAllSciences()
Gets a list of all sciences.

Returns:
list of all sciences.

getScience

public static Science getScience(java.lang.String name)
Gets a science based on its name.

Parameters:
name - the science name (case insensitive).
Returns:
science or null if none found matching name.

getAssociatedSkill

public static java.lang.String getAssociatedSkill(Science science)
Gets the skill associated with the science.

Parameters:
science - the science.
Returns:
skill name.

getAssociatedJobs

public static Job[] getAssociatedJobs(Science science)
Gets all jobs related to a scientific field.

Parameters:
science - the scientific field.
Returns:
array of jobs (empty array if none).

isScienceJob

public static boolean isScienceJob(Job job)
Checks if a job is associated with any science.

Parameters:
job - the job.
Returns:
true if job is associated with a science.

getAssociatedScience

public static Science getAssociatedScience(Job job)
Gets a science associated with a given job if any.

Parameters:
job - the job.
Returns:
associated science or null if none.

isCollaborativeScience

public static boolean isCollaborativeScience(Science primaryScience,
                                             Science science)
Checks if a science is collaborative to a primary science.

Parameters:
primaryScience - the primary science.
science - the science to check.
Returns:
true if science is collaborative to primary science.