public final class DfTime extends com.documentum.fc.common.DfObject implements IDfTime, java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
static DfTime |
DF_INVALIDDATE |
static java.lang.String |
DF_INVALIDDATE_STR |
static DfTime |
DF_NULLDATE |
static java.lang.String |
DF_NULLDATE_STR |
DF_TIME_PATTERN_DEFAULT, DF_TIME_PATTERN1, DF_TIME_PATTERN10, DF_TIME_PATTERN11, DF_TIME_PATTERN12, DF_TIME_PATTERN13, DF_TIME_PATTERN14, DF_TIME_PATTERN15, DF_TIME_PATTERN16, DF_TIME_PATTERN17, DF_TIME_PATTERN18, DF_TIME_PATTERN19, DF_TIME_PATTERN2, DF_TIME_PATTERN20, DF_TIME_PATTERN21, DF_TIME_PATTERN22, DF_TIME_PATTERN23, DF_TIME_PATTERN24, DF_TIME_PATTERN25, DF_TIME_PATTERN26, DF_TIME_PATTERN27, DF_TIME_PATTERN28, DF_TIME_PATTERN29, DF_TIME_PATTERN3, DF_TIME_PATTERN30, DF_TIME_PATTERN31, DF_TIME_PATTERN32, DF_TIME_PATTERN33, DF_TIME_PATTERN34, DF_TIME_PATTERN35, DF_TIME_PATTERN36, DF_TIME_PATTERN37, DF_TIME_PATTERN38, DF_TIME_PATTERN39, DF_TIME_PATTERN4, DF_TIME_PATTERN40, DF_TIME_PATTERN41, DF_TIME_PATTERN42, DF_TIME_PATTERN43, DF_TIME_PATTERN44, DF_TIME_PATTERN45, DF_TIME_PATTERN46, DF_TIME_PATTERN5, DF_TIME_PATTERN6, DF_TIME_PATTERN7, DF_TIME_PATTERN8, DF_TIME_PATTERN9
Constructor and Description |
---|
DfTime()
Creates a new DfTime object initialized to the current date.
|
DfTime(java.util.Date date) |
DfTime(java.lang.String dateString)
Creates a new instance initialized to the specified date where the date is specified in a string form.
|
DfTime(java.lang.String dateString,
java.text.DateFormat format)
Creates a new instance initialized to the specified date where the date is specified in a string form.
|
DfTime(java.lang.String dateString,
java.lang.String pattern)
Creates a new instance initialized to the specified date where the date is specified in a String form and is
parsed using the given pattern (also specified in String form).
|
DfTime(java.lang.String dateString,
java.lang.String pattern,
boolean interpretAsJavaPatternOnlyIgnored)
Creates a new instance initialized to the specified date where the date is specified in a String form and is
parsed using the given pattern (also specified in String form).
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asString(java.lang.String pattern)
Returns the date/time formatted according to the specified pattern.
|
int |
compareTo(IDfTime object)
Returns 1 if this date/time is later than the argument "time"; 0 if the
two date/times are the same; or -1 if this date/time object
represents an older time than the argument.
|
boolean |
equals(java.lang.Object o)
Returns
true if the argument is a DfTime object that
represents the same date/time as this object. |
java.util.Date |
getDate()
Returns the date as a Java Date.
|
int |
getDay()
Returns the day portion of the date as an integer (e.g., 28).
|
int |
getHour()
Returns the hour portion of the date as an integer.
|
int |
getMinutes()
Returns the minutes portion of the date as an integer.
|
int |
getMonth()
Returns the month portion of the date as an integer (e.g., 12).
|
java.lang.String |
getPattern()
Returns the pattern string used to format the date/time.
|
int |
getSeconds()
Returns the seconds portion of the date as an integer.
|
int |
getYear()
Returns the year portion of the date as an integer (e.g., 1998).
|
int |
hashCode() |
static boolean |
isKnownServerPattern(java.lang.String pattern)
Indicates whether the given date pattern is one of the known builtin server data patterns.
|
boolean |
isNullDate()
Indicates whether this object represents a NULLDATE.
|
boolean |
isValid()
Indicates whether the underlying date string has a valid format.
|
static boolean |
isValidPattern(java.lang.String pattern)
Indicates if the given date pattern is valid for use with DfTime.
|
void |
readExternal(java.io.ObjectInput in) |
java.lang.String |
toString()
Returns the time string used to construct the DfTime object, or, if
the DfTime object was constructed with a Java Date object, the result
of formatting the date/time using DF_TIME_PATTERN_DEFAULT.
|
static DfTime |
valueOf(java.lang.String string)
Returns a
DfTime with a value represented by the specified String. |
void |
writeExternal(java.io.ObjectOutput out) |
public static final java.lang.String DF_NULLDATE_STR
public static final DfTime DF_NULLDATE
public static final java.lang.String DF_INVALIDDATE_STR
public static final DfTime DF_INVALIDDATE
public DfTime()
public DfTime(java.util.Date date)
public DfTime(java.lang.String dateString)
public DfTime(java.lang.String dateString, java.lang.String pattern)
DfTime(String, String, boolean)
constructor.public DfTime(java.lang.String dateString, java.lang.String pattern, boolean interpretAsJavaPatternOnlyIgnored)
interpretAsJavaPatternOnly
is true then the
given pattern is interpretted as a Java pattern; otherwise calling this constructor is equivalent to calling
DfTime(String, String)
which means the pattern could be either a Docbase date pattern or a Java date
pattern.dateString
- The date string to parse.pattern
- The pattern to use to parse the date string.interpretAsJavaPatternOnlyIgnored
- public DfTime(java.lang.String dateString, java.text.DateFormat format)
public static DfTime valueOf(java.lang.String string)
DfTime
with a value represented by the specified String.string
- a string.DfTime
value represented by the string.public static boolean isValidPattern(java.lang.String pattern)
pattern
- The pattern to use to parse or format the date string.public int compareTo(IDfTime object)
IDfTime
myNullTime.compareTo(myInvalidTime)
would be 1
(myNullTime is bigger). If both this DfTime object and the
argument represent invalid times, 0 is returned. Otherwise,
NULLDATEs always preceed any valid time.public boolean equals(java.lang.Object o)
IDfTime
true
if the argument is a DfTime object that
represents the same date/time as this object. This method returns
false
if the two date/times are different, if the
argument is not of type DfTime, or if either this object or the
argument does not represent a valid time.
Note: This method returns a value of true if the method’s argument
represents a time that is within one second of the time that the
object represents.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String asString(java.lang.String pattern)
IDfTime
null
string argument or the string "NULLDATE", returns null
.public java.lang.String toString()
IDfTime
public final java.util.Date getDate()
IDfTime
getDate
in interface IDfTime
null
under the following conditions: 1) the object was constructed
with a null
date string or if that string
equals "nullstring" (ignoring case); 2) the object was
constructed with a date string that could not be parsed
with the provided pattern string (or with the default
pattern string if no pattern string was provided).public int getDay()
IDfTime
public int getHour()
IDfTime
public int getMinutes()
IDfTime
getMinutes
in interface IDfTime
public int getMonth()
IDfTime
public int getSeconds()
IDfTime
getSeconds
in interface IDfTime
public int getYear()
IDfTime
public boolean isValid()
IDfTime
public final boolean isNullDate()
IDfTime
isNullDate
in interface IDfTime
true
if the value of the DfTime object is
"nulldate" or if the DfTime object was constructed
with a null
string.public java.lang.String getPattern()
IDfTime
getPattern
in interface IDfTime
public static boolean isKnownServerPattern(java.lang.String pattern)
pattern
- a data pattern stringpublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
Copyright 1994-2023 OpenText Corporation. All rights reserved.