public class Duration
extends mvp.Model
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
hours
Hour component of a duration value, between 0 and 999
|
(package private) int |
minutes
Minute component of a duration value, between 0 and 60*999
|
| Constructor and Description |
|---|
Duration()
Construct an empty duration value.
|
Duration(int hours,
int minutes)
Construct a duration from the given hours and minutes.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
int hours
int minutes
public Duration()
public Duration(int hours,
int minutes)
public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object