com.dalsemi.system
Class Clock

java.lang.Object
  |
  +--com.dalsemi.system.Clock

public class Clock
extends java.lang.Object

This class provides access to the TINI Real-Time clock. The methods support setting and getting the clock values. Getting the time involves calling getRTC() and then accessing the public static ints (i.e. year, month, hour,...) to get the clock values. Setting the time involves setting the public static ints (i.e. year, month, hour, ...) and then calling setRTC(). This class will be modified at a later date to conform to Java clock/calendar classes.


Field Summary
 int date
          Day of the month
 int day
          Day of the week
 int hour
          Hour
 int hundredth
          Hundreths of seconds
 boolean is12Hour
          12/24 hour flag
 int minute
          Minute
 int month
          Month
 boolean pm
          PM/AM flag
 int second
          Second
 int year
          Year mod 100
 
Constructor Summary
Clock()
          Constructor
 
Method Summary
 boolean get12Hour()
          get the 12/24 hour mode for the Real Time Clock.
 int getDate()
          get the date value for the Real Time Clock.
 int getDay()
          get the day value for the Real Time Clock.
 int getHour()
          get the hour value for the Real Time Clock.
 int getHundredth()
          get the hundredth value for the Real Time Clock.
 int getMinute()
          get the minute value for the Real Time Clock.
 int getMonth()
          get the month value for the Real Time Clock.
 boolean getPm()
          get the AM/PM value for the Real Time Clock.
 void getRTC()
          Reads Real time clock values from hardware clock and places them into Clock static fields.
 int getSecond()
          get the second value for the Real Time Clock.
 int getTickCount()
          Get the current time in milliseconds.
 int getYear()
          get the year value for the Real Time Clock.
 void set12Hour(boolean is12Hour)
          Sets the 12/24 hour mode of the Real Time Clock.
 void setDate(int Date)
          Sets the date value of the Real Time Clock.
 void setDay(int Day)
          Sets the day value of the Real Time Clock.
 void setHour(int Hour)
          Sets the hour value of the Real Time Clock.
 void setHundredth(int Hundredth)
          Sets the hundredth value of the Real Time Clock.
 void setMinute(int Minute)
          Sets the minute value of the Real Time Clock.
 void setMonth(int Month)
          Sets the month value of the Real Time Clock.
 void setPm(boolean PM)
          Sets the AM/PM value of the Real Time Clock.
 void setRTC()
          Reads real time clock values from static ints and writes them to the hardware clock.
 void setSecond(int Second)
          Sets the second value of the Real Time Clock.
 void setYear(int Year)
          Sets the year value of the Real Time Clock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

year

public int year
Year mod 100

month

public int month
Month

day

public int day
Day of the week

date

public int date
Day of the month

hour

public int hour
Hour

minute

public int minute
Minute

second

public int second
Second

hundredth

public int hundredth
Hundreths of seconds

pm

public boolean pm
PM/AM flag

is12Hour

public boolean is12Hour
12/24 hour flag
Constructor Detail

Clock

public Clock()
Constructor
Method Detail

setYear

public void setYear(int Year)
Sets the year value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - year - the year to be set.

getYear

public int getYear()
get the year value for the Real Time Clock.
Returns:
int the year.

setMonth

public void setMonth(int Month)
Sets the month value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - month - the month to be set.

getMonth

public int getMonth()
get the month value for the Real Time Clock.
Returns:
int the month.

setDay

public void setDay(int Day)
Sets the day value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - day - the day to be set.

getDay

public int getDay()
get the day value for the Real Time Clock.
Returns:
int the day.

setDate

public void setDate(int Date)
Sets the date value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - date - the date to be set.

getDate

public int getDate()
get the date value for the Real Time Clock.
Returns:
int the date.

setHour

public void setHour(int Hour)
Sets the hour value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - hour - the hour to be set.

getHour

public int getHour()
get the hour value for the Real Time Clock.
Returns:
int the hour.

setMinute

public void setMinute(int Minute)
Sets the minute value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - minute - the minute to be set.

getMinute

public int getMinute()
get the minute value for the Real Time Clock.
Returns:
int the minute.

setSecond

public void setSecond(int Second)
Sets the second value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - second - the second to be set.

getSecond

public int getSecond()
get the second value for the Real Time Clock.
Returns:
int the second.

setHundredth

public void setHundredth(int Hundredth)
Sets the hundredth value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
int - hundredth - the hundredths of seconds to be set.

getHundredth

public int getHundredth()
get the hundredth value for the Real Time Clock.
Returns:
int the hundredth.

setPm

public void setPm(boolean PM)
Sets the AM/PM value of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
boolean - PM - set to true for PM, false for AM

getPm

public boolean getPm()
get the AM/PM value for the Real Time Clock.
Returns:
boolean returns ture for PM, false for AM

set12Hour

public void set12Hour(boolean is12Hour)
Sets the 12/24 hour mode of the Real Time Clock. This only sets the the instance variable for this object. A call to setRTC should be performed to actually set the real time clock.
Parameters:
boolean - is12Hour - true for 12 hour clock, false for 24 hour clock.

get12Hour

public boolean get12Hour()
get the 12/24 hour mode for the Real Time Clock.
Returns:
boolean returns true for 12 hour clock, false for 24 hour clock.

getRTC

public void getRTC()
Reads Real time clock values from hardware clock and places them into Clock static fields.

getTickCount

public int getTickCount()
Get the current time in milliseconds.
Returns:
Millisecond time.

setRTC

public void setRTC()
Reads real time clock values from static ints and writes them to the hardware clock.