DateWritable (Hive Storage API 2.1.1-pre-orc API)
Date: 2016-10-19

org.apache.hadoop.hive.serde2.io

## Class DateWritable

- java.lang.Object
- - org.apache.hadoop.hive.serde2.io.DateWritable

- All Implemented Interfaces:
    Comparable<DateWritable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<DateWritable>

      public class DateWritable
      extends Object
      implements org.apache.hadoop.io.WritableComparable<DateWritable>

  DateWritable Writable equivalent of java.sql.Date. Dates are of the format YYYY-MM-DD

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DateWritable()`
    `DateWritable(Date d)`
    `DateWritable(DateWritable d)`
    `DateWritable(int d)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(DateWritable d)`
    `static int` | `dateToDays(Date d)`
    `static long` | `daysToMillis(int d)`
    `static long` | `daysToMillis(int d, boolean doesTimeMatter)`
    `boolean` | `equals(Object o)`
    `Date` | `get()`
    `Date` | `get(boolean doesTimeMatter)`
    `int` | `getDays()`
    `long` | `getTimeInSeconds()`
    `int` | `hashCode()`
    `static int` | `millisToDays(long millisLocal)`
    `void` | `readFields(DataInput in)`
    `void` | `set(Date d)` Set the DateWritable based on the year/month/day of the date in the local timezone.
    `void` | `set(DateWritable d)`
    `void` | `set(int d)` Set the DateWritable based on the days since epoch date.
    `static Date` | `timeToDate(long l)`
    `String` | `toString()`
    `void` | `write(DataOutput out)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DateWritable

          public DateWritable()

    - #### DateWritable

          public DateWritable(DateWritable d)

    - #### DateWritable

          public DateWritable(Date d)

    - #### DateWritable

          public DateWritable(int d)

  - ### Method Detail

    - #### set

          public void set(int d)

      Set the DateWritable based on the days since epoch date.
      Parameters:
        `d` - integer value representing days since epoch date

    - #### set

          public void set(Date d)

      Set the DateWritable based on the year/month/day of the date in the local timezone.
      Parameters:
        `d` - Date value

    - #### set

          public void set(DateWritable d)

    - #### get

          public Date get()

      Returns:
        Date value corresponding to the date in the local time zone

    - #### get

          public Date get(boolean doesTimeMatter)

    - #### getDays

          public int getDays()

    - #### getTimeInSeconds

          public long getTimeInSeconds()

      Returns:
        time in seconds corresponding to this DateWritable

    - #### timeToDate

          public static Date timeToDate(long l)

    - #### daysToMillis

          public static long daysToMillis(int d)

    - #### daysToMillis

          public static long daysToMillis(int d,
                                          boolean doesTimeMatter)

    - #### millisToDays

          public static int millisToDays(long millisLocal)

    - #### dateToDays

          public static int dateToDays(Date d)

    - #### readFields

          public void readFields(DataInput in)
                          throws IOException

      Specified by:
        `readFields` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `IOException`

    - #### write

          public void write(DataOutput out)
                     throws IOException

      Specified by:
        `write` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `IOException`

    - #### compareTo

          public int compareTo(DateWritable d)

      Specified by:
        `compareTo` in interface `Comparable<DateWritable>`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2016 The Apache Software Foundation. All rights reserved.