GeoSoft API

no.geosoft.cc.util
Class Time

Object
  extended by Day
      extended by 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.
 
Method Summary
 void addHours(int nHours)
           
 void addMilliSeconds(int nMilliSeconds)
           
 void addMinutes(int nMinutes)
           
 void addSeconds(int nSeconds)
           
 boolean equals(Time time)
           
 int getHours()
           
 int getMilliSeconds()
           
 int getMinutes()
           
 int getSeconds()
           
 double hoursBetween(Time time)
           
 boolean isAfter(Time time)
           
 boolean isBefore(Time time)
           
static void main(String[] args)
           
 long milliSecondsBetween(Time time)
           
 double minutesBetween(Time time)
           
 double secondsBetween(Time time)
           
 void setDay(Day day)
           
 void setHours(int hours)
           
 void setMilliSeconds(int milliSeconds)
           
 void setMinutes(int minutes)
           
 void setSeconds(int seconds)
           
 String toString()
          Return a scratch string representation of this day.
 
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
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 time
month - Month of this time
dayOfMonth - 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()
Method Detail

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)

GeoSoft API

Copyright © 2004 - Geotechnical Software Services     geosoft.no