Class ImmutableDate
- java.lang.Object
-
- java.util.Date
-
- org.pepstock.charba.client.commons.ImmutableDate
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Date>
public final class ImmutableDate extends Date
Class acting as an immutable date class based on theDate
class.
ThrowsUnsupportedOperationException
when mutable methods are invoked.- Author:
- Andrea "Stock" Stocchero
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ImmutableDate()
Allocates aDate
object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.ImmutableDate(long date)
Allocates aDate
object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
setDate(int date)
Deprecated.As of JDK version 1.1.void
setHours(int hours)
Deprecated.As of JDK version 1.1.void
setMinutes(int minutes)
Deprecated.As of JDK version 1.1.void
setMonth(int month)
Deprecated.As of JDK version 1.1.void
setSeconds(int seconds)
Deprecated.As of JDK version 1.1.void
setTime(long time)
Deprecated.As of JDK version 1.1.void
setYear(int year)
Deprecated.As of JDK version 1.1.-
Methods inherited from class java.util.Date
after, before, clone, compareTo, equals, from, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, toGMTString, toInstant, toLocaleString, toString, UTC
-
-
-
-
Constructor Detail
-
ImmutableDate
public ImmutableDate()
Allocates aDate
object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.
-
ImmutableDate
public ImmutableDate(long date)
Allocates aDate
object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.- Parameters:
date
- the milliseconds since January 1, 1970, 00:00:00 GMT.
-
-
Method Detail
-
setDate
@Deprecated public void setDate(int date)
Deprecated.As of JDK version 1.1.As an ImmutableDate is immutable, this method throws anUnsupportedOperationException
.
-
setHours
@Deprecated public void setHours(int hours)
Deprecated.As of JDK version 1.1.As an ImmutableDate is immutable, this method throws anUnsupportedOperationException
.
-
setMinutes
@Deprecated public void setMinutes(int minutes)
Deprecated.As of JDK version 1.1.As an ImmutableDate is immutable, this method throws anUnsupportedOperationException
.- Overrides:
setMinutes
in classDate
- Parameters:
minutes
- the value of the minutes.
-
setMonth
@Deprecated public void setMonth(int month)
Deprecated.As of JDK version 1.1.As an ImmutableDate is immutable, this method throws anUnsupportedOperationException
.
-
setSeconds
@Deprecated public void setSeconds(int seconds)
Deprecated.As of JDK version 1.1.As an ImmutableDate is immutable, this method throws anUnsupportedOperationException
.- Overrides:
setSeconds
in classDate
- Parameters:
seconds
- the seconds value.
-
setTime
@Deprecated public void setTime(long time)
Deprecated.As of JDK version 1.1.As an ImmutableDate is immutable, this method throws anUnsupportedOperationException
.
-
setYear
@Deprecated public void setYear(int year)
Deprecated.As of JDK version 1.1.As an ImmutableDate is immutable, this method throws anUnsupportedOperationException
f.
-
-