ilog.cpl.util
Class IlpIndexedValueMap

java.lang.Object
  extended by ilog.cpl.util.IlpAbstractValueMap
      extended by ilog.cpl.util.IlpIndexedValueMap
All Implemented Interfaces:
IlpValueMap, Map

public class IlpIndexedValueMap
extends IlpAbstractValueMap

This class models a simple value map implementation, which associates typed keys with typed values.

The keys and values set to this value map are subject to type conversion. This is done using the default type converter or a type converter that is defined using the method setTypeConverter.

This class is to be used in CSS files to support property retrieval in value maps. The following example illustrates how this class is used in CSS files.

     #perceivedSeverityBackgroundMap {
        class: 'ilog.cpl.util.IlpIndexedValueMap';
        keyClass: 'java.lang.Integer';
        valueClass: 'java.awt.Color';
        keys[0]: 0;
        keys[1]: 1;
        keys[2]: 2;
        keys[3]: 3;
        keys[4]: 4;
        keys[5]: 5;
        values[0]: '@|blinkingcolor("green", "blue")';
        values[1]: '@|blinkingcolor("red", "blue")';
        values[2]: '@|blinkingcolor("yellow", "blue")';
        values[3]: '@|blinkingcolor("white", "blue")';
        values[4]: '@|blinkingcolor("black", "blue")';
        values[5]: '@|blinkingcolor("pink", "blue")';
     }
 

IlpIndexedValueMap is created as a JavaBean with mandatory properties that define the key and value types.

This class only differs from IlpOrderedValueMap in the way that its values and keys are declared. Whereas IlpOrderedValueMap supports only simple types that can be written and converted from String to the specific type using the registered type converter, IlpIndexedValueMap allows you to create beans using the CSS syntax, or to create instances through the CSS functions on a per-entry basis. When declaring an IlpIndexedValueMap in a CSS, each entry must be specified, as illustrated above.

Compatibility Note: In JViews 8.0, this class was moved from ilog.cpl.service to ilog.cpl.util.

Since:
JViews 8.0
See Also:
IlpValueMapFunction

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
IlpIndexedValueMap()
          Default constructor.
 
Method Summary
 void setKeys(int index, Object key)
          Sets in the value map a key at the given index.
 void setKeys(Object[] k)
          Sets the keys present in the value map.
 void setValues(int index, Object v)
          Sets a value at the given index in this value map.
 void setValues(Object[] v)
          Sets the values present in the value map.
 
Methods inherited from class ilog.cpl.util.IlpAbstractValueMap
addValue, clear, containsKey, containsValue, entrySet, equals, get, getKeyClass, getKeys, getKeys, getTypeConverter, getValue, getValueClass, getValues, getValues, hashCode, isEmpty, keySet, put, putAll, remove, setKeyClass, setTypeConverter, setValueClass, size, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpIndexedValueMap

public IlpIndexedValueMap()
Default constructor.

Method Detail

setKeys

public void setKeys(Object[] k)
Sets the keys present in the value map.


setKeys

public void setKeys(int index,
                    Object key)
             throws ArrayIndexOutOfBoundsException
Sets in the value map a key at the given index.

Parameters:
index - Index of the key being set.
key - Key value.
Throws:
ArrayIndexOutOfBoundsException

setValues

public void setValues(Object[] v)
Sets the values present in the value map.

Parameters:
v - Values to be set in this value map.

setValues

public void setValues(int index,
                      Object v)
               throws ArrayIndexOutOfBoundsException
Sets a value at the given index in this value map.

Parameters:
index - Index of the value being set.
v - Value.
Throws:
ArrayIndexOutOfBoundsException


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