|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.model.AbstractJSCData com.jstatcom.model.JSCDRange
public final class JSCDRange
Adapter to TSDateRange
objects that conforms to the
JSCData
interface. Everytime something changes, a new
TSDateRange
object is created, because range objects are
immutable.
Whenever the value of this data object changes, registered
JSCDataListeners
are notified via a JSCDataEvent
.
If not otherwise stated, the event objects always contain the values before
the change and after the change.
This class is thread-safe. All access to mutable data is synchronized. All events are fired outside the synchronized blocks.
TSDateRange
Field Summary | |
---|---|
static javolution.xml.XmlFormat<JSCDRange> |
JSCDRange_XML
XML format field for (de)serialization. |
Constructor Summary | |
---|---|
JSCDRange(java.lang.String name)
Creates an empty JSCDRange . |
|
JSCDRange(java.lang.String name,
TSDateRange tsRange)
Creates a JSCDRange for a given TSDateRange . |
Method Summary | |
---|---|
void |
clear()
Clears this data object. |
JSCDRange |
copy()
Gets a copy of the current object. |
boolean |
encloses(JSCDate date)
Gets whether date is enclosed by this range. |
boolean |
encloses(JSCDRange dRange)
Gets whether dRange is enclosed by this range. |
TSDateRange |
getTSDateRange()
Gets the stored date object. |
boolean |
isEmpty()
Gets whether this is empty. |
boolean |
isEqual(JSCData o)
Gets whether the values of this data object and other are
logically equal. |
java.lang.String |
name()
Gets the name of the data object. |
void |
setVal(TSDateRange newRange)
Sets a new value to this date adapter. |
JSCTypes |
type()
Gets the type of this JSCData object. |
java.lang.Object |
value()
Gets the underlying value, which is stored as a TSDateRange . |
Methods inherited from class com.jstatcom.model.AbstractJSCData |
---|
addJSCDataListener, display, getJSCProperty, removeJSCDataListener, removeJSCProperty, setJSCProperty, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final javolution.xml.XmlFormat<JSCDRange> JSCDRange_XML
Constructor Detail |
---|
public JSCDRange(java.lang.String name)
JSCDRange
.
name
- the identifier of that object
java.lang.IllegalArgumentException
- if name
is not valid or
if (name == null)
JSCConstants.isValidName(java.lang.String)
public JSCDRange(java.lang.String name, TSDateRange tsRange)
JSCDRange
for a given TSDateRange
.
name
- the identifier of that objecttsRange
- the date value
java.lang.IllegalArgumentException
- if name
is not valid or
if (name == null)
JSCConstants.isValidName(java.lang.String)
Method Detail |
---|
public void clear()
this
data object. Fires:
JSCDataEventTypes.EMPTY_STATE
event
JSCDataEventTypes.VALUE_CHANGED
event
isEmpty
returns true
.
public JSCDRange copy()
JSCData
a.isEqual(a.copy())
- compares values
a.getName().equals(a.copy().getName())
- compares
name
JSCDataListeners
attached to the original object should
not be copied.
JSCData
public boolean encloses(JSCDate date)
date
is enclosed by this range.
date
- the JSCDate
to be checked
true
if date
ist enclosed by
this
java.lang.IllegalArgumentException
- if (date == null)
or
if (date.isEmpty())
or
if (isEmpty())
public boolean encloses(JSCDRange dRange)
dRange
is enclosed by this range.
dRange
- the JSCDRange
to be checked
true
if dRange
ist enclosed by
this
java.lang.IllegalArgumentException
- if (dRange == null)
or
if (dRange.isEmpty())
or
if (isEmpty())
public TSDateRange getTSDateRange()
TSDateRange
or null
if
emptypublic boolean isEmpty()
this
is empty. This method returns
true
, if value
returns null
.
true
if emptypublic boolean isEqual(JSCData o)
JSCData
other
are
logically equal.
true
if considered equal according to the logic of
the representationJSCData
public java.lang.String name()
JSCData
JSCConstants
.
JSCData
public void setVal(TSDateRange newRange)
JSCDataEvent
of type:
JSCDataEventTypes.VALUE_CHANGED
if
!newRange.equals(getTSDateRange())
JSCDataEventTypes.EMPTY_STATE
if
newRange != null
and this was empty before
JSCDataEventTypes.EMPTY_STATE
if
newRange == null
and this was not empty before
newRange
- the new range, if null
it is similar to
clear
public JSCTypes type()
JSCData
object.
JSCTypes.DRANGE
JSCTypes
public java.lang.Object value()
TSDateRange
.
null
if this
is
empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |