ilog.tgo.model
Class IltState

java.lang.Object
  extended by ilog.tgo.model.IltState
All Implemented Interfaces:
IltDecorationSource, IlWithProperties
Direct Known Subclasses:
IltAlarmSystem.State, IltOSI.State, IltSimpleState

public abstract class IltState
extends Object
implements IltDecorationSource, IlWithProperties

This class is the base class for all classes defining the vocabulary of an object's state.

When creating a subclass of IltState, you have to statically allocate a new IltStateInfo instance for it; by convention this is assigned to a variable called metainfo.


Field Summary
protected  String _message
          Catalog message used to retrieve the state description for a specific locale
static IltStateInfo metainfo
          Contains metainformation about this IltState class.
 
Constructor Summary
protected IltState(String name, String description, String message)
          Creates an IltState.
 
Method Summary
 void copy(IltState from)
          Copy the values from the source state
static IlpFilter CreateNameFilter(String name)
          Filter which accepts state path that match a given string representation.
static IlpFilter CreateStateFilter(IltState state)
          Filter which accepts state path whose last component matches a given state.
 Object createValue()
          The following methods are implemented in those states that can contain other states, such as an aggregate state.
 boolean equals(Object obj)
          Support for hash tables
 String[] getAliases()
          Returns all names for the state.
 void getAllPaths(Vector result, ilog.tgo.model.internal.IltStatePath parentPath, IlpFilter filter, boolean all)
          This method verifies if the state being searched is this one, and if so it adds this state to the path list.
protected  String getAltName()
          Returns the alternate name of this symbolic value.
 Object getDefault()
           
 String getDescription(IlpContext context)
          Returns a description of the state for the application context.
 String getName()
          Returns the name of this symbolic value.
 Object getProperty(Object name)
          Returns the named property.
 IltStateInfo getStateInfo()
          Returns the IltStateInfo describing the class of this state.
 String getToolTipText(IlpContext context, IltObject obj)
          Returns a description of the state for the given application context.
 String getToolTipText(IltObject obj)
          Deprecated.  
 boolean hasDefault()
           
protected  boolean hasDescription(IlpContext context)
          Returns true if the state contains a non-empty description.
 int hashCode()
          Support for hash tables
 IltState intern()
          Returns a canonical representation for this object.
 boolean isInside(IltStateInfo superclass)
          Tests whether this state belongs to a given state class.
static boolean IsPropertyTransient(Object name)
          Returns whether a given named property is omitted by serialization.
 boolean isValid(Object value)
          Returns if the given value is valid for this state.
 void list(IlpContext context, IltStateListing listing, Object value)
          Generates a plain text listing of a state.
 void removeProperty(Object name)
          Removes the named property.
protected  void setAltName(String name)
          Sets the alternate name of this symbolic value.
 void setDescription(String d)
          Sets a new description to the state.
 void setMessage(String message)
          Sets the localized message that describes this state.
protected  void setName(String name)
          Sets the name of this symbolic value.
 void setProperty(Object name, Object value)
          Sets the named property.
static void SetPropertyTransient(Object name, boolean isTransient)
          Changes whether a given named property shall be omitted by serialization.
 String toString()
          Returns the String representation of this IltState's values.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

metainfo

public static IltStateInfo metainfo
Contains metainformation about this IltState class.

Internal method or field: do not use!

_message

protected String _message
Catalog message used to retrieve the state description for a specific locale

Internal method or field: do not use!
Constructor Detail

IltState

protected IltState(String name,
                   String description,
                   String message)
Creates an IltState.

Parameters:
name - Name of the state.
description - Default description of the state, used to represent the state as a text. It is used when message is not null.
message - Catalog message entry, used to retrieve the localized description of the state.
Internal method or field: do not use!
Method Detail

getStateInfo

public IltStateInfo getStateInfo()
Returns the IltStateInfo describing the class of this state.

Internal method or field: do not use!

isInside

public boolean isInside(IltStateInfo superclass)
Tests whether this state belongs to a given state class.

Internal method or field: do not use!

intern

public IltState intern()
Returns a canonical representation for this object.

This function is typically used after deserialization of a state. Its use is necessary with JDK 1.1.x, and not needed any more with JDK 1.2.


toString

public String toString()
Returns the String representation of this IltState's values.

Overrides:
toString in class Object
Internal method or field: do not use!

setMessage

public void setMessage(String message)
Sets the localized message that describes this state.

Internal method or field: do not use!

setDescription

public void setDescription(String d)
Sets a new description to the state.

The description is displayed as tooltip when the state is graphically represented in the object as a secondary state.

Since:
JTGO 4.5

getDescription

public String getDescription(IlpContext context)
Returns a description of the state for the application context.

Internal method or field: do not use!

hasDescription

protected boolean hasDescription(IlpContext context)
Returns true if the state contains a non-empty description. When a description exists, the state can be represented as a text inside a information window for instance.

Internal method or field: do not use!

getName

public String getName()
Returns the name of this symbolic value.

Internal method or field: do not use!

setName

protected void setName(String name)
Sets the name of this symbolic value. This is meant to be called by constructors of subclasses only.

Internal method or field: do not use!

getAltName

protected String getAltName()
Returns the alternate name of this symbolic value.

Internal method or field: do not use!

setAltName

protected void setAltName(String name)
Sets the alternate name of this symbolic value. This is meant to be called by constructors of subclasses only.

Internal method or field: do not use!

getAliases

public String[] getAliases()
Returns all names for the state.

Internal method or field: do not use!

copy

public void copy(IltState from)
Copy the values from the source state


list

public void list(IlpContext context,
                 IltStateListing listing,
                 Object value)
Generates a plain text listing of a state. The text is generated when the value of the state is true.

Internal method or field: do not use!

createValue

public Object createValue()
The following methods are implemented in those states that can contain other states, such as an aggregate state.

Internal method or field: do not use!

hasDefault

public boolean hasDefault()
Internal method or field: do not use!

getDefault

public Object getDefault()
Internal method or field: do not use!

isValid

public boolean isValid(Object value)
Returns if the given value is valid for this state.

Internal method or field: do not use!

equals

public boolean equals(Object obj)
Support for hash tables

Overrides:
equals in class Object
Internal method or field: do not use!

hashCode

public int hashCode()
Support for hash tables

Overrides:
hashCode in class Object
Internal method or field: do not use!

CreateNameFilter

public static IlpFilter CreateNameFilter(String name)
Filter which accepts state path that match a given string representation. e.g: state path is "State.Administrative"

Internal method or field: do not use!

CreateStateFilter

public static IlpFilter CreateStateFilter(IltState state)
Filter which accepts state path whose last component matches a given state. e.g: state is [State][Administrative]

Internal method or field: do not use!

getAllPaths

public void getAllPaths(Vector result,
                        ilog.tgo.model.internal.IltStatePath parentPath,
                        IlpFilter filter,
                        boolean all)
This method verifies if the state being searched is this one, and if so it adds this state to the path list.

Parameters:
result - vector with the IltStatePath instances found
parentPath - path to the parent state
filter - criteria used to match the state
all - flag which indicates whether the query is stopped when the first path is found or not.
Internal method or field: do not use!

getToolTipText

public String getToolTipText(IltObject obj)
Deprecated. 

Returns a description of the state for the default application context.

Specified by:
getToolTipText in interface IltDecorationSource
Internal method or field: do not use!
Deprecated Since:
JTGO 3.1

getToolTipText

public String getToolTipText(IlpContext context,
                             IltObject obj)
Returns a description of the state for the given application context.

Specified by:
getToolTipText in interface IltDecorationSource
Internal method or field: do not use!

getProperty

public Object getProperty(Object name)
Returns the named property.

Specified by:
getProperty in interface IlWithProperties
Parameters:
name - Property identifier
Returns:
Returns the client property value.
Internal method or field: do not use!

setProperty

public void setProperty(Object name,
                        Object value)
Sets the named property.

Specified by:
setProperty in interface IlWithProperties
Parameters:
name - Property identifier
value - Property value
Internal method or field: do not use!

removeProperty

public void removeProperty(Object name)
Removes the named property.

Specified by:
removeProperty in interface IlWithProperties
Internal method or field: do not use!

IsPropertyTransient

public static boolean IsPropertyTransient(Object name)
Returns whether a given named property is omitted by serialization.

By default, all named properties are serialized.

Internal method or field: do not use!

SetPropertyTransient

public static void SetPropertyTransient(Object name,
                                        boolean isTransient)
Changes whether a given named property shall be omitted by serialization.

By default, all named properties are serialized.

Internal method or field: do not use!


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.