prioritizer
Class DollarTechnique

java.lang.Object
  extended byprioritizer.DollarTechnique

public class DollarTechnique
extends java.lang.Object

Defines the $100 technique used.

Author:
Mikael Jönsson & Per Klingnäs

Field Summary
private  java.lang.String criteria
           
private  int[] currentPrio
           
private  int dollarsAvailible
           
private  int dollarsUsedInCurrent
           
private  int dollarsUsedInTotal
           
private  RequirementList rList
           
private  int[] totalPrio1
           
private  int[] totalPrio2
           
 
Constructor Summary
DollarTechnique(RequirementList rList)
          Constructor for the DollarTechnique.
 
Method Summary
 void criteriaDone()
          Sets the priorities for the current criteria.
 void done()
          Assigns the priorities to the requirements in the RequirementList.
 int getDollarsAvailible()
          Returns the number of dollars availible in current prioritization
 void nextUser()
          Completes a criteria and prepares the program for the next user to prioritize.
 void oneCriteriaDone(java.lang.String criteria)
          Is only used when going to the $100 technique from the PlanningGame.
 void setCriteria(java.lang.String criteria)
          Sets the current criteria.
 void setDollarsAvailible(int dollarsAvailible)
          Sets the number of dollars availible in current prioritization
 int setValue(int value, int row)
          Calculates how many dollar that have been used so far and checks if the new value will exceed the $100 limit or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

criteria

private java.lang.String criteria

currentPrio

private int[] currentPrio

dollarsUsedInCurrent

private int dollarsUsedInCurrent

dollarsUsedInTotal

private int dollarsUsedInTotal

rList

private RequirementList rList

totalPrio1

private int[] totalPrio1

totalPrio2

private int[] totalPrio2

dollarsAvailible

private int dollarsAvailible
Constructor Detail

DollarTechnique

public DollarTechnique(RequirementList rList)
Constructor for the DollarTechnique.

Parameters:
rList - the RequirementList containing the Requirements to be prioritized
Method Detail

getDollarsAvailible

public int getDollarsAvailible()
Returns the number of dollars availible in current prioritization

Returns:
the number of dollars availible

setDollarsAvailible

public void setDollarsAvailible(int dollarsAvailible)
Sets the number of dollars availible in current prioritization

Parameters:
dollarsAvailible - the number of dollars availible

criteriaDone

public void criteriaDone()
Sets the priorities for the current criteria.

Is called when a criteria has been completed in the normal $100 technique.


done

public void done()
Assigns the priorities to the requirements in the RequirementList.


oneCriteriaDone

public void oneCriteriaDone(java.lang.String criteria)
Is only used when going to the $100 technique from the PlanningGame. Sets priorities for the current criteria in the RequirementList.

Parameters:
criteria - the current criteria

nextUser

public void nextUser()
Completes a criteria and prepares the program for the next user to prioritize.


setCriteria

public void setCriteria(java.lang.String criteria)
Sets the current criteria.

Parameters:
criteria - the criteria.

setValue

public int setValue(int value,
                    int row)
Calculates how many dollar that have been used so far and checks if the new value will exceed the $100 limit or not.

Parameters:
value - the new value to try and set
row - the row in DollarWindow and index in the priority array
Returns:
  • The current amount of $ used if the $100 is not exceeded
  • -1 if the $100 limit is exceeded