com.aragost.javahg
Class DateTime

java.lang.Object
  extended by com.aragost.javahg.DateTime

public class DateTime
extends Object

Represents a timestamp and a timezone offset


Constructor Summary
DateTime(Date date)
          Deprecated. Use constructor with tz argument
DateTime(Date date, TimeZone tz)
          Construct a new DateTime with the specified date and timezone
DateTime(long timestamp, int tzOffset)
          Construct a new DateTime with the specified timestamp and timezone
 
Method Summary
 boolean equals(Object obj)
           
 Date getDate()
           
 String getHgString()
           
 int hashCode()
           
static DateTime parse(String string)
          Create a new instance by parsing the given String.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateTime

public DateTime(long timestamp,
                int tzOffset)
Construct a new DateTime with the specified timestamp and timezone

Parameters:
timestamp -
tzOffset -

DateTime

public DateTime(Date date,
                TimeZone tz)
Construct a new DateTime with the specified date and timezone

Parameters:
date -
tz -

DateTime

@Deprecated
public DateTime(Date date)
Deprecated. Use constructor with tz argument

Parameters:
date -
Method Detail

parse

public static DateTime parse(String string)
Create a new instance by parsing the given String.

The string should be in standard Mercurial format, i.e. ' '

Parameters:
string -
Returns:

getDate

public Date getDate()
Returns:
the timestamp as a java.util.Date object

getHgString

public String getHgString()
Returns:
the time/zone formatted for Mercurial

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011-2013 aragost Trifork ag. All Rights Reserved.