|
||||||||||
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.JSCString
public final class JSCString
A string wrapper that conforms to the JSCData
interface.
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.
Field Summary | |
---|---|
static javolution.xml.XmlFormat<JSCString> |
JSCString_XML
XML format field for (de)serialization. |
Constructor Summary | |
---|---|
JSCString(java.lang.String name)
Creates an empty JSCString . |
|
JSCString(java.lang.String name,
java.lang.String value)
Creates a JSCString from value . |
Method Summary | |
---|---|
void |
clear()
Clears this data object. |
JSCString |
copy()
Gets a copy of the current 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(java.lang.String newValue)
Sets the value of this to newValue . |
java.lang.String |
string()
Gets the stored string value. |
JSCTypes |
type()
Gets the type of this JSCData object. |
java.lang.Object |
value()
Gets the underlying value, which is stored as a String . |
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<JSCString> JSCString_XML
Constructor Detail |
---|
public JSCString(java.lang.String name)
JSCString
.
name
- the identifier of that object
java.lang.IllegalArgumentException
- if name
is not valid or
if (name == null)
JSCConstants.isValidName(java.lang.String)
public JSCString(java.lang.String name, java.lang.String value)
JSCString
from value
.
name
- the identifier of that objectvalue
- the String
to be used as 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 JSCString 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 isEmpty()
this
is empty. This method returns
true
, if value
returns null
.
It does not check whether the value string has a length > 0.
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(java.lang.String newValue)
newValue
. Fires a
JSCDataEvent
of type:
JSCDataEventTypes.VALUE_CHANGED
if
!newValue.equals(getString())
JSCDataEventTypes.EMPTY_STATE
if
newValue != null
and this was empty before
JSCDataEventTypes.EMPTY_STATE
if
newValue == null
and this was not empty before
newValue
- the new valuepublic java.lang.String string()
String
or null
if emptypublic JSCTypes type()
JSCData
object.
JSCTypes.STRING
JSCTypes
public java.lang.Object value()
String
.
null
if this
is
empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |