com.reticular.agentBuilder.agent.profile
Class Time

java.lang.Object
  |
  +--com.reticular.agentBuilder.agent.profile.Time
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Time
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Description : The time class specifies a date and time. This class will later have support for specifying periodocity so that this class can be used to schedule events.

See Also:
Serialized Form

Field Summary
static int SHUTDOWN
          The constants for specifying the type and getting the name.
static java.lang.String SHUTDOWN_KEYWORD
           
static int STARTUP
           
static java.lang.String STARTUP_KEYWORD
           
static int USER_DEFINED
           
static java.lang.String USER_DEFINED_KEYWORD
           
 
Constructor Summary
Time()
          Description : Constructs a time object and initialies the date and time.
Time(int newType)
          Description : Constructs a time object and initialies the date and time.
Time(int year, int month, int day, int hour, int minutes, int seconds)
          Description : Constructs a Time object with the specified date and time.
 
Method Summary
 java.lang.Object clone()
          Description : Calls the super.clone() from lang.obj and catches the exceptions.
 boolean equals(java.lang.Object object)
          Description : Determines if the given object is equal to the calling object.
 java.lang.String formatTime(int number)
          Description : Formats the given number into time format.
 int getDay()
          Description : Returns the day.
 int getHour()
          Description : Returns the hour.
 int getMinutes()
          Description : Returns the minutes.
 int getMonth()
          Description : Returns the month.
 int getNumber()
          Description : Not implemented.
 int getSeconds()
          Description : Returns the seconds.
 java.lang.String getString()
          Description : Returns a human readable represntation of the time.
 int getType()
          Description : Returns the constant that specifies the type of time being contained (options are user defined, startup and shutdown).
 int getYear()
          Description : Returns the year.
 void setDay(int day)
          Description : Sets the day.
 void setHour(int hour)
          Description : Sets the hour.
 void setMinutes(int minutes)
          Description : Sets the minutes.
 void setMonth(int month)
          Description : Sets the month.
 void setSeconds(int seconds)
          Description : Sets the seconds.
 void setType(int newType)
          Description : Determines the type of time data being stored.
 void setYear(int year)
          Description : Sets the year.
 java.lang.String toBNFString()
          
Description : This prints the contents to a RADL BNF grammar based string.
 java.lang.String toString()
          Description : Defines the string representation of the Time object.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SHUTDOWN

public static final int SHUTDOWN
The constants for specifying the type and getting the name.

SHUTDOWN_KEYWORD

public static final java.lang.String SHUTDOWN_KEYWORD

STARTUP

public static final int STARTUP

STARTUP_KEYWORD

public static final java.lang.String STARTUP_KEYWORD

USER_DEFINED

public static final int USER_DEFINED

USER_DEFINED_KEYWORD

public static final java.lang.String USER_DEFINED_KEYWORD
Constructor Detail

Time

public Time()
Description : Constructs a time object and initialies the date and time.

Time

public Time(int newType)
Description : Constructs a time object and initialies the date and time.
Parameters:
Int - The type of time object.

Time

public Time(int year,
            int month,
            int day,
            int hour,
            int minutes,
            int seconds)
Description : Constructs a Time object with the specified date and time.
Parameters:
String - The month.
String - The day.
int - The year.
int - The hour.
int - The minutes.
int - The seconds.
Method Detail

toBNFString

public java.lang.String toBNFString()

Description : This prints the contents to a RADL BNF grammar based string. (RADL = Reticular Agent Definition Language). It may include any amount of white space.
Returns:
String The BNF formated string representation.

getString

public java.lang.String getString()
Description : Returns a human readable represntation of the time.
Parameters:
-  
Returns:
String

getNumber

public int getNumber()
Description : Not implemented.
Parameters:
-  
Returns:
int

setType

public void setType(int newType)
Description : Determines the type of time data being stored. The parameter should be a constant (defined in this class)
Parameters:
int - The code for the type.
Returns:
void

getType

public int getType()
Description : Returns the constant that specifies the type of time being contained (options are user defined, startup and shutdown).
Returns:
int The code.

setMonth

public void setMonth(int month)
Description : Sets the month.
Parameters:
String - The new month.
Returns:
void

getMonth

public int getMonth()
Description : Returns the month.
Returns:
String

setDay

public void setDay(int day)
Description : Sets the day.
Parameters:
String - The new day.
Returns:
void

getDay

public int getDay()
Description : Returns the day.
Returns:
String

setYear

public void setYear(int year)
Description : Sets the year.
Parameters:
int - The new year.
Returns:
void

getYear

public int getYear()
Description : Returns the year.
Returns:
int

setHour

public void setHour(int hour)
Description : Sets the hour.
Parameters:
int - The new hour.
Returns:
void

getHour

public int getHour()
Description : Returns the hour.
Returns:
int

setMinutes

public void setMinutes(int minutes)
Description : Sets the minutes.
Parameters:
int - minutes
Returns:
void

getMinutes

public int getMinutes()
Description : Returns the minutes.
Returns:
int

setSeconds

public void setSeconds(int seconds)
Description : Sets the seconds.
Parameters:
int - seconds
Returns:
void

getSeconds

public int getSeconds()
Description : Returns the seconds.
Returns:
int

toString

public java.lang.String toString()
Description : Defines the string representation of the Time object.
Overrides:
toString in class java.lang.Object
Returns:
void

formatTime

public java.lang.String formatTime(int number)
Description : Formats the given number into time format.
Parameters:
int - The number to format.
Returns:
String

equals

public boolean equals(java.lang.Object object)
Description : Determines if the given object is equal to the calling object.
Overrides:
equals in class java.lang.Object
Parameters:
Object - The object being compared to the calling object.
Returns:
boolean

clone

public java.lang.Object clone()
Description : Calls the super.clone() from lang.obj and catches the exceptions.
Overrides:
clone in class java.lang.Object
Returns:
KqmlMessage