public class Date
extends java.lang.Object
implements oracle.jbo.domain.DomainInterface, java.io.Serializable
java.sql.Date, the native Java type for date objects. This wrapper allows an instance of the java.sql.Date to be used as a domain object. The intent of many of the methods in this class is to wrap the corresponding method in the java.sql.Date class such that it returns an instance of an oracle.jbo.domain.Date object.| Constructor and Description |
|---|
Date()
Creates a default
Date Domain object, representing the time now. |
Date(Date value)
Creates a
Date identical to an existing Date. |
Date(java.sql.Date value)
Creates a
Date Domain object from a JDBC Date. |
Date(long millis) |
Date(java.lang.Object value) |
Date(java.lang.String value)
Creates a
Date Domain object from a Java String. |
Date(java.sql.Timestamp value)
Creates a
Date Domain object from a JDBC Timestamp. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Date dt)
Returns -1 if Date is less than , 0 if Date and dt are equal (==), 1 if Date is greater than dt.
|
java.sql.Date |
dateValue() |
boolean |
equals(java.lang.Object other)
Tests
this for equality with another object. |
java.lang.Object |
getData() |
long |
getTime() |
java.util.Date |
getValue()
Return a java.util.Date object with this domain's value.
|
int |
hashCode()
Computes a hash code for
this. |
void |
setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx) |
java.sql.Timestamp |
timestampValue() |
java.lang.String |
toString()
Converts
this to a textual representation. |
public Date()
Date Domain object, representing the time now.public Date(java.sql.Timestamp value)
Date Domain object from a JDBC Timestamp.value - a Timestamp SQL object.public Date(Date value)
Date identical to an existing Date.value - a Date Domain object.public Date(long millis)
public Date(java.sql.Date value)
Date Domain object from a JDBC Date.value - a DATE SQL object.public Date(java.lang.String value)
Date Domain object from a Java String.
Note that we accept either a date string: "YYYY-MM-DD" or a timestamp sting: "YYYY-MM-DD HH:MI:SS.D"
value - a textual representation of a Date.public Date(java.lang.Object value)
public long getTime()
public java.util.Date getValue()
public java.lang.Object getData()
getData in interface oracle.jbo.domain.DomainInterface
public void setContext(oracle.jbo.domain.DomainOwnerInterface owner,
oracle.jbo.Transaction trans,
java.lang.Object ctx)
setContext in interface oracle.jbo.domain.DomainInterfacepublic java.lang.String toString()
this to a textual representation.toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
this for equality with another object. The argument is cast to a Date object, if possible.equals in class java.lang.Objectother - an arbitrary Object.true if conversion was successful and the converted argument is identical to this.public int compareTo(Date dt)
dt - input Oracle Datepublic int hashCode()
this.hashCode in class java.lang.Objectthis.public java.sql.Date dateValue()
public java.sql.Timestamp timestampValue()