|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--sos.dated.util.AbstractDatedObject
|
+--sos.dated.util.AbstractDatedValue
A partial implementation of a dated value. This abstract class makes it
easier to implement the DatedValue interface. To implement
an unmodifiable dated value, programmers should subclass this class and
define get and dateIterator(Date).
To make it modifiable, programmers must also define set.
ValueByDate,
DatedValue| Field Summary |
| Fields inherited from interface sos.dated.util.DatedObject |
MAX_DATE, MIN_DATE |
| Constructor Summary | |
protected |
AbstractDatedValue()
No-argument constructor available only to subclasses. |
| Method Summary | |
boolean |
equals(java.util.Date date,
DatedObject obj,
java.util.Date objDate)
Indicates if another dated object is equal to this dated object at specified dates. |
int |
hashCode(java.util.Date date)
This implementation invokes get to retrieve the value at the specified date If the value is null, it returns 0; otherwise, it returns the value's hash code. |
boolean |
is(java.lang.Object value,
java.util.Date date)
This implementation invokes get to retrieve the value at the specified date and tests for equality to the parameter (using equals if non-null). |
boolean |
isNotThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Returns true if this dated value does not have the specified value
at any date within the specified date range. |
boolean |
isThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Returns true if this dated value has a specified value throughout
the specified date range. |
DatedValue |
set(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Sets the value for a specified date range (optional operation). |
java.lang.String |
toString(java.util.Date date)
This implementation invokes get to retrieve the value at the specified date and then invokes String.valueOf to convert the value to a string. |
| Methods inherited from class sos.dated.util.AbstractDatedObject |
dateIterator, dateIterator, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface sos.dated.util.DatedValue |
get |
| Methods inherited from interface sos.dated.util.DatedObject |
dateIterator, dateIterator, equals, hashCode |
| Constructor Detail |
protected AbstractDatedValue()
| Method Detail |
public boolean equals(java.util.Date date,
DatedObject obj,
java.util.Date objDate)
equals in interface DatedValueequals in class AbstractDatedObjectdate - date at which this object should be testedobj - the other dated object to be compared toobjDate - the date of the other dated object
true if this dated object at date equals
another dated object at objDatepublic int hashCode(java.util.Date date)
hashCode in interface DatedValuehashCode in class AbstractDatedObjectdate - date to which the value should correspond
public boolean is(java.lang.Object value,
java.util.Date date)
is in interface DatedValuevalue - value whose presence is to be testeddate - date at which this dated value is to be queried
true if this dated value has a specified value at
a specified date
public boolean isNotThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
true if this dated value does not have the specified value
at any date within the specified date range.
This implementation iterates through the dates of this dated value, invoking
is at the start of each range.
isNotThroughout in interface DatedValuevalue - value whose presence is to be testedfrom - starting date (inclusive) at which containment should be testedto - ending date (exclusive) at which containment should be tested
true if this dated value has a specified value throughout
the specified date range
java.lang.NullPointerException - if from or to is null
java.lang.IllegalArgumentException - if from does not precede to
public boolean isThroughout(java.lang.Object value,
java.util.Date from,
java.util.Date to)
true if this dated value has a specified value throughout
the specified date range.
This implementation iterates through the dates of this dated value, invoking
is at the start of each range.
isThroughout in interface DatedValuevalue - Value whose presence is to be testedfrom - starting date at which containment should be testedto - ending date at which containment should be tested
true if this dated value has a specified value throughout
the specified date range
java.lang.NullPointerException - if from or to is null
java.lang.IllegalArgumentException - if from does not precede to
public DatedValue set(java.lang.Object value,
java.util.Date from,
java.util.Date to)
The returned value holds the old values before the call to set
and is applicable only for the specified date range.
It may be read-only, and it is not tied to this dated value.
This implementation throws an UnsupportedOperationException.
set in interface DatedValuevalue - value to be setfrom - starting date (inclusive) at which the value should holdto - ending date (exclusive) at which the value should hold
DatedValue indicating the
values held in the date range of interest before
the call to set.
java.lang.UnsupportedOperationException - alwayspublic java.lang.String toString(java.util.Date date)
String.valueOf to convert the value to a string.
toString in interface DatedObjecttoString in class AbstractDatedObjectdate - to which the string should correspond
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||