org.restlet.engine.util
Class ImmutableDate

java.lang.Object
  extended by java.util.Date
      extended by org.restlet.engine.util.ImmutableDate
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public final class ImmutableDate
extends Date

Class acting as an immutable date class based on the Date class. Throws UnsupportedOperationException when mutable methods are invoked.

Author:
Piyush Purang (ppurang@gmail.com)
See Also:
Date, Immutable Date, Serialized Form

Constructor Summary
ImmutableDate(Date date)
          Private constructor.
 
Method Summary
 Object clone()
          
 void setDate(int arg0)
          As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
 void setHours(int arg0)
          As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
 void setMinutes(int arg0)
          As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
 void setMonth(int arg0)
          As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
 void setSeconds(int arg0)
          As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
 void setTime(long arg0)
          As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
 void setYear(int arg0)
          As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.
 
Methods inherited from class java.util.Date
after, before, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, toGMTString, toLocaleString, toString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImmutableDate

public ImmutableDate(Date date)
Private constructor. A factory method is provided.

Parameters:
date - date to be made immutable
Method Detail

clone

public Object clone()

Overrides:
clone in class Date

setDate

public void setDate(int arg0)
As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.

Overrides:
setDate in class Date

setHours

public void setHours(int arg0)
As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.

Overrides:
setHours in class Date

setMinutes

public void setMinutes(int arg0)
As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.

Overrides:
setMinutes in class Date

setMonth

public void setMonth(int arg0)
As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.

Overrides:
setMonth in class Date

setSeconds

public void setSeconds(int arg0)
As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.

Overrides:
setSeconds in class Date

setTime

public void setTime(long arg0)
As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.

Overrides:
setTime in class Date

setYear

public void setYear(int arg0)
As an ImmutableDate is immutable, this method throws an UnsupportedOperationException exception.

Overrides:
setYear in class Date


Copyright © 2005-2013 Restlet.