caltool.schedule
Class Duration

java.lang.Object
  extended by java.util.Observable
      extended by mvp.Model
          extended by caltool.schedule.Duration
All Implemented Interfaces:
java.io.Serializable

public class Duration
extends mvp.Model

Duration is the time length of a scheduled item, in hours and minutes. The miniumn duration value is 1 minute. The maximum is 999 houus.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class mvp.Model
view
 
Constructor Summary
Duration()
          Construct an empty duration value.
Duration(int hours, int minutes)
          Construct a duration from the given hours and minutes.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Define equality for this as componentwise equality.
 int hashCode()
          Define the hash code for this as the sum of the components.
 boolean isEmpty()
          Return true if this is an empty duration, indicated by both hours and minutes = 0.
 java.lang.String toString()
          Return the string representation of this.
 
Methods inherited from class mvp.Model
dump, exit, getView, setView
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Duration

public Duration()
Construct an empty duration value.


Duration

public Duration(int hours,
                int minutes)
Construct a duration from the given hours and minutes.

Method Detail

isEmpty

public boolean isEmpty()
Return true if this is an empty duration, indicated by both hours and minutes = 0.


toString

public java.lang.String toString()
Return the string representation of this.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Define equality for this as componentwise equality.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Define the hash code for this as the sum of the components. This hash code is used in turn by ItemKey.hashCode.

Overrides:
hashCode in class java.lang.Object