Class JKTimeObject

java.lang.Object
com.jk.core.time.JKTimeObject

public class JKTimeObject extends Object
This class is used for representing time and date information.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Summary

    Constructors
    Constructor
    Description
    This method constructs a new JKTimeObject.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    after(JKTimeObject thareTime)
    This method checks if this time is after another JKTimeObject instance.
    boolean
    before(JKTimeObject thareTime)
    This method checks if this time is before another JKTimeObject instance.
    int
    This method gets the day component of the date.
    int
    This method gets the hour component of the time.
    int
    This method gets the month component of the date.
    int
    This method gets the minutes component of the time.
    int
    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 new JKTimeObject instance based on the provided date and time.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JKTimeObject

      public JKTimeObject()
      This method constructs a new JKTimeObject.
  • 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

      public JKTimeObject toTimeObject(Date date, Date time)
      This method creates a new JKTimeObject 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

      public boolean after(JKTimeObject thareTime)
      This method checks if this time is after another JKTimeObject instance.
      Parameters:
      thareTime - Specifies the other JKTimeObject to compare.
      Returns:
      true, if this time is after the other time, otherwise false.
    • before

      public boolean before(JKTimeObject thareTime)
      This method checks if this time is before another JKTimeObject instance.
      Parameters:
      thareTime - Specifies the other JKTimeObject 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.