Jive reference manual
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
jem::util::Calendar Class Reference

#include <jem/util/Calendar.h>

Inheritance diagram for jem::util::Calendar:
Inheritance graph

Public Types

enum  Fields {
  SECOND = 0,
  MINUTE,
  HOUR,
  DAY_OF_WEEK,
  DAY_OF_MONTH,
  DAY_OF_YEAR,
  MONTH,
  YEAR,
  FIELD_COUNT
}
 
enum  Months {
  JANUARY = 0,
  FEBRUARI,
  MARCH,
  APRIL,
  MAY,
  JUNE,
  JULY,
  AUGUST,
  SEPTEMBER,
  OCTOBER,
  NOVEMBER,
  DECEMBER
}
 
enum  WeekDays {
  SUNDAY = 0,
  MONDAY,
  TUESDAY,
  WEDNESDAY,
  THURSDAY,
  FRIDAY,
  SATURDAY
}
 

Public Member Functions

 Calendar ()
 
 Calendar (const Time &t)
 
 Calendar (const Calendar &rhs)
 
virtual void readFrom (io::ObjectInput &in)
 
virtual void writeTo (io::ObjectOutput &out) const
 
virtual String toString () const
 Returns a short textual description of this object. More...
 
virtual lint hashValue () const
 Returns a hash value for this object. More...
 
virtual bool equals (const Ref< Object > &rhs) const
 Tests whether two objects are equal. More...
 
virtual Ref< Objectclone () const
 
Time getTime () const
 
void setTime (const Time &t)
 
int getField (int field) const
 
void addToField (int field, int amount)
 
void setField (int field, int value)
 
void setDate (int year, int month, int mday)
 
void setDate (int year, int month, int mday, int hour, int min)
 
void setDate (int year, int month, int mday, int hour, int min, int sec)
 
int getActualMaximum (int field) const
 
int getActualMinimum (int field) const
 
void setLenient (bool flag)
 
bool isLenient () const
 
- Public Member Functions inherited from jem::Object
virtual ClassgetClass () const
 Returns the Class instance representing the runtime class of this object. More...
 
Ref< Objectclone () const
 Returns a copy of this object. More...
 

Static Public Member Functions

static int getMaximum (int field)
 
static int getMinimum (int field)
 
static int getSmallestMaximum (int field)
 
static int getGreatestMinimum (int field)
 
- Static Public Member Functions inherited from jem::Object
static ClassgetType ()
 Returns the Class instance representing the Object class. More...
 

Protected Member Functions

virtual ~Calendar ()
 
- Protected Member Functions inherited from jem::Collectable
 Collectable ()
 Creates an empty Collectable. More...
 
 ~Collectable ()
 Frees resources. More...
 
- Protected Member Functions inherited from jem::Clonable
virtual ~Clonable ()
 
virtual void emitVTable_ ()
 
- Protected Member Functions inherited from jem::Interface
virtual ~Interface ()
 Empty destructor. More...
 
- Protected Member Functions inherited from jem::io::Serializable
virtual ~Serializable ()
 
virtual void emitVtableFunc_ ()
 

Member Enumeration Documentation

Enumerator
SECOND 
MINUTE 
HOUR 
DAY_OF_WEEK 
DAY_OF_MONTH 
DAY_OF_YEAR 
MONTH 
YEAR 
FIELD_COUNT 
Enumerator
JANUARY 
FEBRUARI 
MARCH 
APRIL 
MAY 
JUNE 
JULY 
AUGUST 
SEPTEMBER 
OCTOBER 
NOVEMBER 
DECEMBER 
Enumerator
SUNDAY 
MONDAY 
TUESDAY 
WEDNESDAY 
THURSDAY 
FRIDAY 
SATURDAY 

Constructor & Destructor Documentation

jem::util::Calendar::Calendar ( )
jem::util::Calendar::Calendar ( const Time t)
explicit
jem::util::Calendar::Calendar ( const Calendar rhs)
virtual jem::util::Calendar::~Calendar ( )
protectedvirtual

Member Function Documentation

virtual void jem::util::Calendar::readFrom ( io::ObjectInput in)
virtual

Implements jem::io::Serializable.

virtual void jem::util::Calendar::writeTo ( io::ObjectOutput out) const
virtual

Implements jem::io::Serializable.

virtual String jem::util::Calendar::toString ( ) const
virtual

Returns a short textual description of this object. The toString method of the class Object returns:

getClass()->getName() + "@" + String( hashValue() )

Returns
A String representing this object.

Reimplemented from jem::Object.

virtual lint jem::util::Calendar::hashValue ( ) const
virtual

Returns a hash value for this object. This function should return the same hash value when it is invoked more than once on the same object, provided that the object is not modified. If two object are equal according to the equals method, then those objects should return the same hash value. Note that two objects which are not equal may also return the same hash value.

The hashValue implementation of the Object class returns a hash value for the memory address of the object.

Returns
A long integer representing the hash value of this object.

Reimplemented from jem::Object.

virtual bool jem::util::Calendar::equals ( const Ref< Object > &  obj) const
virtual

Tests whether this Object is equal to the Object obj. The equals method should be:

  • reflexive: for all objects x, x->equals(x) should return true.
  • symmetric: for all objects x and y, x->equals(y) should return the same value as y->equals(x).
  • transitive: if, for any objects x, y, and z, x->equals(y) returns true and y->equals(z) returns true, then x->equals(z) should return true.
  • consistent: for all objects x and y, multiple invocations of x->equals(y) should return the same value as long as the objects are not modified.

In addition, x->equals(NIL) should return false for all objects x.

The default implementation of equals returns true if and only if this object and the argument obj are located at the same memory address. That is, the default implementation returns (this == obj).

Parameters
obj- the object this object should be compared to, or NIL.
Returns
true is this object equals the object obj, and false otherwise.

Reimplemented from jem::Object.

virtual Ref<Object> jem::util::Calendar::clone ( ) const
virtual

Implements jem::Clonable.

Time jem::util::Calendar::getTime ( ) const
void jem::util::Calendar::setTime ( const Time t)
int jem::util::Calendar::getField ( int  field) const
void jem::util::Calendar::addToField ( int  field,
int  amount 
)
void jem::util::Calendar::setField ( int  field,
int  value 
)
void jem::util::Calendar::setDate ( int  year,
int  month,
int  mday 
)
void jem::util::Calendar::setDate ( int  year,
int  month,
int  mday,
int  hour,
int  min 
)
void jem::util::Calendar::setDate ( int  year,
int  month,
int  mday,
int  hour,
int  min,
int  sec 
)
static int jem::util::Calendar::getMaximum ( int  field)
static
static int jem::util::Calendar::getMinimum ( int  field)
static
static int jem::util::Calendar::getSmallestMaximum ( int  field)
static
static int jem::util::Calendar::getGreatestMinimum ( int  field)
static
int jem::util::Calendar::getActualMaximum ( int  field) const
int jem::util::Calendar::getActualMinimum ( int  field) const
void jem::util::Calendar::setLenient ( bool  flag)
bool jem::util::Calendar::isLenient ( ) const