public class IltObjectState extends Object implements ilog.tgo.model.state.event.IltStateSystemListener, ilog.tgo.model.state.event.IltAlarmSystemListener, ilog.tgo.model.internal.IltTypedStateValueCollection, ilog.tgo.model.internal.IltTypedStatePathValueCollection, ilog.tgo.model.internal.IltStateValueChangeNotifier, ilog.cpl.model.internal.IlpCompositeAttributeValue, Cloneable
IltObject
.
The actual values that can be stored in subclasses of
IltObjectState
are instances of IltState
.
When you create a subclass of IltObjectState
, you have to
statically allocate a new IltObjectStateInfo
instance to it;
by convention, this is assigned to a variable called metainfo
.
IltObject
Modifier and Type | Field and Description |
---|---|
static IltObjectStateInfo |
metainfo
Contains metainformation about this
IltObjectState class. |
Modifier | Constructor and Description |
---|---|
protected |
IltObjectState()
Creates an
IltObjectState . |
|
IltObjectState(IltStateSystem states,
IltAlarmSystem alarms)
Constructor based in a state system
|
Modifier and Type | Method and Description |
---|---|
void |
addObjectStateListener(ilog.tgo.model.state.event.IltObjectStateListener listener)
Adds a new listener to an object state.
|
void |
attach(IltObject obj)
Attaches this object state to a given business object.
|
boolean |
clear(IltState state)
Removes a given constant state (defined in a state system) from
this state.
|
boolean |
clear(ilog.tgo.model.internal.IltStatePath path)
Clear the value of a state
|
Object |
clone()
Returns a copy of this state object.
|
void |
detach(IltObject obj)
Detaches this object state from a given business object.
|
void |
endChangingObjectState()
This method is called to indicate the end of changes in this
object state.
|
boolean |
equals(Object obj)
Compares this object with another object.
|
protected void |
fireObjectStateChanged()
Notifies that the object state has changed.
|
void |
fireObjectStateSet(ilog.tgo.model.internal.IltStatePath path,
Object value)
Notifies the registered listeners that the value of a state
has changed.
|
Object |
get(IltState state)
Returns the current value of a state.
|
Object |
get(ilog.tgo.model.internal.IltStatePath path)
Returns the current value of a state
|
ilog.tgo.model.internal.IltAggregateStateValue |
getAggregate(ilog.tgo.model.internal.IltAggregateState state)
Returns the current value of a state
|
ilog.tgo.model.internal.IltAggregateStateValue |
getAggregate(ilog.tgo.model.internal.IltStatePath path)
Returns the current value of a state
|
IltState |
getAlarmState()
Returns the alarm part of the state.
|
IltAlarmSystem |
getAlarmSystem()
Returns the Alarm System used by this instance.
|
Object |
getAttributeValue(String name)
Retrieves the value of an attribute of this object according to
the given name.
|
boolean |
getBoolean(IltBooleanState state)
Returns the current value of a state
|
boolean |
getBoolean(ilog.tgo.model.internal.IltStatePath path)
Returns the current value of a state
|
float |
getFloat(IltNumericState state)
Returns the current value of a state
|
float |
getFloat(ilog.tgo.model.internal.IltStatePath path)
Returns the current value of a state
|
int |
getInteger(IltNumericState state)
Returns the current value of a state
|
int |
getInteger(ilog.tgo.model.internal.IltStatePath path)
Returns the current value of a state
|
ilog.tgo.mapper.state.IltListStateStrategy |
getListStrategy()
Returns the strategy used to list the states.
|
ilog.tgo.mapper.state.IltMapStateStrategy |
getMapStrategy()
Returns the strategy used to map the state to their graphical
representation.
|
IltObjectStateInfo |
getObjectStateInfo()
Returns the IltObjectStateInfo describing the class of this object.
|
IltState |
getPrimaryState()
Returns the primary state present in this object state.
|
IltStateSystem |
getStateSystem()
Returns the state system used by this instance.
|
protected ilog.tgo.model.internal.IltStateValueTable |
getStateValueTable()
Returns the table which stores the states and values.
|
IltSymbolicStateValue |
getSymbolic(ilog.tgo.model.internal.IltStatePath path)
Returns the current value of a state
|
IltSymbolicStateValue |
getSymbolic(IltSymbolicState state)
Returns the current value of a state
|
IltState |
getTrapState()
Returns the trap part of the state.
|
boolean |
has(IltState state)
Tests whether this state contains a given constant state (defined in
a state system).
|
boolean |
has(ilog.tgo.model.internal.IltStatePath path)
Verifies if the given state is set.
|
Enumeration |
inverseStates()
Returns an enumeration of the states in this dictionary - from back to front.
|
Enumeration |
inverseValues()
Returns an enumeration of the values in this dictionary - from back to front.
|
boolean |
isValid()
Deprecated.
There are no longer invalid state combinations
|
void |
list(IltStateListing listing)
Deprecated.
|
void |
map(IltObject object,
IltCompositeGraphic graphic)
Maps an entire
IltObjectState . |
void |
removeObjectStateListener(ilog.tgo.model.state.event.IltObjectStateListener listener)
Removes a listener from a object state.
|
void |
reset()
Resets all the state values for the telecom object.
|
boolean |
set(IltState state)
Adds a given constant state (defined in a state system) to this
state.
|
boolean |
set(IltState state,
Object value)
Adds a given constant state (defined in a state system) to this
state.
|
boolean |
set(ilog.tgo.model.internal.IltStatePath path,
Object value)
Sets the value of a state.
|
boolean |
setAggregate(ilog.tgo.model.internal.IltAggregateState state,
ilog.tgo.model.internal.IltAggregateStateValue value)
Sets the value of the aggregate state
|
boolean |
setAggregate(ilog.tgo.model.internal.IltStatePath path,
ilog.tgo.model.internal.IltAggregateStateValue value)
Returns the current value of a state
|
protected void |
setAlarmSystem(IltAlarmSystem system)
Sets the alarm system being used by this instance.
|
boolean |
setBoolean(IltBooleanState state,
boolean value)
Sets the value of a state
|
boolean |
setBoolean(ilog.tgo.model.internal.IltStatePath path,
boolean value)
Sets the value of a state
|
boolean |
setFloat(IltNumericState state,
float value)
Sets the value of a state
|
boolean |
setFloat(ilog.tgo.model.internal.IltStatePath path,
float value)
Sets the value of a state
|
boolean |
setInteger(IltNumericState state,
int value)
Sets the value of a state
|
boolean |
setInteger(ilog.tgo.model.internal.IltStatePath path,
int value)
Sets the value of a state
|
void |
setListStrategy(ilog.tgo.mapper.state.IltListStateStrategy strategy)
Sets the strategy applied in the list operation.
|
void |
setMapStrategy(ilog.tgo.mapper.state.IltMapStateStrategy strategy)
Sets the strategy applied in the mapping procedure.
|
protected void |
setStateSystem(IltStateSystem system)
Sets the state system being used by this instance.
|
boolean |
setSymbolic(ilog.tgo.model.internal.IltStatePath path,
IltSymbolicStateValue value)
Returns the current value of a state
|
boolean |
setSymbolic(IltSymbolicState state,
IltSymbolicStateValue value)
Returns the current value of a state
|
void |
severityAdded(ilog.tgo.model.state.event.IltAlarmSystemEvent event)
This method is called when an alarm severity is added to the system.
|
void |
severityRemoved(ilog.tgo.model.state.event.IltAlarmSystemEvent event)
This method is called when a state is removed from the system.
|
void |
startChangingObjectState()
This method is called to indicate the beginning of changes in
this object state.
|
void |
stateAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
This method is called when a state is added to the system.
|
void |
stateRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
This method is called when a state is removed from the system.
|
Enumeration |
states()
Returns an enumeration of the states in this dictionary.
|
void |
stateSystemAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
This method is called when a state system is added to the system,
through the
useStateSystem method. |
void |
stateSystemRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
This method is called when a state is removed from the system,
through the
unUseStateSystem method. |
Enumeration |
values()
Returns an enumeration of the values in this dictionary.
|
public static IltObjectStateInfo metainfo
IltObjectState
class.protected IltObjectState()
IltObjectState
.public IltObjectState(IltStateSystem states, IltAlarmSystem alarms)
states
- state system from where the object state is basedalarms
- alarm system from where the object state is basedpublic boolean has(IltState state)
has
in interface ilog.tgo.model.internal.IltStateValueCollection
state
- State being tested.true
when the given state is part of the collection.public boolean set(IltState state)
public boolean clear(IltState state)
clear
in interface ilog.tgo.model.internal.IltStateValueCollection
state
- State to be removed.true
when the operation resulted in a modification of
the collection.public void reset()
@Deprecated public boolean isValid()
Note: While an object state is invalid, it is not
permitted to call computeGraphic()
on it. To avoid an
exception in this case, computeGraphic()
can be temporarily
inhibited using IltObject.startDelayingComputeGraphic
and
IltObject.StartDelayingComputeGraphic
.
public IltState getAlarmState()
IltAlarm.State
.public IltState getTrapState()
IltTrap.State
.public IltObjectStateInfo getObjectStateInfo()
public void map(IltObject object, IltCompositeGraphic graphic)
IltObjectState
. This means: compute the graphic
representation for this state.
This function is usually implemented by recursion on the
IltState
instances contained in this object state.
object
- The telecom object containing this semantic state.graphic
- A graphic object representing the telecom object.@Deprecated public void list(IltStateListing listing)
This function is used to build the contents of the information window.
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public boolean equals(Object obj)
When subclassing IltObjectState
override this
method to validate the equality of added attributes.
protected void setStateSystem(IltStateSystem system)
public IltStateSystem getStateSystem()
protected void setAlarmSystem(IltAlarmSystem system)
public IltAlarmSystem getAlarmSystem()
public void setMapStrategy(ilog.tgo.mapper.state.IltMapStateStrategy strategy)
public ilog.tgo.mapper.state.IltMapStateStrategy getMapStrategy()
public void setListStrategy(ilog.tgo.mapper.state.IltListStateStrategy strategy)
public ilog.tgo.mapper.state.IltListStateStrategy getListStrategy()
protected ilog.tgo.model.internal.IltStateValueTable getStateValueTable()
public void addObjectStateListener(ilog.tgo.model.state.event.IltObjectStateListener listener)
listener
- new listener to the state system, must be an IltObjectStateListenerpublic void removeObjectStateListener(ilog.tgo.model.state.event.IltObjectStateListener listener)
listener
- listener to be removedpublic void stateAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
stateAdded
in interface ilog.tgo.model.state.event.IltStateSystemListener
event
- event indicating the state which was added and the
position in the system where this operation occurred.public void stateRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
stateRemoved
in interface ilog.tgo.model.state.event.IltStateSystemListener
event
- event indicating the state which was removed and the
position in the system where this operation occurred.public void stateSystemAdded(ilog.tgo.model.state.event.IltStateSystemEvent event)
useStateSystem
method.stateSystemAdded
in interface ilog.tgo.model.state.event.IltStateSystemListener
event
- event indicating the state which was added and the
position in the system where this operation occurred.public void stateSystemRemoved(ilog.tgo.model.state.event.IltStateSystemEvent event)
unUseStateSystem
method.stateSystemRemoved
in interface ilog.tgo.model.state.event.IltStateSystemListener
event
- event indicating the state which was removed and the
position in the system where this operation occurred.public void severityAdded(ilog.tgo.model.state.event.IltAlarmSystemEvent event)
severityAdded
in interface ilog.tgo.model.state.event.IltAlarmSystemListener
event
- event indicating the severity which was addedpublic void severityRemoved(ilog.tgo.model.state.event.IltAlarmSystemEvent event)
severityRemoved
in interface ilog.tgo.model.state.event.IltAlarmSystemListener
event
- event indicating the state which was removed and the
position in the system where this operation occurred.public Enumeration states()
states
in interface ilog.tgo.model.internal.IltStateValueCollection
public Enumeration values()
values
in interface ilog.tgo.model.internal.IltStateValueCollection
public Enumeration inverseStates()
public Enumeration inverseValues()
public IltState getPrimaryState()
public boolean set(IltState state, Object value) throws IltInvalidStateValueException
Please note that, to have this state set, it must be present
either in the IltStateSystem
or in the
IltAlarmSystem
to complete the operation.
set
in interface ilog.tgo.model.internal.IltStateValueCollection
state
- State to be added.value
- Value of the state.true
when the operation resulted in a modification of
the collection.IltInvalidStateValueException
public Object get(IltState state)
get
in interface ilog.tgo.model.internal.IltStateValueCollection
state
- The state inside the system.public ilog.tgo.model.internal.IltAggregateStateValue getAggregate(ilog.tgo.model.internal.IltAggregateState state)
getAggregate
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state whose value is being retrievedpublic boolean getBoolean(IltBooleanState state)
getBoolean
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state whose value is being retrievedpublic int getInteger(IltNumericState state)
getInteger
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state whose value is being retrievedpublic float getFloat(IltNumericState state)
getFloat
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state whose value is being retrievedpublic IltSymbolicStateValue getSymbolic(IltSymbolicState state)
getSymbolic
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state whose value is being retrievedpublic boolean setBoolean(IltBooleanState state, boolean value)
setBoolean
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state being setvalue
- value of the statepublic boolean setInteger(IltNumericState state, int value)
setInteger
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state being setvalue
- value of the statepublic boolean setFloat(IltNumericState state, float value)
setFloat
in interface ilog.tgo.model.internal.IltTypedStateValueCollection
state
- state being setvalue
- value of the statepublic boolean setSymbolic(IltSymbolicState state, IltSymbolicStateValue value)
state
- state whose value is being setvalue
- value being set, IltSymbolicStateValue
instance.public boolean setAggregate(ilog.tgo.model.internal.IltAggregateState state, ilog.tgo.model.internal.IltAggregateStateValue value)
state
- state whose value is being setvalue
- value being set, IltAggregateStateValue
instance.public boolean set(ilog.tgo.model.internal.IltStatePath path, Object value) throws IltInvalidStateValueException
This method verifies if the given
set
in interface ilog.tgo.model.internal.IltStatePathValueCollection
path
- path of the state inside the systemvalue
- value of the stateIltInvalidStateValueException
public boolean has(ilog.tgo.model.internal.IltStatePath path)
has
in interface ilog.tgo.model.internal.IltStatePathValueCollection
path
- path of the state inside the systempublic boolean clear(ilog.tgo.model.internal.IltStatePath path)
clear
in interface ilog.tgo.model.internal.IltStatePathValueCollection
path
- path of the state inside the systempublic Object get(ilog.tgo.model.internal.IltStatePath path)
get
in interface ilog.tgo.model.internal.IltStatePathValueCollection
path
- path of the state inside the systempublic ilog.tgo.model.internal.IltAggregateStateValue getAggregate(ilog.tgo.model.internal.IltStatePath path)
getAggregate
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systempublic boolean getBoolean(ilog.tgo.model.internal.IltStatePath path)
getBoolean
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systempublic int getInteger(ilog.tgo.model.internal.IltStatePath path)
getInteger
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systempublic float getFloat(ilog.tgo.model.internal.IltStatePath path)
getFloat
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systempublic IltSymbolicStateValue getSymbolic(ilog.tgo.model.internal.IltStatePath path)
getSymbolic
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systempublic boolean setBoolean(ilog.tgo.model.internal.IltStatePath path, boolean value)
setBoolean
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systemvalue
- value of the statepublic boolean setInteger(ilog.tgo.model.internal.IltStatePath path, int value)
setInteger
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systemvalue
- value of the statepublic boolean setFloat(ilog.tgo.model.internal.IltStatePath path, float value)
setFloat
in interface ilog.tgo.model.internal.IltTypedStatePathValueCollection
path
- path of the state inside the systemvalue
- value of the statepublic boolean setSymbolic(ilog.tgo.model.internal.IltStatePath path, IltSymbolicStateValue value)
path
- path of the state inside the systemvalue
- value being set, IltSymbolicStateValue
instance.public boolean setAggregate(ilog.tgo.model.internal.IltStatePath path, ilog.tgo.model.internal.IltAggregateStateValue value)
path
- path of the state inside the systemvalue
- value being set, IltAggregateStateValue
instance.public void startChangingObjectState()
endChangingObjectState()
is called.startChangingObjectState
in interface ilog.tgo.model.internal.IltStateValueChangeNotifier
public void endChangingObjectState()
endChangingObjectState()
.endChangingObjectState
in interface ilog.tgo.model.internal.IltStateValueChangeNotifier
public void fireObjectStateSet(ilog.tgo.model.internal.IltStatePath path, Object value)
fireObjectStateSet
in interface ilog.tgo.model.internal.IltStateValueChangeNotifier
path
- Path to the changed statevalue
- New state valuefireObjectStateChanged()
protected void fireObjectStateChanged()
This method should be called by subclasses of IltObjectState
when new attributes are modified, so that the notification is propagated to
the listeners and associated objects are updated accordingly.
public void attach(IltObject obj)
IltObject.setObjectState(IltObjectState)
public void detach(IltObject obj)
IltObject.setObjectState(IltObjectState)
public Object getAttributeValue(String name)
getAttributeValue
in interface ilog.cpl.model.internal.IlpCompositeAttributeValue
name
- The name of the attribute whose value is to be retrieved.VALUE_NOT_SET
if no
value has been set.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.