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 theDateclass.
ThrowsUnsupportedOperationExceptionwhen mutable methods are invoked.- Author:
- Andrea "Stock" Stocchero
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ImmutableDate()Allocates aDateobject and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.ImmutableDate(long date)Allocates aDateobject 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 voidsetDate(int date)Deprecated.As of JDK version 1.1.voidsetHours(int hours)Deprecated.As of JDK version 1.1.voidsetMinutes(int minutes)Deprecated.As of JDK version 1.1.voidsetMonth(int month)Deprecated.As of JDK version 1.1.voidsetSeconds(int seconds)Deprecated.As of JDK version 1.1.voidsetTime(long time)Deprecated.As of JDK version 1.1.voidsetYear(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 aDateobject 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 aDateobject 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:
setMinutesin 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:
setSecondsin 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 anUnsupportedOperationExceptionf.
-
-