com.jstatcom.model
Class AbstractJSCData
- java.lang.Object
-
- com.jstatcom.model.AbstractJSCData
-
- All Implemented Interfaces:
- JSCData
- Direct Known Subclasses:
- JSCDate, JSCDRange, JSCInt, JSCMap, JSCNArray, JSCNumber, JSCSArray, JSCString, JSCVoid
public abstract class AbstractJSCData extends java.lang.Object implements JSCData
Abstract implementation ofJSCDatawhich provides default functionality for handling the different listeners.
-
-
Constructor Summary
Constructors Constructor and Description AbstractJSCData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddJSCDataListener(JSCDataListener evtListener, JSCDataEventTypes evtType)Adds a listener that is notified when changes of typeevtTypeoccur in this object.java.lang.Stringdisplay()Default implementation that gets a string representing the value stored in thisJSCDataobject.java.lang.ObjectgetJSCProperty(JSCPropertyTypes type)Gets the value for a property type.voidremoveJSCDataListener(JSCDataListener evtListener)Removes aJSCDataListenerfrom all different listener lists.voidremoveJSCProperty(JSCPropertyTypes type)Removes the property value fortype.voidsetJSCProperty(JSCPropertyTypes type, java.lang.Object val)Set the value for a property type.java.lang.StringtoString()Gets a string representation of thisJSCDatainstance.
-
-
-
Method Detail
-
getJSCProperty
public java.lang.Object getJSCProperty(JSCPropertyTypes type)
Gets the value for a property type.- Specified by:
getJSCPropertyin interfaceJSCData- Parameters:
type- the property type- Returns:
- the value or
nullif the property has not been set - Throws:
java.lang.IllegalArgumentException-if (type == null)
-
setJSCProperty
public void setJSCProperty(JSCPropertyTypes type, java.lang.Object val)
Set the value for a property type. Values are not serialized. The properties can be used to store runtime information associated with a data object.- Specified by:
setJSCPropertyin interfaceJSCData- Parameters:
type- the property typeval- the associated property value- Throws:
java.lang.IllegalArgumentException-if (type == null)
-
removeJSCProperty
public void removeJSCProperty(JSCPropertyTypes type)
Description copied from interface:JSCDataRemoves the property value fortype.- Specified by:
removeJSCPropertyin interfaceJSCData
-
toString
public java.lang.String toString()
Gets a string representation of thisJSCDatainstance.- Overrides:
toStringin classjava.lang.Object- Returns:
- string with name, type and value information
-
addJSCDataListener
public final void addJSCDataListener(JSCDataListener evtListener, JSCDataEventTypes evtType)
Description copied from interface:JSCDataAdds a listener that is notified when changes of typeevtTypeoccur in this object. All other events that are fired by this object are not dispatched toevtListener.- Specified by:
addJSCDataListenerin interfaceJSCData- Parameters:
evtListener- the listener object that gets notified when an event of typeevtTypegets firedevtType- the type of event thatevtListenerwants to listen to- See Also:
JSCData
-
display
public java.lang.String display()
Default implementation that gets a string representing the value stored in thisJSCDataobject.
-
removeJSCDataListener
public final void removeJSCDataListener(JSCDataListener evtListener)
Description copied from interface:JSCDataRemoves aJSCDataListenerfrom all different listener lists.- Specified by:
removeJSCDataListenerin interfaceJSCData- Parameters:
evtListener- the listener object to be removed- See Also:
JSCData
-
-
DMelt 3.0 © DataMelt by jWork.ORG