Class ccj.Time
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ccj.Time

java.lang.Object
   |
   +----ccj.Time

public class Time
extends Object
implements Cloneable

Constructor Index

 o Time()
Constructs a time object representing the current time
 o Time(int, int, int, int, int, int)
Constructs a time object

Method Index

 o addSeconds(double)
Adds a number of seconds to this time object
 o clone()
Creates a copy of this object
 o equals(Object)
Tests if this object equals another
 o getDay()
Gets the day of this time object
 o getHours()
Gets the hours of this time object
 o getMinutes()
Gets the minutes of this time object
 o getMonth()
Gets the month of this time object
 o getSeconds()
Gets the seconds of this time object
 o getYear()
Gets the year of this time object
 o secondsFrom(Time)
Computes the number of seconds between two times
 o toString()
Creates a string representation of this object

Constructors

 o Time
  public Time()
Constructs a time object representing the current time
 o Time
  public Time(int y,
              int m,
              int d,
              int hr,
              int min,
              int sec)
Constructs a time object
Parameters:
y - the year (must be >= 1970)
m - the month
d - the day
hr - the hours
min - the minutes
sec - the seconds

Methods

 o getYear
  public int getYear()
Gets the year of this time object
Returns:
the year of this time object
 o getMonth
  public int getMonth()
Gets the month of this time object
Returns:
the month of this time object
 o getDay
  public int getDay()
Gets the day of this time object
Returns:
the day of this time object
 o getHours
  public int getHours()
Gets the hours of this time object
Returns:
the hours of this time object
 o getMinutes
  public int getMinutes()
Gets the minutes of this time object
Returns:
the minutes of this time object
 o getSeconds
  public int getSeconds()
Gets the seconds of this time object
Returns:
the seconds of this time object
 o addSeconds
  public void addSeconds(double s)
Adds a number of seconds to this time object
Parameters:
s - the seconds to add (if < 0, the result is an earlier time)
 o secondsFrom
  public float secondsFrom(Time t2)
Computes the number of seconds between two times
Parameters:
t2 - the other time
Returns:
the number of seconds between t and t2. If < 0, then t is after t2.
 o equals
  public boolean equals(Object o2)
Tests if this object equals another
Parameters:
b - the object to compare with
Returns:
true if the two objects are equal
Overrides:
equals in class Object
 o toString
  public String toString()
Creates a string representation of this object
Returns:
a string representation of this object
Overrides:
toString in class Object
 o clone
  public Object clone()
Creates a copy of this object
Returns:
a copy of this object
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index