no.geosoft.cc.util
Class Time
Object
Day
Time
- All Implemented Interfaces:
- Comparable<Day>
public class Time
- extends Day
A class representing a moment in time. Extends Day which represents
the day of the moment, and defines the time within the day to
millisecond accuracy.
- Author:
- GeoSoft (info@geosoft.no)
Constructor Summary |
Time()
|
Time(Day day,
int hours,
int minutes,
int seconds)
|
Time(int hours,
int minutes,
int seconds)
|
Time(int year,
int month,
int dayOfMonth,
int hours,
int minutes,
int seconds)
Instantiate a Time object. |
Methods inherited from class Day |
addDays, addMonths, addYears, compareTo, daysBetween, equals, getCalendar, getDate, getDayName, getDayNumberOfWeek, getDayOfMonth, getDayOfWeek, getDayOfYear, getDaysInMonth, getDaysInYear, getFirstOfMonth, getLastOfMonth, getMonth, getMonthNo, getNthOfMonth, getWeekOfYear, getYear, hashCode, isAfter, isBefore, isLeapYear, isLeapYear, subtractDays, subtractMonths, subtractYears, today |
Time
public Time(int year,
int month,
int dayOfMonth,
int hours,
int minutes,
int seconds)
- Instantiate a Time object.
The time is lenient meaning that illegal day parameters can be
specified and results in a recomputed day with legal month/day
values.
- Parameters:
year
- Year of this timemonth
- Month of this timedayOfMonth
- Day of month of this time.hours
- Hours of this time [0-23]minutes
- Minutes of this time [0-23]seconds
- Seconds of this time [0-23]
Time
public Time(Day day,
int hours,
int minutes,
int seconds)
Time
public Time(int hours,
int minutes,
int seconds)
Time
public Time()
setDay
public void setDay(Day day)
setHours
public void setHours(int hours)
getHours
public int getHours()
setMinutes
public void setMinutes(int minutes)
getMinutes
public int getMinutes()
setSeconds
public void setSeconds(int seconds)
getSeconds
public int getSeconds()
setMilliSeconds
public void setMilliSeconds(int milliSeconds)
getMilliSeconds
public int getMilliSeconds()
isAfter
public boolean isAfter(Time time)
isBefore
public boolean isBefore(Time time)
equals
public boolean equals(Time time)
addHours
public void addHours(int nHours)
addMinutes
public void addMinutes(int nMinutes)
addSeconds
public void addSeconds(int nSeconds)
addMilliSeconds
public void addMilliSeconds(int nMilliSeconds)
milliSecondsBetween
public long milliSecondsBetween(Time time)
secondsBetween
public double secondsBetween(Time time)
minutesBetween
public double minutesBetween(Time time)
hoursBetween
public double hoursBetween(Time time)
toString
public String toString()
- Description copied from class:
Day
- Return a scratch string representation of this day.
Used for debugging only. The format of the
day is dd/mm-yyyy
- Overrides:
toString
in class Day
- Returns:
- A string representation of this day.
main
public static void main(String[] args)
Copyright © 2004 - Geotechnical Software Services geosoft.no