Class Time
Class Time
java.lang.Object
|
+----Time
- public class Time
- extends Object
Time is a generic object for keeping the time.
-
hour
- The hour.
-
minute
- The minute.
-
Time(int, int)
- Creates a new time from the specified hours and minutes.
-
Time(Date)
- Creates a new Time object based on the given Date object.
-
Time()
- Creates a new, empty Time object.
-
equals(Object)
- Compares this Time to the specified Object.
-
hashCode()
- Returns the hash code associated with this Time object.
-
toString()
- Returns a new String representing the time.
hour
public int hour
- The hour.
minute
public int minute
- The minute.
Time
public Time(int h,
int m)
- Creates a new time from the specified hours and minutes.
- Parameters:
- h - the hours
- m - the minutes
Time
public Time(Date d)
- Creates a new Time object based on the given Date object.
- Parameters:
- d - the Date object to create the Time from
- See Also:
- Date
Time
public Time()
- Creates a new, empty Time object.
toString
public String toString()
- Returns a new String representing the time.
- Overrides:
- toString in class Object
hashCode
public int hashCode()
- Returns the hash code associated with this Time object.
- Overrides:
- hashCode in class Object
- See Also:
- Hashtable
equals
public boolean equals(Object o)
- Compares this Time to the specified Object.
Returns true if the Object is equal to this Time; that is,
has the same hour and minute.
- Parameters:
- o - the object to compare this Time against.
- Returns:
- true if the Times are equal; false otherwise.
- Overrides:
- equals in class Object