|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bloomberglp.blpapi.Datetime
public final class Datetime
Represents a date and/or time
Datetime can represent a date and/or a time or any combination of the components of a date and time. The value is represented as eight parts which can be set or queried independently. These parts are: year; month; day (of month); hour; minute; second; milliseconds and offset (of timezone from GMT in minutes). Methods are provided to set and query the parts individually and in groups. For example, setDate() and setTime(). It is also possible to determine which parts of the Datetime have been set.
Field Summary | |
---|---|
static short |
DATE
|
static byte |
DAY_OF_MONTH
|
static byte |
HOUR
|
static short |
MICROSECOND
|
static byte |
MILLISECOND
|
static byte |
MINUTE
|
static byte |
MONTH
|
static short |
NANOSECOND
|
static short |
PICOSECOND
|
static byte |
SECOND
|
static short |
TIME
|
static byte |
TIME_ZONE_OFFSET
|
static short |
TIMEMILLI
|
static short |
YEAR
|
Constructor Summary | |
---|---|
Datetime()
Construct a Datetime object with each part initialized to an unset state |
|
Datetime(java.util.Calendar calendar)
Create Datetime object having the Date, Time and Timezone offset portions set to the specified values. |
|
Datetime(Datetime other)
construct a Datetime object having the same values as specified 'other' Datetime object |
|
Datetime(int year,
int month,
int dayOfMonth)
Create Datetime object having the Date portion set to the specified values. |
|
Datetime(int hour,
int minute,
int second,
int millisecond)
Create Datetime object having the Time portion set to the specified values. |
|
Datetime(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int millisecond)
Create Datetime object having the Date and Time portions set to the specified values. |
Method Summary | |
---|---|
java.util.Calendar |
calendar()
Return the Date, Time and Timezone offset represented by this Datetime object as a Java Calendar. |
void |
clear()
Set all parts of this Datetime object to the unset state |
java.lang.Object |
clone()
|
int |
dayOfMonth()
Return the day of month value of this Datetime object. |
boolean |
equals(java.lang.Object obj)
|
int |
hashCode()
|
boolean |
hasParts(int parts)
Return true if this Datetime object has all of the specified parts set. |
int |
hour()
Return the hour value of this Datetime object. |
boolean |
isValid()
Check whether the value of this 'Datetime' object is valid. |
boolean |
isValidField(int fieldId)
Deprecated. use hasParts(int) |
int |
microsecond()
Return the number of (whole) microseconds in the fraction-of-a-second part of the value of this object. |
int |
millisecond()
Return the millisecond value within the second of this Datetime object. |
int |
milliSecond()
Return the millisecond value within the second of this Datetime object. |
int |
minute()
Return the minute value of this Datetime object. |
int |
month()
Return the month value of this Datetime object. |
int |
nanosecond()
Return the number of (whole) nanoseconds in the fraction-of-a-second part of the value of this object. |
int |
parts()
Return a bitmask of all parts that are set in this Datetime object. |
long |
picosecond()
Return the number of (whole) picoseconds in the fraction-of-a-second part of the value of this object. |
int |
second()
Return the second value of this Datetime object. |
void |
setDate(int year,
int month,
int dayOfMonth)
Set the date portion of this Datetime object to the specified values |
void |
setDatetime(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int millisecond)
Set the date, time and portions of this Datetime object to the specified values |
void |
setDatetimeTz(java.util.Calendar calendar)
Set the Date, Time and TimezoneOffset portions of this Datetime object using values from the specified calendar. |
void |
setDatetimeTz(int year,
int month,
int dayOfMonth,
int hour,
int minute,
int second,
int millisecond,
int timezoneOffsetMinutes)
Set the date, time and timezone offset portions of this Datetime object to the specified values |
void |
setDateTz(int year,
int month,
int dayOfMonth,
int timezoneOffsetMinutes)
Set the date and timezone offset portions of this Datetime object to the specified values |
void |
setDayOfMonth(int dayOfMonth)
set the day of month value of this Datetime object to the specified dayOfMonth |
void |
setHour(int hour)
set the hour value of this Datetime object to the specified hour |
void |
setMicrosecond(int microsecond)
set the fraction of a second of this Datetime object to the specified microsecond. |
void |
setMillisecond(int millisecond)
set the millisecond value within the second of this Datetime object to the specified milliSecond. |
void |
setMilliSecond(int millisecond)
set the millisecond value within the second of this Datetime object to the specified millisecond. |
void |
setMinute(int minute)
set the minute value of this Datetime object to the specified minute |
void |
setMonth(int month)
set the month value of this Datetime object to the specified month |
void |
setNanosecond(int nanosecond)
set the fraction of a second of this Datetime object to the specified nanosecond. |
void |
setPicosecond(long picosecond)
set the fraction of a second of this Datetime object to the specified picosecond. |
void |
setSecond(int second)
set the second of this Datetime object to the specified second |
void |
setTime(int hour,
int minute,
int second,
int millisecond)
Set the time portions of this Datetime object to the specified values |
void |
setTimeTz(int hour,
int minute,
int second,
int millisecond,
int timezoneOffsetMinutes)
Set the time and timezone offset portions of this Datetime object to the specified values |
void |
setTimezoneOffsetMinutes(int timezoneOffsetMinutes)
set the timezone offset value of this Datetime object to the specified timezoneOffsetMinutes |
void |
setYear(int year)
set the year value of this Datetime object to the specified year |
int |
timezoneOffsetMinutes()
Return the timezone offset value of this Datetime object. |
java.lang.String |
toString()
Convert the Date and Time represented by this Datetime object to String. |
int |
year()
Return the year value of this Datetime object. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short YEAR
public static final byte MONTH
public static final byte DAY_OF_MONTH
public static final byte HOUR
public static final byte MINUTE
public static final byte SECOND
public static final byte MILLISECOND
public static final byte TIME_ZONE_OFFSET
public static final short DATE
public static final short TIME
public static final short TIMEMILLI
public static final short MICROSECOND
public static final short NANOSECOND
public static final short PICOSECOND
Constructor Detail |
---|
public Datetime()
public Datetime(Datetime other)
other
- the Datetime object to copypublic Datetime(int year, int month, int dayOfMonth, int hour, int minute, int second, int millisecond)
year
- the yearmonth
- the month between 1-12dayOfMonth
- the day of the month between 1-31hour
- the hour of the day between 0-23minute
- the minute between 0-59second
- the second between 0-59millisecond
- the millisecond between 0-999public Datetime(int year, int month, int dayOfMonth)
year
- the yearmonth
- the month between 1-12dayOfMonth
- the day of the month between 1-31public Datetime(int hour, int minute, int second, int millisecond)
hour
- the hour of the day between 0-23minute
- the minute between 0-59second
- the second between 0-59millisecond
- the millisecond between 0-999public Datetime(java.util.Calendar calendar)
calendar
- the calendar object whose values are to be used to
construct a new DatetimeMethod Detail |
---|
public int year()
public int month()
public int dayOfMonth()
public int hour()
public int minute()
public int second()
public int milliSecond()
public int millisecond()
public int microsecond()
public int nanosecond()
public long picosecond()
public int timezoneOffsetMinutes()
public java.util.Calendar calendar()
public boolean isValidField(int fieldId)
hasParts(int)
public int parts()
public boolean hasParts(int parts)
parts
- the bitmap identifying which parts of this Datetime object
needs to be testedpublic boolean isValid()
public void setDatetime(int year, int month, int dayOfMonth, int hour, int minute, int second, int millisecond)
year
- the yearmonth
- the month between 1-12dayOfMonth
- the day of the month between 1-31hour
- the hour of the day between 0-23minute
- the minute between 0-59second
- the second between 0-59millisecond
- the millisecond between 0-999public void setDatetimeTz(int year, int month, int dayOfMonth, int hour, int minute, int second, int millisecond, int timezoneOffsetMinutes)
year
- the yearmonth
- the month between 1-12dayOfMonth
- the day of the month between 1-31hour
- the hour of the day between 0-23minute
- the minute between 0-59second
- the second between 0-59millisecond
- the millisecond between 0-999timezoneOffsetMinutes
- the timezone offset in minutespublic void setDate(int year, int month, int dayOfMonth)
year
- the yearmonth
- the month between 1-12dayOfMonth
- the day of the month between 1-31public void setDateTz(int year, int month, int dayOfMonth, int timezoneOffsetMinutes)
year
- the yearmonth
- the month between 1-12dayOfMonth
- the day of the month between 1-31timezoneOffsetMinutes
- the timezone offset in minutespublic void setTime(int hour, int minute, int second, int millisecond)
hour
- the hour of the day between 0-23minute
- the minute between 0-59second
- the second between 0-59millisecond
- the millisecond between 0-999public void setTimeTz(int hour, int minute, int second, int millisecond, int timezoneOffsetMinutes)
hour
- the hour of the day between 0-23minute
- the minute between 0-59second
- the second between 0-59millisecond
- the millisecond between 0-999timezoneOffsetMinutes
- the timezone offset in minutespublic void setDatetimeTz(java.util.Calendar calendar)
calendar
- the calendar object whose values are to be used to
construct a new Datetimepublic void setYear(int year)
year
- public void setMonth(int month)
month
- public void setDayOfMonth(int dayOfMonth)
dayOfMonth
- public void setHour(int hour)
hour
- public void setMinute(int minute)
minute
- public void setSecond(int second)
second
- public void setMilliSecond(int millisecond)
millisecond
- public void setMillisecond(int millisecond)
millisecond
- public void setMicrosecond(int microsecond)
microsecond
- public void setNanosecond(int nanosecond)
nanosecond
- public void setPicosecond(long picosecond)
picosecond
- public void setTimezoneOffsetMinutes(int timezoneOffsetMinutes)
timezoneOffsetMinutes
- public void clear()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |