Class ClockDisplay
java.lang.Object
ClockDisplay
public class ClockDisplay
extends java.lang.Object
the ClockDisplay class creats the whole digital clock.
-
Constructor Summary
Constructors Constructor Description ClockDisplay()
creats a new clock set on 00:00:00ClockDisplay(int hour, int minute, int second)
creats a new clock set on hour , minute and second -
Method Summary
Modifier and Type Method Description java.lang.String
getTime()
gets the timevoid
setTime(int hour, int minute, int second)
sets the timevoid
timeTick()
increases the timevoid
updateDisplay()
updates the time
-
Constructor Details
-
ClockDisplay
public ClockDisplay()creats a new clock set on 00:00:00 -
ClockDisplay
public ClockDisplay(int hour, int minute, int second)creats a new clock set on hour , minute and second- Parameters:
hour
- the starting hourminute
- the starting minutesecond
- the starting second
-
-
Method Details
-
timeTick
public void timeTick()increases the time -
getTime
public java.lang.String getTime()gets the time- Returns:
- displayString field
-
setTime
public void setTime(int hour, int minute, int second)sets the time- Parameters:
hour
- the current hourminute
- the current minutesecond
- the current second
-
updateDisplay
public void updateDisplay()updates the time
-