TV-Browser 2.7.5 API

devplugin
Class Date

java.lang.Object
  extended by devplugin.Date
All Implemented Interfaces:
Comparable<Date>

public class Date
extends Object
implements Comparable<Date>


Constructor Summary
Date()
          Constructs a new Date object, initialized with the current date.
Date(Calendar cal)
           
Date(DataInput in)
          Creates a new instance from a RandomAccessFile.
Date(Date d)
           
Date(int daysSince1970)
          Deprecated.  
Date(int year, int month, int dayOfMonth)
           
Date(ObjectInputStream in)
          Creates a new instance from a stream.
 
Method Summary
 Date addDays(int days)
           
 int compareTo(Date otherDate)
           
static Date createDateFromValue(long value)
           
static Date createDDMMYYYY(String date, String separator)
           
static Date createYYMMDD(String date, String separator)
           
static Date createYYYYMMDD(String date, String separator)
           
 boolean equals(Object obj)
           
 Calendar getCalendar()
           
static Date getCurrentDate()
           
 String getDateString()
          return the textual representation of this date with abbreviated day of week and abbreviated month name
 int getDayOfMonth()
           
 int getDayOfWeek()
          get the day of the week for this date
 int getDaysSince1970()
          Deprecated.  
 String getLongDateString()
          return the textual representation of this date with full day of week and full month name (neither abbreviated)
 int getMonth()
           
 int getNumberOfDaysSince(Date d)
           
 String getShortDayLongMonthString()
          returns the textual representation of this date with abbreviated day of week, but full month
 long getValue()
           
 int getWeekOfYear()
          Returns the week number within the current year.
 int getYear()
           
 int hashCode()
          A hash code implementation that returns the same code for equal Dates.
 boolean isFirstDayOfWeek()
          is this a Monday?
 String toString()
           
 void writeData(ObjectOutputStream out)
          Writes this instance to a stream.
 void writeToDataFile(RandomAccessFile out)
          Writes this instance to a RandomAccessFile.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Date

public Date()
Constructs a new Date object, initialized with the current date.


Date

public Date(int year,
            int month,
            int dayOfMonth)

Date

public Date(int daysSince1970)
Deprecated. 

Attention: DO NOT USE THIS! Under Os/2 it has some problems with calculating the real Date!


Date

public Date(Calendar cal)

Date

public Date(Date d)

Date

public Date(DataInput in)
     throws IOException,
            ClassNotFoundException
Creates a new instance from a RandomAccessFile.

Throws:
IOException
ClassNotFoundException
Since:
2.2

Date

public Date(ObjectInputStream in)
     throws IOException,
            ClassNotFoundException
Creates a new instance from a stream.

Throws:
IOException
ClassNotFoundException
Method Detail

createYYYYMMDD

public static Date createYYYYMMDD(String date,
                                  String separator)

createDDMMYYYY

public static Date createDDMMYYYY(String date,
                                  String separator)

createYYMMDD

public static Date createYYMMDD(String date,
                                String separator)

getNumberOfDaysSince

public int getNumberOfDaysSince(Date d)
Parameters:
d - The date to check for days since.
Returns:
The days since the given date.
Since:
0.9.7.4 This method may not return the exactly number of days since the calculation is confounded by daylight savings time switchovers... Around midnight the result may not be correct.

getYear

public int getYear()

getMonth

public int getMonth()

getDayOfMonth

public int getDayOfMonth()

getWeekOfYear

public int getWeekOfYear()
Returns the week number within the current year.

Returns:
The week number.
Since:
2.5.1

getCurrentDate

public static Date getCurrentDate()

writeToDataFile

public void writeToDataFile(RandomAccessFile out)
                     throws IOException
Writes this instance to a RandomAccessFile.

Parameters:
out -
Throws:
IOException
Since:
2.2

writeData

public void writeData(ObjectOutputStream out)
               throws IOException
Writes this instance to a stream.

Throws:
IOException

hashCode

public int hashCode()
A hash code implementation that returns the same code for equal Dates.

Overrides:
hashCode in class Object

getDateString

public String getDateString()
return the textual representation of this date with abbreviated day of week and abbreviated month name

Returns:
date string

getLongDateString

public String getLongDateString()
return the textual representation of this date with full day of week and full month name (neither abbreviated)

Returns:
date string

getShortDayLongMonthString

public String getShortDayLongMonthString()
returns the textual representation of this date with abbreviated day of week, but full month

Returns:
date as string

getValue

public long getValue()

createDateFromValue

public static Date createDateFromValue(long value)

equals

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

getCalendar

public Calendar getCalendar()

toString

public String toString()
Overrides:
toString in class Object

getDaysSince1970

public int getDaysSince1970()
Deprecated. 


addDays

public Date addDays(int days)

compareTo

public int compareTo(Date otherDate)
Specified by:
compareTo in interface Comparable<Date>

getDayOfWeek

public int getDayOfWeek()
get the day of the week for this date

Returns:
day of week, as Calendar.MONDAY and so on
Since:
2.6

isFirstDayOfWeek

public boolean isFirstDayOfWeek()
is this a Monday?

Returns:
true, if this is the first day of the week
Since:
2.6

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)