ilog.cpl.model
Class IlpObjectReferenceAttribute

java.lang.Object
  extended by ilog.cpl.model.IlpDefaultAttribute
      extended by ilog.cpl.model.IlpReferenceAttribute
          extended by ilog.cpl.model.IlpObjectReferenceAttribute
All Implemented Interfaces:
IlpAttribute, IlpAttributeValueProvider

public class IlpObjectReferenceAttribute
extends IlpReferenceAttribute

This class defines an attribute that refers to another attribute in another attribute holder. It can be used to implement a type conversion, to allow different representations for the same attribute, or to refer to attributes in another attribute holder.

Since:
JTGO 3.0

Constructor Summary
IlpObjectReferenceAttribute(String name, Class valueClass, IlpAttribute referenceAttribute)
          Creates a new attribute with the given name and class.
IlpObjectReferenceAttribute(String name, IlpAttribute referenceAttribute)
          Creates a new attribute with the given name.
 
Method Summary
 IlpAttributeValueHolder getReferenceAttributeValueHolder(IlpAttributeValueHolder h)
          Returns the reference value holder for the given attribute value holder.
 Object getValue(IlpAttributeValueHolder h)
          Returns the value of the attribute in the given holder.
 void setReferenceAttributeValueHolder(IlpAttributeValueHolder key, IlpAttributeValueHolder reference)
          Sets the reference attribute holder.
 
Methods inherited from class ilog.cpl.model.IlpReferenceAttribute
getDefaultValue, getReferenceAttribute, isDependentOn, isTransient, setValueClass
 
Methods inherited from class ilog.cpl.model.IlpDefaultAttribute
getAttributeGroup, getName, getValueClass, setAttributeGroup, setDefaultValue, setName, setTransient, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlpObjectReferenceAttribute

public IlpObjectReferenceAttribute(String name,
                                   IlpAttribute referenceAttribute)
Creates a new attribute with the given name. The value of the created attribute is given by the value of the reference attribute. The attribute class is given by the reference attribute class.

Parameters:
name - The name of the new attribute.
referenceAttribute - The attribute that is being referenced by this one.

IlpObjectReferenceAttribute

public IlpObjectReferenceAttribute(String name,
                                   Class valueClass,
                                   IlpAttribute referenceAttribute)
Creates a new attribute with the given name and class. The value of the created attribute is given by the reference attribute. This attribute value class may differ from the reference attribute value class.

Parameters:
name - The name of the new attribute.
valueClass - The attribute value class.
referenceAttribute - The attribute that is being referenced.
Method Detail

getReferenceAttributeValueHolder

public IlpAttributeValueHolder getReferenceAttributeValueHolder(IlpAttributeValueHolder h)
Returns the reference value holder for the given attribute value holder.

Parameters:
h - Holder
Returns:
The attribute value holder which is associated to the given argument

setReferenceAttributeValueHolder

public void setReferenceAttributeValueHolder(IlpAttributeValueHolder key,
                                             IlpAttributeValueHolder reference)
Sets the reference attribute holder.

Parameters:
key - Original attribute value holder
reference - Reference attribute value holder

getValue

public Object getValue(IlpAttributeValueHolder h)
Returns the value of the attribute in the given holder.

Specified by:
getValue in interface IlpAttributeValueProvider
Overrides:
getValue in class IlpReferenceAttribute


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