Package com.jk.core.time
Class JKTimeObject
java.lang.Object
com.jk.core.time.JKTimeObject
This class is used for representing time and date information.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
after
(JKTimeObject thareTime) This method checks if this time is after anotherJKTimeObject
instance.boolean
before
(JKTimeObject thareTime) This method checks if this time is before anotherJKTimeObject
instance.int
getDay()
This method gets the day component of the date.int
getHour()
This method gets the hour component of the time.int
getMonth()
This method gets the month component of the date.int
This method gets the minutes component of the time.int
getYear()
This method gets the year component of the date.void
setDay
(int day) This method sets the day component of the date.void
setHour
(int hour) This method sets the hour component of the time.void
setMonth
(int month) This method sets the month component of the date.void
setMunite
(int munite) This method sets the minutes component of the time.void
setYear
(int year) This method sets the year component of the date.toTimeObject
(Date date, Date time) This method creates a newJKTimeObject
instance based on the provided date and time.
-
Constructor Details
-
JKTimeObject
public JKTimeObject()This method constructs a newJKTimeObject
.
-
-
Method Details
-
getHour
public int getHour()This method gets the hour component of the time.- Returns:
- the hour component.
-
setHour
public void setHour(int hour) This method sets the hour component of the time.- Parameters:
hour
- Specifies the new hour component.
-
getMunite
public int getMunite()This method gets the minutes component of the time.- Returns:
- the minute component.
-
setMunite
public void setMunite(int munite) This method sets the minutes component of the time.- Parameters:
munite
- Specifies the new minute component.
-
toTimeObject
This method creates a newJKTimeObject
instance based on the provided date and time.- Parameters:
date
- Specifies the date of this object.time
- Specifies the time of this object.- Returns:
- a new
JKTimeObject
instance.
-
after
This method checks if this time is after anotherJKTimeObject
instance.- Parameters:
thareTime
- Specifies the otherJKTimeObject
to compare.- Returns:
- true, if this time is after the other time, otherwise
false
.
-
before
This method checks if this time is before anotherJKTimeObject
instance.- Parameters:
thareTime
- Specifies the otherJKTimeObject
to compare.- Returns:
- true, if this time is before the other time, otherwise
false
.
-
getYear
public int getYear()This method gets the year component of the date.- Returns:
- the year component.
-
setYear
public void setYear(int year) This method sets the year component of the date.- Parameters:
year
- Specifies the new year component.
-
getMonth
public int getMonth()This method gets the month component of the date.- Returns:
- the month component.
-
setMonth
public void setMonth(int month) This method sets the month component of the date.- Parameters:
month
- Specifies the new month component.
-
getDay
public int getDay()This method gets the day component of the date.- Returns:
- the day component.
-
setDay
public void setDay(int day) This method sets the day component of the date.- Parameters:
day
- Specifies the new day component.
-