net.sourceforge.jsdp.util
Class ZoneAdjustment

java.lang.Object
  extended by net.sourceforge.jsdp.util.ZoneAdjustment
All Implemented Interfaces:
Serializable, Cloneable

public class ZoneAdjustment
extends Object
implements Cloneable, Serializable

Represents an adjustment time and his offset from the base time, for a repeated session scheduling.

Since:
0.1.0
Version:
1.0
Author:
Claudio Di Vita
See Also:
TimeZone, Serialized Form

Field Summary
protected  long offset
          The adjustment offset
protected  long time
          The NTP representation of adjustment time
 
Constructor Summary
protected ZoneAdjustment()
          Creates a new ZoneAdjustment
  ZoneAdjustment(Date time, long offset)
          Creates a new ZoneAdjustment.
  ZoneAdjustment(long time, long offset)
          Creates a new ZoneAdjustment.
 
Method Summary
 Object clone()
          Returns a clone of this zone adjustment.
 long getOffset()
          Returns the adjustment offset.
 long getTime()
          Returns the adjustment time.
 void setOffset(long offset)
          Sets the adjustment offset.
 void setTime(long time)
          Sets the adjustment time.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

offset

protected long offset
The adjustment offset


time

protected long time
The NTP representation of adjustment time

Constructor Detail

ZoneAdjustment

protected ZoneAdjustment()
Creates a new ZoneAdjustment


ZoneAdjustment

public ZoneAdjustment(Date time,
                      long offset)
               throws SDPException
Creates a new ZoneAdjustment.

Parameters:
time - the adjustment time
offset - the adjustment offset
Throws:
SDPException - if the NTP representation of the adjustment time is negative

ZoneAdjustment

public ZoneAdjustment(long time,
                      long offset)
               throws SDPException
Creates a new ZoneAdjustment.

Parameters:
time - the adjustment time
offset - the adjustment offset
Throws:
SDPException - if the adjustment time is negative
Method Detail

clone

public Object clone()
Returns a clone of this zone adjustment.

Overrides:
clone in class Object
Returns:
a clone of this zone adjustment

getOffset

public long getOffset()
Returns the adjustment offset.

Returns:
the adjustment offset

getTime

public long getTime()
Returns the adjustment time.

Returns:
the adjustment time

setOffset

public void setOffset(long offset)
Sets the adjustment offset.

Parameters:
offset - the adjustment offset

setTime

public void setTime(long time)
             throws SDPException
Sets the adjustment time.

Parameters:
time - the adjustment time
Throws:
SDPException - if the adjustment time is negative

toString

public String toString()
Returns a string representation of the object. The representation has the form: <time> <offset>

Overrides:
toString in class Object
Returns:
the string representation of the object


Copyright © 2004-2008. All Rights Reserved.