ilog.cpl.model
Class IlpDefaultAttribute

java.lang.Object
  extended by ilog.cpl.model.IlpDefaultAttribute
All Implemented Interfaces:
IlpAttribute
Direct Known Subclasses:
IlpComputedAttribute, IlpReferenceAttribute, IlpStaticAttribute, IltAlarmSeverityAttribute

public class IlpDefaultAttribute
extends Object
implements IlpAttribute

Default CPL attribute implementation. Instances of this class can be inserted as attributes in a CPL class or in attribute groups.

Since:
JTGO 3.0
See Also:
IlpClass, IlpAttributeGroup

Constructor Summary
IlpDefaultAttribute(String name, Class valueClass)
          Constructor.
IlpDefaultAttribute(String name, Class valueClass, boolean isTransient)
          Constructor.
IlpDefaultAttribute(String name, Class valueClass, Object defaultValue)
          Constructor.
IlpDefaultAttribute(String name, Class valueClass, Object defaultValue, boolean isTransient)
          Constructor.
 
Method Summary
 IlpAttributeGroup getAttributeGroup()
          Returns the attribute group where this attribute has been defined.
 Object getDefaultValue()
          Returns the default value for this attribute.
 String getName()
          Returns the name of the invoking attribute.
 Class getValueClass()
          Returns the attribute value class.
 boolean isTransient()
          Indicates whether this attribute should be persistent or not.
 void setAttributeGroup(IlpAttributeGroup group)
          Sets the attribute group; can be null when the attribute is removed from the attribute group.
protected  void setDefaultValue(Object v)
          Sets the default value for this attribute.
protected  void setName(String s)
          Sets the name of the invoking attribute.
protected  void setTransient(boolean t)
          Sets whether this attribute should be persistent or not.
protected  void setValueClass(Class c)
          Sets the attribute value class.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlpDefaultAttribute

public IlpDefaultAttribute(String name,
                           Class valueClass)
Constructor.

Parameters:
name - Attribute name.
valueClass - Attribute value class.

IlpDefaultAttribute

public IlpDefaultAttribute(String name,
                           Class valueClass,
                           boolean isTransient)
Constructor.

Parameters:
name - Attribute name.
valueClass - Attribute value class.
isTransient - true if the attribute is not persistent.

IlpDefaultAttribute

public IlpDefaultAttribute(String name,
                           Class valueClass,
                           Object defaultValue)
Constructor.

Parameters:
name - Attribute name.
valueClass - Attribute value class.
defaultValue - Default value for this attribute.

IlpDefaultAttribute

public IlpDefaultAttribute(String name,
                           Class valueClass,
                           Object defaultValue,
                           boolean isTransient)
Constructor.

Parameters:
name - Attribute name.
valueClass - Attribute value class.
defaultValue - Default value for this attribute.
isTransient - true if the attribute is not persistent.
Method Detail

getName

public String getName()
Returns the name of the invoking attribute.

Specified by:
getName in interface IlpAttribute

setName

protected void setName(String s)
Sets the name of the invoking attribute.

The name of the attribute is used as its identifier and should not be modified after adding the attribute to an attribute group.

Since:
JViews 7.5

getValueClass

public Class getValueClass()
Returns the attribute value class.

Specified by:
getValueClass in interface IlpAttribute

setValueClass

protected void setValueClass(Class c)
Sets the attribute value class.

Parameters:
c - New value class
Since:
JViews 7.5

getDefaultValue

public Object getDefaultValue()
Returns the default value for this attribute. If there is none, this method returns IlpAttributeValueHolder.VALUE_NOT_SET.

Specified by:
getDefaultValue in interface IlpAttribute
See Also:
IlpDefaultObject.initializeDefaultValues(), IlpDefaultObject.IlpDefaultObject(IlpClass, Object, boolean)

setDefaultValue

protected void setDefaultValue(Object v)
Sets the default value for this attribute. When no default value is required, the default value shall be set to IlpAttributeValueHolder.VALUE_NOT_SET

Since:
JViews 7.5

getAttributeGroup

public IlpAttributeGroup getAttributeGroup()
Returns the attribute group where this attribute has been defined.

Specified by:
getAttributeGroup in interface IlpAttribute

setAttributeGroup

public void setAttributeGroup(IlpAttributeGroup group)
Sets the attribute group; can be null when the attribute is removed from the attribute group.

Specified by:
setAttributeGroup in interface IlpAttribute

isTransient

public boolean isTransient()
Indicates whether this attribute should be persistent or not.

Specified by:
isTransient in interface IlpAttribute
Returns:
true if the attribute is transient, that is, NOT persistent.

setTransient

protected void setTransient(boolean t)
Sets whether this attribute should be persistent or not.

Parameters:
t - the attribute is transient, that is, NOT persistent.
Since:
JViews 7.5

toString

public String toString()
Overrides:
toString in class Object


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