org.jscience.economics
Class Worker

java.lang.Object
  extended by org.jscience.sociology.Role
      extended by org.jscience.economics.EconomicAgent
          extended by org.jscience.economics.Worker
All Implemented Interfaces:
Named
Direct Known Subclasses:
Doctor, Judge, JuryMember, Lawyer, MasterOfCeremony, Prosecutor

public class Worker
extends EconomicAgent

A class representing a worker in an organization. This class also accounts for the real flow of decision in an organization.


Field Summary
 
Fields inherited from class org.jscience.sociology.Role
CLIENT, OBSERVER, SERVER, SUPERVISOR
 
Constructor Summary
Worker(Individual individual, WorkSituation workSituation, java.lang.String function, Organization organization)
          Creates a new Worker object.
 
Method Summary
 void addSubaltern(Worker child)
          DOCUMENT ME!
 boolean equals(java.lang.Object o)
          DOCUMENT ME!
static Tree extractTree(Worker worker1, Worker worker2)
          DOCUMENT ME!
 java.util.Set getAllSubalterns()
          DOCUMENT ME!
 Amount<Money> getAnnualIncome()
          DOCUMENT ME!
 java.util.Set getChiefs()
          DOCUMENT ME!
static Worker getCommonRoot(Worker worker1, Worker worker2)
          DOCUMENT ME!
 java.util.Set getCoWorkers()
          DOCUMENT ME!
 java.lang.String getFunction()
          DOCUMENT ME!
 java.util.Set getLeaders()
          DOCUMENT ME!
static java.util.Vector getLineage(Worker worker1, Worker worker2)
          DOCUMENT ME!
 Organization getOrganization()
          DOCUMENT ME!
 java.util.Set getSubalterns()
          DOCUMENT ME!
 java.util.Set getSubalternsAtLevelK(int k)
          DOCUMENT ME!
 double getWorkedHours()
          DOCUMENT ME!
 boolean hasChief()
          DOCUMENT ME!
 boolean hasChild()
          DOCUMENT ME!
 boolean hasChild(Worker child)
          DOCUMENT ME!
 boolean hasDistantSubaltern(Worker child)
          DOCUMENT ME!
 void removeSubaltern(Worker child)
          DOCUMENT ME!
 void reparent(Worker oldParent, Worker newParent)
          DOCUMENT ME!
 void setAnnualIncome(Amount<Money> annualIncome)
          DOCUMENT ME!
 void setFunction(java.lang.String function)
          DOCUMENT ME!
 void setOrganization(Organization organization)
          DOCUMENT ME!
 void setSubalterns(java.util.Set subalterns)
          DOCUMENT ME!
 void setWorkedHours(double workedHours)
          DOCUMENT ME!
 
Methods inherited from class org.jscience.economics.EconomicAgent
addBelonging, getBelongings, getCommunity, getWallet, removeBelonging, setBelongings, setWallet
 
Methods inherited from class org.jscience.sociology.Role
getIndividual, getKind, getName, getSituation, setSituation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Worker

public Worker(Individual individual,
              WorkSituation workSituation,
              java.lang.String function,
              Organization organization)
Creates a new Worker object.

Parameters:
individual - DOCUMENT ME!
workSituation - DOCUMENT ME!
function - DOCUMENT ME!
organization - DOCUMENT ME!
Method Detail

getFunction

public java.lang.String getFunction()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setFunction

public void setFunction(java.lang.String function)
DOCUMENT ME!

Parameters:
function - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

getAnnualIncome

public Amount<Money> getAnnualIncome()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setAnnualIncome

public void setAnnualIncome(Amount<Money> annualIncome)
DOCUMENT ME!

Parameters:
annualIncome - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

getWorkedHours

public double getWorkedHours()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setWorkedHours

public void setWorkedHours(double workedHours)
DOCUMENT ME!

Parameters:
workedHours - DOCUMENT ME!

hasChild

public boolean hasChild()
DOCUMENT ME!

Returns:
DOCUMENT ME!

hasChild

public boolean hasChild(Worker child)
DOCUMENT ME!

Parameters:
child - DOCUMENT ME!
Returns:
DOCUMENT ME!

getSubalterns

public java.util.Set getSubalterns()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setSubalterns

public void setSubalterns(java.util.Set subalterns)
                   throws CircularReferenceException,
                          java.lang.IllegalArgumentException
DOCUMENT ME!

Parameters:
subalterns - DOCUMENT ME!
Throws:
CircularReferenceException - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!

addSubaltern

public void addSubaltern(Worker child)
                  throws CircularReferenceException,
                         java.lang.IllegalArgumentException
DOCUMENT ME!

Parameters:
child - DOCUMENT ME!
Throws:
CircularReferenceException - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!

removeSubaltern

public void removeSubaltern(Worker child)
DOCUMENT ME!

Parameters:
child - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

hasChief

public boolean hasChief()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getChiefs

public java.util.Set getChiefs()
DOCUMENT ME!

Returns:
DOCUMENT ME!

reparent

public void reparent(Worker oldParent,
                     Worker newParent)
              throws java.lang.IllegalArgumentException
DOCUMENT ME!

Parameters:
oldParent - DOCUMENT ME!
newParent - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

getLeaders

public java.util.Set getLeaders()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getCoWorkers

public java.util.Set getCoWorkers()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getCommonRoot

public static Worker getCommonRoot(Worker worker1,
                                   Worker worker2)
DOCUMENT ME!

Parameters:
worker1 - DOCUMENT ME!
worker2 - DOCUMENT ME!
Returns:
DOCUMENT ME!

getLineage

public static java.util.Vector getLineage(Worker worker1,
                                          Worker worker2)
DOCUMENT ME!

Parameters:
worker1 - DOCUMENT ME!
worker2 - DOCUMENT ME!
Returns:
DOCUMENT ME!

extractTree

public static Tree extractTree(Worker worker1,
                               Worker worker2)
DOCUMENT ME!

Parameters:
worker1 - DOCUMENT ME!
worker2 - DOCUMENT ME!
Returns:
DOCUMENT ME!

getAllSubalterns

public java.util.Set getAllSubalterns()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getSubalternsAtLevelK

public java.util.Set getSubalternsAtLevelK(int k)
DOCUMENT ME!

Parameters:
k - DOCUMENT ME!
Returns:
DOCUMENT ME!

hasDistantSubaltern

public boolean hasDistantSubaltern(Worker child)
DOCUMENT ME!

Parameters:
child - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

equals

public boolean equals(java.lang.Object o)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
o - DOCUMENT ME!
Returns:
DOCUMENT ME!

getOrganization

public Organization getOrganization()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setOrganization

public void setOrganization(Organization organization)
DOCUMENT ME!

Parameters:
organization - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!