org.escot
Class BasicNumber

java.lang.Object
  |
  +--org.escot.BasicFeature
        |
        +--org.escot.BasicValue
              |
              +--org.escot.BasicNumber
All Implemented Interfaces:
ChangeListener, EscotAssociated, EscotFeature, EventListener, NumberProperty
Direct Known Subclasses:
NumberAdapter

public class BasicNumber
extends BasicValue
implements NumberProperty, EscotAssociated, ChangeListener

Basic implementation of the NumberProperty interface.


Fields inherited from class org.escot.BasicValue
mChangeSupport
 
Fields inherited from class org.escot.BasicFeature
INITIAL_ATTR_CAPACITY, mAttributes, mPCSupport
 
Fields inherited from interface org.escot.EscotFeature
COLOR_ATTRIBUTE, DESCRIPTION_ATTRIBUTE, ICON16x16_ATTRIBUTE, TYPE_ATTRIBUTE
 
Constructor Summary
BasicNumber()
           
BasicNumber(double val)
           
BasicNumber(String name)
           
BasicNumber(String name, double val)
           
 
Method Summary
 void addAssociate(Object foreignAssociate)
          Invoked when the foreign associate is associated with.
 boolean canAddAssociate(Object foreignAssociate)
          Returns whether the object may add the foreign associate.
 EscotFeature duplicate()
          Features that should be duplicated when wired to return a duplicate to handle the next wire.
 Boolean getBooleanValue()
           
 Number getNumberValue()
          gets the value of this number property
 String getTextValue()
           
protected  void init(String name, double val)
           
 void setNumberValue(Number num)
           
 void stateChanged(ChangeEvent ev)
           
 
Methods inherited from class org.escot.BasicValue
addChangeListener, fireChangeEvent, removeAssociate, removeChangeListener
 
Methods inherited from class org.escot.BasicFeature
addPropertyChangeListener, getAttribute, getName, putAttribute, removePropertyChangeListener, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.escot.NumberProperty
addChangeListener, removeChangeListener, toString
 
Methods inherited from interface org.escot.EscotFeature
addPropertyChangeListener, getAttribute, getName, putAttribute, removePropertyChangeListener
 
Methods inherited from interface org.escot.EscotAssociated
removeAssociate
 

Constructor Detail

BasicNumber

public BasicNumber()

BasicNumber

public BasicNumber(String name)

BasicNumber

public BasicNumber(double val)

BasicNumber

public BasicNumber(String name,
                   double val)
Method Detail

init

protected void init(String name,
                    double val)

getNumberValue

public Number getNumberValue()
Description copied from interface: NumberProperty
gets the value of this number property
Specified by:
getNumberValue in interface NumberProperty
Overrides:
getNumberValue in class BasicValue
Following copied from interface: org.escot.NumberProperty
Returns:
the value of this number property

getTextValue

public String getTextValue()
Overrides:
getTextValue in class BasicValue

getBooleanValue

public Boolean getBooleanValue()
Overrides:
getBooleanValue in class BasicValue

stateChanged

public void stateChanged(ChangeEvent ev)
Specified by:
stateChanged in interface ChangeListener

setNumberValue

public void setNumberValue(Number num)
                    throws NotMutableException

canAddAssociate

public boolean canAddAssociate(Object foreignAssociate)
Description copied from interface: EscotAssociated
Returns whether the object may add the foreign associate.
Specified by:
canAddAssociate in interface EscotAssociated
Overrides:
canAddAssociate in class BasicValue
Following copied from interface: org.escot.EscotAssociated
Parameters:
foreignAssociate - the object to associate with

addAssociate

public void addAssociate(Object foreignAssociate)
Description copied from interface: EscotAssociated
Invoked when the foreign associate is associated with.
Specified by:
addAssociate in interface EscotAssociated
Following copied from interface: org.escot.EscotAssociated
Parameters:
foreignAssociate - the object to associate with

duplicate

public EscotFeature duplicate()
                       throws InstantiationException,
                              IllegalAccessException
Description copied from interface: EscotFeature
Features that should be duplicated when wired to return a duplicate to handle the next wire.
Specified by:
duplicate in interface EscotFeature
Overrides:
duplicate in class BasicFeature