scheduler.model
Class Bin

java.lang.Object
  extended by scheduler.model.Bin

public class Bin
extends java.lang.Object

The basic alarm unit for reminders and a container of an arbitrary number of possible doses.


Constructor Summary
Bin()
          Creates a new single bin representation including zero doses by default and set to 12:00AM alarm time.
 
Method Summary
 void addDose(Dose dose)
          Adds a single dose to the bin specified by the dose argument.
 int getHour()
          Returns this bin's alarm hour.
 int getMinute()
          Returns this bin's alarm minute.
 Dose[] listDoses()
          Returns an array of doses currently in this bin.
 void removeDose(Dose dose)
          Removes a single dose specified by the dose argument from the bin.
 void setHour(int hour)
          Sets the bin alarm hour to the specified hour argument.
 void setMinute(int minute)
          Sets the bin alarm minute to the specified minute argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bin

public Bin()
Creates a new single bin representation including zero doses by default and set to 12:00AM alarm time.

Method Detail

setHour

public void setHour(int hour)
Sets the bin alarm hour to the specified hour argument.

Parameters:
hour - the new alarm hour for this bin

setMinute

public void setMinute(int minute)
Sets the bin alarm minute to the specified minute argument.

Parameters:
minute - the new alarm minute for this bin

getHour

public int getHour()
Returns this bin's alarm hour.

Returns:
alarm hour for this bin

getMinute

public int getMinute()
Returns this bin's alarm minute.

Returns:
alarm minute for this bin

addDose

public void addDose(Dose dose)
Adds a single dose to the bin specified by the dose argument.

Parameters:
dose - the dose instance to be added to this bin

removeDose

public void removeDose(Dose dose)
Removes a single dose specified by the dose argument from the bin.

Parameters:
dose - the dose instance to be remove from this bin

listDoses

public Dose[] listDoses()
Returns an array of doses currently in this bin.

Returns:
a Dose array