Methods Summary |
---|
public com.samscdrental.model.adt.Timestamp | addDays(int days)add
long thisMilliseconds = this.theDate.getTime();
long thatMilliseconds = thisMilliseconds +
days * NUMBER_MILLISECONDS_IN_DAY;
Timestamp aTimestamp = new Timestamp();
aTimestamp.theDate = new Date( thatMilliseconds );
return aTimestamp;
|
public int | differenceInDays(com.samscdrental.model.adt.Timestamp aTimestamp)subtract
long thisMilliseconds = this.theDate.getTime();
long thatMilliseconds = aTimestamp.theDate.getTime();
long millisecondsDifference = thisMilliseconds - thatMilliseconds;
int days = ( int ) ( millisecondsDifference /
NUMBER_MILLISECONDS_IN_DAY );
return days;
|
public boolean | equals(com.samscdrental.model.adt.Timestamp aTimestamp)Indicates whether some other object is "equal to" this one.
return theDate.equals( aTimestamp.theDate );
|
public boolean | equals(java.lang.Object obj)Indicates whether some other object is "equal to" this one.
return equals( ( Timestamp ) obj );
|
public java.lang.String | toString()Returns a string representation of the object.
return theDate.toString();
|