public class DateWritable extends Object implements org.apache.hadoop.io.WritableComparable<DateWritable>
Constructor and Description |
---|
DateWritable() |
DateWritable(Date d) |
DateWritable(DateWritable d) |
DateWritable(int d) |
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.
|
void |
setFromBytes(byte[] bytes,
int offset,
int length,
LazyBinaryUtils.VInt vInt) |
static Date |
timeToDate(long l) |
String |
toString() |
void |
write(DataOutput out) |
void |
writeToByteStream(ByteStream.RandomAccessOutput byteStream) |
public DateWritable()
public DateWritable(DateWritable d)
public DateWritable(Date d)
public DateWritable(int d)
public void set(int d)
d
- integer value representing days since epoch datepublic void set(Date d)
d
- Date valuepublic void set(DateWritable d)
public Date get()
public Date get(boolean doesTimeMatter)
public int getDays()
public long getTimeInSeconds()
public static Date timeToDate(long l)
public static long daysToMillis(int d)
public static long daysToMillis(int d, boolean doesTimeMatter)
public static int millisToDays(long millisLocal)
public static int dateToDays(Date d)
public void setFromBytes(byte[] bytes, int offset, int length, LazyBinaryUtils.VInt vInt)
public void writeToByteStream(ByteStream.RandomAccessOutput byteStream)
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(DateWritable d)
compareTo
in interface Comparable<DateWritable>
Copyright © 2017 The Apache Software Foundation. All rights reserved.