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:00
    ClockDisplay​(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 time
    void setTime​(int hour, int minute, int second)
    sets the time
    void timeTick()
    increases the time
    void updateDisplay()
    updates the time

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 hour
      minute - the starting minute
      second - 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 hour
      minute - the current minute
      second - the current second
    • updateDisplay

      public void updateDisplay()
      updates the time