public abstract class AbstractComponent<T extends ComponentConfig> extends java.lang.Object implements IComponent<T>
コンストラクタと説明 |
---|
AbstractComponent(java.lang.String id,
T config)
コンストラクタ.
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
addListener(IComponentListener listener)
リスナーを登録します。
|
T |
getConfig()
設定値オブジェクトを取得します。
|
IDevice<?> |
getDevice()
所属しているデバイスを取得します。
|
java.lang.String |
getId()
IDを取得します。
|
java.util.List<IComponentListener> |
getListeners()
登録されているリスナー一覧を取得します。
|
java.lang.Number |
getValue()
保有している値を取得します。
|
void |
init(IDevice<?> device)
初期化処理を実行します。
|
protected void |
notifyException(java.lang.Exception e)
リスナーに例外発生を通知します。
|
protected void |
notifyStarted()
リスナーに開始イベントを伝達します。
|
protected void |
notifyStopped()
リスナーに停止イベントを伝達します。
|
protected void |
notifyUpdated()
リスナーに更新イベントを伝達します。
|
protected abstract void |
onInit()
初期化(init)実行時に呼び出されます。
|
protected abstract void |
onStart()
起動時の追加処理を実装するメソッドです。
|
protected abstract void |
onStop()
停止時の追加処理を実装するメソッドです。
|
boolean |
removeListener(IComponentListener listener)
リスナーを削除します。
|
protected void |
setDevice(IDevice<?> device)
所属するデバイスを登録します。
|
void |
setValue(java.lang.Number value)
値を設定します。
|
void |
start()
動作を開始します。
|
void |
stop()
動作を終了させます。
|
public AbstractComponent(java.lang.String id, T config)
id
- コンポーネントIDconfig
- 設定値オブジェクトpublic T getConfig()
IComponent
getConfig
インタフェース内 IComponent<T extends ComponentConfig>
public java.lang.String getId()
IComponent
getId
インタフェース内 IComponent<T extends ComponentConfig>
public java.lang.Number getValue()
IComponent
getValue
インタフェース内 IComponent<T extends ComponentConfig>
public void setValue(java.lang.Number value)
IComponent
setValue
インタフェース内 IComponent<T extends ComponentConfig>
value
- 数値public IDevice<?> getDevice()
IComponent
getDevice
インタフェース内 IComponent<T extends ComponentConfig>
protected void setDevice(IDevice<?> device)
device
- デバイスインスタンスpublic void addListener(IComponentListener listener)
IComponent
addListener
インタフェース内 IComponent<T extends ComponentConfig>
listener
- リスナーオブジェクトpublic java.util.List<IComponentListener> getListeners()
IComponent
getListeners
インタフェース内 IComponent<T extends ComponentConfig>
public boolean removeListener(IComponentListener listener)
IComponent
removeListener
インタフェース内 IComponent<T extends ComponentConfig>
listener
- 削除したいリスナーpublic void init(IDevice<?> device) throws java.lang.Exception
IComponent
init
インタフェース内 IComponent<T extends ComponentConfig>
device
- 所属するデバイスjava.lang.Exception
- 処理に失敗するとスローされます。public void start() throws java.lang.Exception
IComponent
start
インタフェース内 IComponent<T extends ComponentConfig>
java.lang.Exception
- 処理に失敗するとスローされます。public void stop() throws java.lang.Exception
IComponent
stop
インタフェース内 IComponent<T extends ComponentConfig>
java.lang.Exception
- 処理に失敗するとスローされます。protected void notifyStarted()
protected void notifyStopped()
protected void notifyUpdated()
protected void notifyException(java.lang.Exception e)
e
- protected abstract void onInit() throws java.lang.Exception
java.lang.Exception
- 処理に失敗するとスローされます。protected abstract void onStart() throws java.lang.Exception
java.lang.Exception
- 処理に失敗するとスローされます。protected abstract void onStop() throws java.lang.Exception
java.lang.Exception
- 処理に失敗するとスローされます。