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
-
Time()
- Constructs a time object representing the current time
-
Time(int, int, int, int, int, int)
- Constructs a time object
-
addSeconds(double)
- Adds a number of seconds to this time object
-
clone()
- Creates a copy of this object
-
equals(Object)
- Tests if this object equals another
-
getDay()
- Gets the day of this time object
-
getHours()
- Gets the hours of this time object
-
getMinutes()
- Gets the minutes of this time object
-
getMonth()
- Gets the month of this time object
-
getSeconds()
- Gets the seconds of this time object
-
getYear()
- Gets the year of this time object
-
secondsFrom(Time)
- Computes the number of seconds between two times
-
toString()
- Creates a string representation of this object
Time
public Time()
- Constructs a time object representing the current time
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
getYear
public int getYear()
- Gets the year of this time object
- Returns:
- the year of this time object
getMonth
public int getMonth()
- Gets the month of this time object
- Returns:
- the month of this time object
getDay
public int getDay()
- Gets the day of this time object
- Returns:
- the day of this time object
getHours
public int getHours()
- Gets the hours of this time object
- Returns:
- the hours of this time object
getMinutes
public int getMinutes()
- Gets the minutes of this time object
- Returns:
- the minutes of this time object
getSeconds
public int getSeconds()
- Gets the seconds of this time object
- Returns:
- the seconds of this time object
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)
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.
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
toString
public String toString()
- Creates a string representation of this object
- Returns:
- a string representation of this object
- Overrides:
- toString in class Object
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